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

TOMOYO Linux Cross Reference
Linux/sound/soc/codecs/cs35l45-spi.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/soc/codecs/cs35l45-spi.c (Architecture i386) and /sound/soc/codecs/cs35l45-spi.c (Architecture m68k)


  1 // SPDX-License-Identifier: GPL-2.0                 1 // SPDX-License-Identifier: GPL-2.0
  2 //                                                  2 //
  3 // cs35l45-spi.c -- CS35L45 SPI driver              3 // cs35l45-spi.c -- CS35L45 SPI driver
  4 //                                                  4 //
  5 // Copyright 2019-2022 Cirrus Logic, Inc.           5 // Copyright 2019-2022 Cirrus Logic, Inc.
  6 //                                                  6 //
  7 // Author: James Schulman <james.schulman@cirr      7 // Author: James Schulman <james.schulman@cirrus.com>
  8                                                     8 
  9 #include <linux/device.h>                           9 #include <linux/device.h>
 10 #include <linux/module.h>                          10 #include <linux/module.h>
 11 #include <linux/regmap.h>                          11 #include <linux/regmap.h>
 12 #include <linux/spi/spi.h>                         12 #include <linux/spi/spi.h>
 13                                                    13 
 14 #include "cs35l45.h"                               14 #include "cs35l45.h"
 15                                                    15 
 16 static int cs35l45_spi_probe(struct spi_device     16 static int cs35l45_spi_probe(struct spi_device *spi)
 17 {                                                  17 {
 18         struct cs35l45_private *cs35l45;           18         struct cs35l45_private *cs35l45;
 19         struct device *dev = &spi->dev;            19         struct device *dev = &spi->dev;
 20         int ret;                                   20         int ret;
 21                                                    21 
 22         cs35l45 = devm_kzalloc(dev, sizeof(str     22         cs35l45 = devm_kzalloc(dev, sizeof(struct cs35l45_private), GFP_KERNEL);
 23         if (cs35l45 == NULL)                       23         if (cs35l45 == NULL)
 24                 return -ENOMEM;                    24                 return -ENOMEM;
 25                                                    25 
 26         spi->max_speed_hz = CS35L45_SPI_MAX_FR     26         spi->max_speed_hz = CS35L45_SPI_MAX_FREQ;
 27         spi_setup(spi);                            27         spi_setup(spi);
 28                                                    28 
 29         spi_set_drvdata(spi, cs35l45);             29         spi_set_drvdata(spi, cs35l45);
 30         cs35l45->regmap = devm_regmap_init_spi     30         cs35l45->regmap = devm_regmap_init_spi(spi, &cs35l45_spi_regmap);
 31         if (IS_ERR(cs35l45->regmap)) {             31         if (IS_ERR(cs35l45->regmap)) {
 32                 ret = PTR_ERR(cs35l45->regmap)     32                 ret = PTR_ERR(cs35l45->regmap);
 33                 dev_err(dev, "Failed to alloca     33                 dev_err(dev, "Failed to allocate register map: %d\n", ret);
 34                 return ret;                        34                 return ret;
 35         }                                          35         }
 36                                                    36 
 37         cs35l45->dev = dev;                        37         cs35l45->dev = dev;
 38         cs35l45->irq = spi->irq;                   38         cs35l45->irq = spi->irq;
 39         cs35l45->bus_type = CONTROL_BUS_SPI;       39         cs35l45->bus_type = CONTROL_BUS_SPI;
 40                                                    40 
 41         return cs35l45_probe(cs35l45);             41         return cs35l45_probe(cs35l45);
 42 }                                                  42 }
 43                                                    43 
 44 static void cs35l45_spi_remove(struct spi_devi     44 static void cs35l45_spi_remove(struct spi_device *spi)
 45 {                                                  45 {
 46         struct cs35l45_private *cs35l45 = spi_     46         struct cs35l45_private *cs35l45 = spi_get_drvdata(spi);
 47                                                    47 
 48         cs35l45_remove(cs35l45);                   48         cs35l45_remove(cs35l45);
 49 }                                                  49 }
 50                                                    50 
 51 static const struct of_device_id cs35l45_of_ma     51 static const struct of_device_id cs35l45_of_match[] = {
 52         { .compatible = "cirrus,cs35l45" },        52         { .compatible = "cirrus,cs35l45" },
 53         {},                                        53         {},
 54 };                                                 54 };
 55 MODULE_DEVICE_TABLE(of, cs35l45_of_match);         55 MODULE_DEVICE_TABLE(of, cs35l45_of_match);
 56                                                    56 
 57 static const struct spi_device_id cs35l45_id_s     57 static const struct spi_device_id cs35l45_id_spi[] = {
 58         { "cs35l45", 0 },                          58         { "cs35l45", 0 },
 59         {}                                         59         {}
 60 };                                                 60 };
 61 MODULE_DEVICE_TABLE(spi, cs35l45_id_spi);          61 MODULE_DEVICE_TABLE(spi, cs35l45_id_spi);
 62                                                    62 
 63 static struct spi_driver cs35l45_spi_driver =      63 static struct spi_driver cs35l45_spi_driver = {
 64         .driver = {                                64         .driver = {
 65                 .name           = "cs35l45",       65                 .name           = "cs35l45",
 66                 .of_match_table = cs35l45_of_m     66                 .of_match_table = cs35l45_of_match,
 67                 .pm             = pm_ptr(&cs35     67                 .pm             = pm_ptr(&cs35l45_pm_ops),
 68         },                                         68         },
 69         .id_table       = cs35l45_id_spi,          69         .id_table       = cs35l45_id_spi,
 70         .probe          = cs35l45_spi_probe,       70         .probe          = cs35l45_spi_probe,
 71         .remove         = cs35l45_spi_remove,      71         .remove         = cs35l45_spi_remove,
 72 };                                                 72 };
 73 module_spi_driver(cs35l45_spi_driver);             73 module_spi_driver(cs35l45_spi_driver);
 74                                                    74 
 75 MODULE_DESCRIPTION("SPI CS35L45 driver");          75 MODULE_DESCRIPTION("SPI CS35L45 driver");
 76 MODULE_AUTHOR("James Schulman, Cirrus Logic In     76 MODULE_AUTHOR("James Schulman, Cirrus Logic Inc, <james.schulman@cirrus.com>");
 77 MODULE_LICENSE("GPL");                             77 MODULE_LICENSE("GPL");
 78 MODULE_IMPORT_NS(SND_SOC_CS35L45);                 78 MODULE_IMPORT_NS(SND_SOC_CS35L45);
 79                                                    79 

~ [ 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