1 From 2f7b03ee22ad1597dc2f21797466ac477997b06f Mon Sep 17 00:00:00 2001
2 From: Florian Meier <florian.meier@koalo.de>
3 Date: Mon, 25 Jan 2016 15:48:59 +0000
4 Subject: [PATCH] ASoC: Add support for Rpi-DAC
7 sound/soc/codecs/Kconfig | 5 +++
8 sound/soc/codecs/Makefile | 2 ++
9 sound/soc/codecs/pcm1794a.c | 69 +++++++++++++++++++++++++++++++++++++
10 3 files changed, 76 insertions(+)
11 create mode 100644 sound/soc/codecs/pcm1794a.c
13 --- a/sound/soc/codecs/Kconfig
14 +++ b/sound/soc/codecs/Kconfig
15 @@ -134,6 +134,7 @@ config SND_SOC_ALL_CODECS
16 select SND_SOC_PCM179X_SPI if SPI_MASTER
17 select SND_SOC_PCM186X_I2C if I2C
18 select SND_SOC_PCM186X_SPI if SPI_MASTER
19 + select SND_SOC_PCM1794A if I2C
20 select SND_SOC_PCM3008
21 select SND_SOC_PCM3060_I2C if I2C
22 select SND_SOC_PCM3060_SPI if SPI_MASTER
23 @@ -985,6 +986,10 @@ config SND_SOC_RT5616
24 tristate "Realtek RT5616 CODEC"
27 +config SND_SOC_PCM1794A
32 tristate "Realtek ALC5631/RT5631 CODEC"
34 --- a/sound/soc/codecs/Makefile
35 +++ b/sound/soc/codecs/Makefile
36 @@ -134,6 +134,7 @@ snd-soc-pcm179x-spi-objs := pcm179x-spi.
37 snd-soc-pcm186x-objs := pcm186x.o
38 snd-soc-pcm186x-i2c-objs := pcm186x-i2c.o
39 snd-soc-pcm186x-spi-objs := pcm186x-spi.o
40 +snd-soc-pcm1794a-objs := pcm1794a.o
41 snd-soc-pcm3008-objs := pcm3008.o
42 snd-soc-pcm3060-objs := pcm3060.o
43 snd-soc-pcm3060-i2c-objs := pcm3060-i2c.o
44 @@ -430,6 +431,7 @@ obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc
45 obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o
46 obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o
47 obj-$(CONFIG_SND_SOC_RK3328) += snd-soc-rk3328.o
48 +obj-$(CONFIG_SND_SOC_PCM1794A) += snd-soc-pcm1794a.o
49 obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o
50 obj-$(CONFIG_SND_SOC_RL6347A) += snd-soc-rl6347a.o
51 obj-$(CONFIG_SND_SOC_RT1011) += snd-soc-rt1011.o
53 +++ b/sound/soc/codecs/pcm1794a.c
56 + * Driver for the PCM1794A codec
58 + * Author: Florian Meier <florian.meier@koalo.de>
61 + * This program is free software; you can redistribute it and/or
62 + * modify it under the terms of the GNU General Public License
63 + * version 2 as published by the Free Software Foundation.
65 + * This program is distributed in the hope that it will be useful, but
66 + * WITHOUT ANY WARRANTY; without even the implied warranty of
67 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
68 + * General Public License for more details.
72 +#include <linux/init.h>
73 +#include <linux/module.h>
74 +#include <linux/platform_device.h>
76 +#include <sound/soc.h>
78 +static struct snd_soc_dai_driver pcm1794a_dai = {
79 + .name = "pcm1794a-hifi",
83 + .rates = SNDRV_PCM_RATE_8000_192000,
84 + .formats = SNDRV_PCM_FMTBIT_S16_LE |
85 + SNDRV_PCM_FMTBIT_S24_LE
89 +static struct snd_soc_component_driver soc_component_dev_pcm1794a;
91 +static int pcm1794a_probe(struct platform_device *pdev)
93 + return snd_soc_register_component(&pdev->dev, &soc_component_dev_pcm1794a,
97 +static int pcm1794a_remove(struct platform_device *pdev)
99 + snd_soc_unregister_component(&pdev->dev);
103 +static const struct of_device_id pcm1794a_of_match[] = {
104 + { .compatible = "ti,pcm1794a", },
107 +MODULE_DEVICE_TABLE(of, pcm1794a_of_match);
109 +static struct platform_driver pcm1794a_component_driver = {
110 + .probe = pcm1794a_probe,
111 + .remove = pcm1794a_remove,
113 + .name = "pcm1794a-codec",
114 + .owner = THIS_MODULE,
115 + .of_match_table = of_match_ptr(pcm1794a_of_match),
119 +module_platform_driver(pcm1794a_component_driver);
121 +MODULE_DESCRIPTION("ASoC PCM1794A codec driver");
122 +MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
123 +MODULE_LICENSE("GPL v2");