diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:34 -0400 |
commit | 44347d947f628060b92449702071bfe1d31dfb75 (patch) | |
tree | c6ed74610d5b3295df4296659f80f5feb94b28cc /sound/soc/codecs/wm8580.c | |
parent | d94fc523f3c35bd8013f04827e94756cbc0212f4 (diff) | |
parent | 413f81eba35d6ede9289b0c8a920c013a84fac71 (diff) |
Merge branch 'linus' into tracing/core
Merge reason: tracing/core was on a .30-rc1 base and was missing out on
on a handful of tracing fixes present in .30-rc5-almost.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 | ||