~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/codecs/cs42xx8-i2c.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/soc/codecs/cs42xx8-i2c.c (Version linux-6.11-rc3) and /sound/soc/codecs/cs42xx8-i2c.c (Version linux-6.3.13)


  1 /*                                                  1 /*
  2  * Cirrus Logic CS42448/CS42888 Audio CODEC DA      2  * Cirrus Logic CS42448/CS42888 Audio CODEC DAI I2C driver
  3  *                                                  3  *
  4  * Copyright (C) 2014 Freescale Semiconductor,      4  * Copyright (C) 2014 Freescale Semiconductor, Inc.
  5  *                                                  5  *
  6  * Author: Nicolin Chen <Guangyu.Chen@freescal      6  * Author: Nicolin Chen <Guangyu.Chen@freescale.com>
  7  *                                                  7  *
  8  * This file is licensed under the terms of th      8  * This file is licensed under the terms of the GNU General Public License
  9  * version 2. This program is licensed "as is"      9  * version 2. This program is licensed "as is" without any warranty of any
 10  * kind, whether express or implied.               10  * kind, whether express or implied.
 11  */                                                11  */
 12                                                    12 
 13 #include <linux/i2c.h>                             13 #include <linux/i2c.h>
 14 #include <linux/module.h>                          14 #include <linux/module.h>
 15 #include <linux/mod_devicetable.h>             !!  15 #include <linux/of_device.h>
 16 #include <linux/pm_runtime.h>                      16 #include <linux/pm_runtime.h>
 17 #include <sound/soc.h>                             17 #include <sound/soc.h>
 18                                                    18 
 19 #include "cs42xx8.h"                               19 #include "cs42xx8.h"
 20                                                    20 
                                                   >>  21 static const struct of_device_id cs42xx8_of_match[];
                                                   >>  22 
 21 static int cs42xx8_i2c_probe(struct i2c_client     23 static int cs42xx8_i2c_probe(struct i2c_client *i2c)
 22 {                                                  24 {
 23         int ret;                                   25         int ret;
 24         struct cs42xx8_driver_data *drvdata;       26         struct cs42xx8_driver_data *drvdata;
                                                   >>  27         const struct of_device_id *of_id;
                                                   >>  28 
                                                   >>  29         of_id = of_match_device(cs42xx8_of_match, &i2c->dev);
                                                   >>  30         if (!of_id) {
                                                   >>  31                 dev_err(&i2c->dev, "failed to find driver data\n");
                                                   >>  32                 return -EINVAL;
                                                   >>  33         }
 25                                                    34 
 26         drvdata = (struct cs42xx8_driver_data  !!  35         drvdata = (struct cs42xx8_driver_data *)of_id->data;
 27         if (!drvdata)                          << 
 28                 return dev_err_probe(&i2c->dev << 
 29                                      "failed t << 
 30                                                    36 
 31         ret = cs42xx8_probe(&i2c->dev,             37         ret = cs42xx8_probe(&i2c->dev,
 32                 devm_regmap_init_i2c(i2c, &cs4     38                 devm_regmap_init_i2c(i2c, &cs42xx8_regmap_config), drvdata);
 33         if (ret)                                   39         if (ret)
 34                 return ret;                        40                 return ret;
 35                                                    41 
 36         pm_runtime_enable(&i2c->dev);              42         pm_runtime_enable(&i2c->dev);
 37         pm_request_idle(&i2c->dev);                43         pm_request_idle(&i2c->dev);
 38                                                    44 
 39         return 0;                                  45         return 0;
 40 }                                                  46 }
 41                                                    47 
 42 static void cs42xx8_i2c_remove(struct i2c_clie     48 static void cs42xx8_i2c_remove(struct i2c_client *i2c)
 43 {                                                  49 {
 44         pm_runtime_disable(&i2c->dev);             50         pm_runtime_disable(&i2c->dev);
 45 }                                                  51 }
 46                                                    52 
 47 static const struct of_device_id cs42xx8_of_ma     53 static const struct of_device_id cs42xx8_of_match[] = {
 48         { .compatible = "cirrus,cs42448", .dat     54         { .compatible = "cirrus,cs42448", .data = &cs42448_data, },
 49         { .compatible = "cirrus,cs42888", .dat     55         { .compatible = "cirrus,cs42888", .data = &cs42888_data, },
 50         { /* sentinel */ }                         56         { /* sentinel */ }
 51 };                                                 57 };
 52 MODULE_DEVICE_TABLE(of, cs42xx8_of_match);         58 MODULE_DEVICE_TABLE(of, cs42xx8_of_match);
 53                                                    59 
 54 static const struct i2c_device_id cs42xx8_i2c_     60 static const struct i2c_device_id cs42xx8_i2c_id[] = {
 55         {"cs42448", (kernel_ulong_t)&cs42448_d     61         {"cs42448", (kernel_ulong_t)&cs42448_data},
 56         {"cs42888", (kernel_ulong_t)&cs42888_d     62         {"cs42888", (kernel_ulong_t)&cs42888_data},
 57         {}                                         63         {}
 58 };                                                 64 };
 59 MODULE_DEVICE_TABLE(i2c, cs42xx8_i2c_id);          65 MODULE_DEVICE_TABLE(i2c, cs42xx8_i2c_id);
 60                                                    66 
 61 static struct i2c_driver cs42xx8_i2c_driver =      67 static struct i2c_driver cs42xx8_i2c_driver = {
 62         .driver = {                                68         .driver = {
 63                 .name = "cs42xx8",                 69                 .name = "cs42xx8",
 64                 .pm = &cs42xx8_pm,                 70                 .pm = &cs42xx8_pm,
 65                 .of_match_table = cs42xx8_of_m     71                 .of_match_table = cs42xx8_of_match,
 66         },                                         72         },
 67         .probe = cs42xx8_i2c_probe,            !!  73         .probe_new = cs42xx8_i2c_probe,
 68         .remove = cs42xx8_i2c_remove,              74         .remove = cs42xx8_i2c_remove,
 69         .id_table = cs42xx8_i2c_id,                75         .id_table = cs42xx8_i2c_id,
 70 };                                                 76 };
 71                                                    77 
 72 module_i2c_driver(cs42xx8_i2c_driver);             78 module_i2c_driver(cs42xx8_i2c_driver);
 73                                                    79 
 74 MODULE_DESCRIPTION("Cirrus Logic CS42448/CS428     80 MODULE_DESCRIPTION("Cirrus Logic CS42448/CS42888 ALSA SoC Codec I2C Driver");
 75 MODULE_AUTHOR("Freescale Semiconductor, Inc.")     81 MODULE_AUTHOR("Freescale Semiconductor, Inc.");
 76 MODULE_LICENSE("GPL");                             82 MODULE_LICENSE("GPL");
 77                                                    83 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php