aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8580.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2011-10-05 03:29:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-05 12:10:08 -0400
commit0f9887d11e7c59ebae5e464f30a6dde788ed9011 (patch)
treea207635ae6f45a576f1ace0489b2c69043baa5ea /sound/soc/codecs/wm8580.c
parent7508b12a8eb713436feb65893ae7ada57bf165ce (diff)
ASoC: Consolidate use of controls with custom get/put function
Use the macros for controls require custom get/put function. This is to make sure that the soc_mixer_control is used consistently among the drivers. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Arun KS <arunks@mistralsolutions.com> Cc: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8580.c')
-rw-r--r--sound/soc/codecs/wm8580.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 4664c3a76c78..02cbf13b6c81 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -224,31 +224,19 @@ static int wm8580_out_vu(struct snd_kcontrol *kcontrol,
224 return 0; 224 return 0;
225} 225}
226 226
227#define SOC_WM8580_OUT_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, \
228 xinvert, tlv_array) \
229{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
230 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
231 SNDRV_CTL_ELEM_ACCESS_READWRITE, \
232 .tlv.p = (tlv_array), \
233 .info = snd_soc_info_volsw_2r, \
234 .get = snd_soc_get_volsw_2r, .put = wm8580_out_vu, \
235 .private_value = (unsigned long)&(struct soc_mixer_control) \
236 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
237 .max = xmax, .invert = xinvert} }
238
239static const struct snd_kcontrol_new wm8580_snd_controls[] = { 227static const struct snd_kcontrol_new wm8580_snd_controls[] = {
240SOC_WM8580_OUT_DOUBLE_R_TLV("DAC1 Playback Volume", 228SOC_DOUBLE_R_EXT_TLV("DAC1 Playback Volume",
241 WM8580_DIGITAL_ATTENUATION_DACL1, 229 WM8580_DIGITAL_ATTENUATION_DACL1,
242 WM8580_DIGITAL_ATTENUATION_DACR1, 230 WM8580_DIGITAL_ATTENUATION_DACR1,
243 0, 0xff, 0, dac_tlv), 231 0, 0xff, 0, snd_soc_get_volsw_2r, wm8580_out_vu, dac_tlv),
244SOC_WM8580_OUT_DOUBLE_R_TLV("DAC2 Playback Volume", 232SOC_DOUBLE_R_EXT_TLV("DAC2 Playback Volume",
245 WM8580_DIGITAL_ATTENUATION_DACL2, 233 WM8580_DIGITAL_ATTENUATION_DACL2,
246 WM8580_DIGITAL_ATTENUATION_DACR2, 234 WM8580_DIGITAL_ATTENUATION_DACR2,
247 0, 0xff, 0, dac_tlv), 235 0, 0xff, 0, snd_soc_get_volsw_2r, wm8580_out_vu, dac_tlv),
248SOC_WM8580_OUT_DOUBLE_R_TLV("DAC3 Playback Volume", 236SOC_DOUBLE_R_EXT_TLV("DAC3 Playback Volume",
249 WM8580_DIGITAL_ATTENUATION_DACL3, 237 WM8580_DIGITAL_ATTENUATION_DACL3,
250 WM8580_DIGITAL_ATTENUATION_DACR3, 238 WM8580_DIGITAL_ATTENUATION_DACR3,
251 0, 0xff, 0, dac_tlv), 239 0, 0xff, 0, snd_soc_get_volsw_2r, wm8580_out_vu, dac_tlv),
252 240
253SOC_SINGLE("DAC1 Deemphasis Switch", WM8580_DAC_CONTROL3, 0, 1, 0), 241SOC_SINGLE("DAC1 Deemphasis Switch", WM8580_DAC_CONTROL3, 0, 1, 0),
254SOC_SINGLE("DAC2 Deemphasis Switch", WM8580_DAC_CONTROL3, 1, 1, 0), 242SOC_SINGLE("DAC2 Deemphasis Switch", WM8580_DAC_CONTROL3, 1, 1, 0),