aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs4271.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-11 08:15:10 -0400
committerMark Brown <broonie@linaro.org>2013-08-11 13:40:53 -0400
commit2e7fb942a30563125d6aac497fa0dcddbb7d731d (patch)
treef3a88c5fbb60f3041e04e127fe41e5d9ffef56d0 /sound/soc/codecs/cs4271.c
parentbad268f3504e2a58e406c3f0e282c1de629bd42f (diff)
ASoC: cs4271: Add DAPM support
This makes it possible to hook the device into a more complex board and ensures it will continue to work with non-DAPM support removed from the core. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Alexander Sverdlin <subaparts@yandex.ru>
Diffstat (limited to 'sound/soc/codecs/cs4271.c')
-rw-r--r--sound/soc/codecs/cs4271.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 65ad56c43c13..a20f1bb8f071 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -173,6 +173,26 @@ struct cs4271_private {
173 bool enable_soft_reset; 173 bool enable_soft_reset;
174}; 174};
175 175
176static const struct snd_soc_dapm_widget cs4271_dapm_widgets[] = {
177SND_SOC_DAPM_INPUT("AINA"),
178SND_SOC_DAPM_INPUT("AINB"),
179
180SND_SOC_DAPM_OUTPUT("AOUTA+"),
181SND_SOC_DAPM_OUTPUT("AOUTA-"),
182SND_SOC_DAPM_OUTPUT("AOUTB+"),
183SND_SOC_DAPM_OUTPUT("AOUTB-"),
184};
185
186static const struct snd_soc_dapm_route cs4271_dapm_routes[] = {
187 { "Capture", NULL, "AINA" },
188 { "Capture", NULL, "AINB" },
189
190 { "AOUTA+", NULL, "Playback" },
191 { "AOUTA-", NULL, "Playback" },
192 { "AOUTB+", NULL, "Playback" },
193 { "AOUTB-", NULL, "Playback" },
194};
195
176/* 196/*
177 * @freq is the desired MCLK rate 197 * @freq is the desired MCLK rate
178 * MCLK rate should (c) be the sample rate, multiplied by one of the 198 * MCLK rate should (c) be the sample rate, multiplied by one of the
@@ -598,6 +618,10 @@ static struct snd_soc_codec_driver soc_codec_dev_cs4271 = {
598 618
599 .controls = cs4271_snd_controls, 619 .controls = cs4271_snd_controls,
600 .num_controls = ARRAY_SIZE(cs4271_snd_controls), 620 .num_controls = ARRAY_SIZE(cs4271_snd_controls),
621 .dapm_widgets = cs4271_dapm_widgets,
622 .num_dapm_widgets = ARRAY_SIZE(cs4271_dapm_widgets),
623 .dapm_routes = cs4271_dapm_routes,
624 .num_dapm_routes = ARRAY_SIZE(cs4271_dapm_routes),
601}; 625};
602 626
603#if defined(CONFIG_SPI_MASTER) 627#if defined(CONFIG_SPI_MASTER)