summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKirill Marinushkin <kmarinushkin@birdec.tech>2018-12-07 14:02:34 -0500
committerMark Brown <broonie@kernel.org>2018-12-13 10:31:51 -0500
commitbb9963b850ea9e1ef39f4368eae83a9462f60166 (patch)
tree5dab26bebf9e3beb4e279e16a47fed831f0258c7 /sound
parent33f8db9a89200c18ff65d494a3dbd325d129e15e (diff)
ASoC: pcm3060: Add powersaving widgets for DAC and ADC
Enable DAC/ADC only when playing/capturing Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/pcm3060.c14
-rw-r--r--sound/soc/codecs/pcm3060.h2
2 files changed, 12 insertions, 4 deletions
diff --git a/sound/soc/codecs/pcm3060.c b/sound/soc/codecs/pcm3060.c
index 1dd851a7b43b..6714aa8d9026 100644
--- a/sound/soc/codecs/pcm3060.c
+++ b/sound/soc/codecs/pcm3060.c
@@ -198,19 +198,25 @@ static const struct snd_kcontrol_new pcm3060_dapm_controls[] = {
198}; 198};
199 199
200static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = { 200static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = {
201 SND_SOC_DAPM_DAC("DAC", "Playback", PCM3060_REG64,
202 PCM3060_REG_SHIFT_DAPSV, 1),
203
201 SND_SOC_DAPM_OUTPUT("OUTL"), 204 SND_SOC_DAPM_OUTPUT("OUTL"),
202 SND_SOC_DAPM_OUTPUT("OUTR"), 205 SND_SOC_DAPM_OUTPUT("OUTR"),
203 206
204 SND_SOC_DAPM_INPUT("INL"), 207 SND_SOC_DAPM_INPUT("INL"),
205 SND_SOC_DAPM_INPUT("INR"), 208 SND_SOC_DAPM_INPUT("INR"),
209
210 SND_SOC_DAPM_ADC("ADC", "Capture", PCM3060_REG64,
211 PCM3060_REG_SHIFT_ADPSV, 1),
206}; 212};
207 213
208static const struct snd_soc_dapm_route pcm3060_dapm_map[] = { 214static const struct snd_soc_dapm_route pcm3060_dapm_map[] = {
209 { "OUTL", NULL, "Playback" }, 215 { "OUTL", NULL, "DAC" },
210 { "OUTR", NULL, "Playback" }, 216 { "OUTR", NULL, "DAC" },
211 217
212 { "Capture", NULL, "INL" }, 218 { "ADC", NULL, "INL" },
213 { "Capture", NULL, "INR" }, 219 { "ADC", NULL, "INR" },
214}; 220};
215 221
216/* soc component */ 222/* soc component */
diff --git a/sound/soc/codecs/pcm3060.h b/sound/soc/codecs/pcm3060.h
index c895cf40ee10..6a027b4a845d 100644
--- a/sound/soc/codecs/pcm3060.h
+++ b/sound/soc/codecs/pcm3060.h
@@ -37,7 +37,9 @@ int pcm3060_remove(struct device *dev);
37#define PCM3060_REG_MRST 0x80 37#define PCM3060_REG_MRST 0x80
38#define PCM3060_REG_SRST 0x40 38#define PCM3060_REG_SRST 0x40
39#define PCM3060_REG_ADPSV 0x20 39#define PCM3060_REG_ADPSV 0x20
40#define PCM3060_REG_SHIFT_ADPSV 0x05
40#define PCM3060_REG_DAPSV 0x10 41#define PCM3060_REG_DAPSV 0x10
42#define PCM3060_REG_SHIFT_DAPSV 0x04
41#define PCM3060_REG_SE 0x01 43#define PCM3060_REG_SE 0x01
42 44
43#define PCM3060_REG65 0x41 45#define PCM3060_REG65 0x41