diff options
Diffstat (limited to 'sound/soc/codecs/wm8580.c')
-rw-r--r-- | sound/soc/codecs/wm8580.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 442ea6f160fc..9f6be3d31ac0 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -268,9 +268,11 @@ static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1); | |||
268 | static int wm8580_out_vu(struct snd_kcontrol *kcontrol, | 268 | static int wm8580_out_vu(struct snd_kcontrol *kcontrol, |
269 | struct snd_ctl_elem_value *ucontrol) | 269 | struct snd_ctl_elem_value *ucontrol) |
270 | { | 270 | { |
271 | struct soc_mixer_control *mc = | ||
272 | (struct soc_mixer_control *)kcontrol->private_value; | ||
271 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 273 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
272 | int reg = kcontrol->private_value & 0xff; | 274 | unsigned int reg = mc->reg; |
273 | int reg2 = (kcontrol->private_value >> 24) & 0xff; | 275 | unsigned int reg2 = mc->rreg; |
274 | int ret; | 276 | int ret; |
275 | u16 val; | 277 | u16 val; |
276 | 278 | ||
@@ -292,15 +294,17 @@ static int wm8580_out_vu(struct snd_kcontrol *kcontrol, | |||
292 | return 0; | 294 | return 0; |
293 | } | 295 | } |
294 | 296 | ||
295 | #define SOC_WM8580_OUT_DOUBLE_R_TLV(xname, reg_left, reg_right, shift, max, invert, tlv_array) \ | 297 | #define SOC_WM8580_OUT_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, \ |
298 | xinvert, tlv_array) \ | ||
296 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 299 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
297 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 300 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
298 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | 301 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
299 | .tlv.p = (tlv_array), \ | 302 | .tlv.p = (tlv_array), \ |
300 | .info = snd_soc_info_volsw_2r, \ | 303 | .info = snd_soc_info_volsw_2r, \ |
301 | .get = snd_soc_get_volsw_2r, .put = wm8580_out_vu, \ | 304 | .get = snd_soc_get_volsw_2r, .put = wm8580_out_vu, \ |
302 | .private_value = (reg_left) | ((shift) << 8) | \ | 305 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
303 | ((max) << 12) | ((invert) << 20) | ((reg_right) << 24) } | 306 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
307 | .max = xmax, .invert = xinvert} } | ||
304 | 308 | ||
305 | static const struct snd_kcontrol_new wm8580_snd_controls[] = { | 309 | static const struct snd_kcontrol_new wm8580_snd_controls[] = { |
306 | SOC_WM8580_OUT_DOUBLE_R_TLV("DAC1 Playback Volume", | 310 | SOC_WM8580_OUT_DOUBLE_R_TLV("DAC1 Playback Volume", |
@@ -522,7 +526,7 @@ static int wm8580_set_dai_pll(struct snd_soc_dai *codec_dai, | |||
522 | reg = wm8580_read(codec, WM8580_PLLA4 + offset); | 526 | reg = wm8580_read(codec, WM8580_PLLA4 + offset); |
523 | reg &= ~0x3f; | 527 | reg &= ~0x3f; |
524 | reg |= pll_div.prescale | pll_div.postscale << 1 | | 528 | reg |= pll_div.prescale | pll_div.postscale << 1 | |
525 | pll_div.freqmode << 4; | 529 | pll_div.freqmode << 3; |
526 | 530 | ||
527 | wm8580_write(codec, WM8580_PLLA4 + offset, reg); | 531 | wm8580_write(codec, WM8580_PLLA4 + offset, reg); |
528 | 532 | ||