1 // SPDX-License-Identifier: GPL-2.0-only 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* 2 /* 3 * PCM3168A codec spi driver 3 * PCM3168A codec spi driver 4 * 4 * 5 * Copyright (C) 2015 Imagination Technologies 5 * Copyright (C) 2015 Imagination Technologies Ltd. 6 * 6 * 7 * Author: Damien Horsley <Damien.Horsley@imgt 7 * Author: Damien Horsley <Damien.Horsley@imgtec.com> 8 */ 8 */ 9 9 10 #include <linux/init.h> 10 #include <linux/init.h> 11 #include <linux/module.h> 11 #include <linux/module.h> 12 #include <linux/spi/spi.h> 12 #include <linux/spi/spi.h> 13 13 14 #include <sound/soc.h> 14 #include <sound/soc.h> 15 15 16 #include "pcm3168a.h" 16 #include "pcm3168a.h" 17 17 18 static int pcm3168a_spi_probe(struct spi_devic 18 static int pcm3168a_spi_probe(struct spi_device *spi) 19 { 19 { 20 struct regmap *regmap; 20 struct regmap *regmap; 21 21 22 regmap = devm_regmap_init_spi(spi, &pc 22 regmap = devm_regmap_init_spi(spi, &pcm3168a_regmap); 23 if (IS_ERR(regmap)) 23 if (IS_ERR(regmap)) 24 return PTR_ERR(regmap); 24 return PTR_ERR(regmap); 25 25 26 return pcm3168a_probe(&spi->dev, regma 26 return pcm3168a_probe(&spi->dev, regmap); 27 } 27 } 28 28 29 static void pcm3168a_spi_remove(struct spi_dev 29 static void pcm3168a_spi_remove(struct spi_device *spi) 30 { 30 { 31 pcm3168a_remove(&spi->dev); 31 pcm3168a_remove(&spi->dev); 32 } 32 } 33 33 34 static const struct spi_device_id pcm3168a_spi 34 static const struct spi_device_id pcm3168a_spi_id[] = { 35 { "pcm3168a", }, 35 { "pcm3168a", }, 36 { }, 36 { }, 37 }; 37 }; 38 MODULE_DEVICE_TABLE(spi, pcm3168a_spi_id); 38 MODULE_DEVICE_TABLE(spi, pcm3168a_spi_id); 39 39 40 static const struct of_device_id pcm3168a_of_m 40 static const struct of_device_id pcm3168a_of_match[] = { 41 { .compatible = "ti,pcm3168a", }, 41 { .compatible = "ti,pcm3168a", }, 42 { } 42 { } 43 }; 43 }; 44 MODULE_DEVICE_TABLE(of, pcm3168a_of_match); 44 MODULE_DEVICE_TABLE(of, pcm3168a_of_match); 45 45 46 static struct spi_driver pcm3168a_spi_driver = 46 static struct spi_driver pcm3168a_spi_driver = { 47 .probe = pcm3168a_spi_probe, 47 .probe = pcm3168a_spi_probe, 48 .remove = pcm3168a_spi_remove, 48 .remove = pcm3168a_spi_remove, 49 .id_table = pcm3168a_spi_id, 49 .id_table = pcm3168a_spi_id, 50 .driver = { 50 .driver = { 51 .name = "pcm3168a", 51 .name = "pcm3168a", 52 .of_match_table = pcm3168a_of_ 52 .of_match_table = pcm3168a_of_match, 53 .pm = &pcm3168a_pm 53 .pm = &pcm3168a_pm_ops, 54 }, 54 }, 55 }; 55 }; 56 module_spi_driver(pcm3168a_spi_driver); 56 module_spi_driver(pcm3168a_spi_driver); 57 57 58 MODULE_DESCRIPTION("PCM3168A SPI codec driver" 58 MODULE_DESCRIPTION("PCM3168A SPI codec driver"); 59 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@ 59 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>"); 60 MODULE_LICENSE("GPL v2"); 60 MODULE_LICENSE("GPL v2"); 61 61
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.