diff options
Diffstat (limited to 'sound/soc/codecs/tlv320aic23-spi.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic23-spi.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sound/soc/codecs/tlv320aic23-spi.c b/sound/soc/codecs/tlv320aic23-spi.c new file mode 100644 index 000000000000..585aea436c6a --- /dev/null +++ b/sound/soc/codecs/tlv320aic23-spi.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * ALSA SoC TLV320AIC23 codec driver SPI interface | ||
3 | * | ||
4 | * Author: Arun KS, <arunks@mistralsolutions.com> | ||
5 | * Copyright: (C) 2008 Mistral Solutions Pvt Ltd., | ||
6 | * | ||
7 | * Based on sound/soc/codecs/wm8731.c by Richard Purdie | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/regmap.h> | ||
16 | #include <linux/spi/spi.h> | ||
17 | #include <sound/soc.h> | ||
18 | |||
19 | #include "tlv320aic23.h" | ||
20 | |||
21 | static int aic23_spi_probe(struct spi_device *spi) | ||
22 | { | ||
23 | int ret; | ||
24 | struct regmap *regmap; | ||
25 | |||
26 | dev_dbg(&spi->dev, "probing tlv320aic23 spi device\n"); | ||
27 | |||
28 | spi->bits_per_word = 16; | ||
29 | spi->mode = SPI_MODE_0; | ||
30 | ret = spi_setup(spi); | ||
31 | if (ret < 0) | ||
32 | return ret; | ||
33 | |||
34 | regmap = devm_regmap_init_spi(spi, &tlv320aic23_regmap); | ||
35 | return tlv320aic23_probe(&spi->dev, regmap); | ||
36 | } | ||
37 | |||
38 | static int aic23_spi_remove(struct spi_device *spi) | ||
39 | { | ||
40 | snd_soc_unregister_codec(&spi->dev); | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static struct spi_driver aic23_spi = { | ||
45 | .driver = { | ||
46 | .name = "tlv320aic23", | ||
47 | .owner = THIS_MODULE, | ||
48 | }, | ||
49 | .probe = aic23_spi_probe, | ||
50 | .remove = aic23_spi_remove, | ||
51 | }; | ||
52 | |||
53 | module_spi_driver(aic23_spi); | ||
54 | |||
55 | MODULE_DESCRIPTION("ASoC TLV320AIC23 codec driver SPI"); | ||
56 | MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>"); | ||
57 | MODULE_LICENSE("GPL"); | ||