diff options
| author | Mylène Josserand <mylene.josserand@free-electrons.com> | 2017-03-18 03:55:06 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2017-03-21 08:16:21 -0400 |
| commit | 649d55436137b397accb6a9d1b6975598c693bcd (patch) | |
| tree | 2f2705de92caf743ccd5db277cec5d908b9240b5 | |
| parent | a82f16188a32a3c889916c582ea2d9188e3c2734 (diff) | |
ASoC: sun8i-codec: Update mixer to use SOC_DAPM_DOUBLE
Update the driver to use the new SOC_DAPM_DOUBLE definition
on the digital DAC mixer.
Update the names accordingly as, when they are shared, the
controls are not prefixed with the widget's name anymore.
Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/sunxi/sun8i-codec.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index d60f6fbd36a2..107fa8213600 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c | |||
| @@ -259,25 +259,20 @@ static int sun8i_codec_hw_params(struct snd_pcm_substream *substream, | |||
| 259 | return 0; | 259 | return 0; |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | static const struct snd_kcontrol_new sun8i_output_left_mixer_controls[] = { | 262 | static const struct snd_kcontrol_new sun8i_dac_mixer_controls[] = { |
| 263 | SOC_DAPM_SINGLE("LSlot 0", SUN8I_DAC_MXR_SRC, | 263 | SOC_DAPM_DOUBLE("AIF1 Slot 0 Digital DAC Playback Switch", |
| 264 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA0L, 1, 0), | 264 | SUN8I_DAC_MXR_SRC, |
| 265 | SOC_DAPM_SINGLE("LSlot 1", SUN8I_DAC_MXR_SRC, | 265 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA0L, |
| 266 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA1L, 1, 0), | ||
| 267 | SOC_DAPM_SINGLE("DACL", SUN8I_DAC_MXR_SRC, | ||
| 268 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF2DACL, 1, 0), | ||
| 269 | SOC_DAPM_SINGLE("ADCL", SUN8I_DAC_MXR_SRC, | ||
| 270 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_ADCL, 1, 0), | ||
| 271 | }; | ||
| 272 | |||
| 273 | static const struct snd_kcontrol_new sun8i_output_right_mixer_controls[] = { | ||
| 274 | SOC_DAPM_SINGLE("RSlot 0", SUN8I_DAC_MXR_SRC, | ||
| 275 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA0R, 1, 0), | 266 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA0R, 1, 0), |
| 276 | SOC_DAPM_SINGLE("RSlot 1", SUN8I_DAC_MXR_SRC, | 267 | SOC_DAPM_DOUBLE("AIF1 Slot 1 Digital DAC Playback Switch", |
| 268 | SUN8I_DAC_MXR_SRC, | ||
| 269 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA1L, | ||
| 277 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA1R, 1, 0), | 270 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA1R, 1, 0), |
| 278 | SOC_DAPM_SINGLE("DACR", SUN8I_DAC_MXR_SRC, | 271 | SOC_DAPM_DOUBLE("AIF2 Digital DAC Playback Switch", SUN8I_DAC_MXR_SRC, |
| 272 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF2DACL, | ||
| 279 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF2DACR, 1, 0), | 273 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF2DACR, 1, 0), |
| 280 | SOC_DAPM_SINGLE("ADCR", SUN8I_DAC_MXR_SRC, | 274 | SOC_DAPM_DOUBLE("ADC Digital DAC Playback Switch", SUN8I_DAC_MXR_SRC, |
| 275 | SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_ADCL, | ||
| 281 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_ADCR, 1, 0), | 276 | SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_ADCR, 1, 0), |
| 282 | }; | 277 | }; |
| 283 | 278 | ||
| @@ -293,12 +288,12 @@ static const struct snd_soc_dapm_widget sun8i_codec_dapm_widgets[] = { | |||
| 293 | SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0R_ENA, 0), | 288 | SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0R_ENA, 0), |
| 294 | 289 | ||
| 295 | /* DAC Mixers */ | 290 | /* DAC Mixers */ |
| 296 | SND_SOC_DAPM_MIXER("Left DAC Mixer", SND_SOC_NOPM, 0, 0, | 291 | SND_SOC_DAPM_MIXER("Left Digital DAC Mixer", SND_SOC_NOPM, 0, 0, |
| 297 | sun8i_output_left_mixer_controls, | 292 | sun8i_dac_mixer_controls, |
| 298 | ARRAY_SIZE(sun8i_output_left_mixer_controls)), | 293 | ARRAY_SIZE(sun8i_dac_mixer_controls)), |
| 299 | SND_SOC_DAPM_MIXER("Right DAC Mixer", SND_SOC_NOPM, 0, 0, | 294 | SND_SOC_DAPM_MIXER("Right Digital DAC Mixer", SND_SOC_NOPM, 0, 0, |
| 300 | sun8i_output_right_mixer_controls, | 295 | sun8i_dac_mixer_controls, |
| 301 | ARRAY_SIZE(sun8i_output_right_mixer_controls)), | 296 | ARRAY_SIZE(sun8i_dac_mixer_controls)), |
| 302 | 297 | ||
| 303 | /* Clocks */ | 298 | /* Clocks */ |
| 304 | SND_SOC_DAPM_SUPPLY("MODCLK AFI1", SUN8I_MOD_CLK_ENA, | 299 | SND_SOC_DAPM_SUPPLY("MODCLK AFI1", SUN8I_MOD_CLK_ENA, |
| @@ -340,8 +335,10 @@ static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = { | |||
| 340 | { "Digital Right DAC", NULL, "DAC" }, | 335 | { "Digital Right DAC", NULL, "DAC" }, |
| 341 | 336 | ||
| 342 | /* DAC Mixer Routes */ | 337 | /* DAC Mixer Routes */ |
| 343 | { "Left DAC Mixer", "LSlot 0", "Digital Left DAC"}, | 338 | { "Left Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch", |
| 344 | { "Right DAC Mixer", "RSlot 0", "Digital Right DAC"}, | 339 | "Digital Left DAC"}, |
| 340 | { "Right Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch ", | ||
| 341 | "Digital Right DAC"}, | ||
| 345 | }; | 342 | }; |
| 346 | 343 | ||
| 347 | static struct snd_soc_dai_ops sun8i_codec_dai_ops = { | 344 | static struct snd_soc_dai_ops sun8i_codec_dai_ops = { |
