summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic3x.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-13 15:06:04 +0100
committerTakashi Iwai <tiwai@suse.de>2009-02-13 15:06:04 +0100
commit99cbb86180bccd77f331f6e8eb7ce26aeea2cb72 (patch)
treedcec4dd738b59a18d524e80e09491bfbf130501e /sound/soc/codecs/tlv320aic3x.c
parent7c56c29a3bee36f71c7e37de88c9261d61e97e58 (diff)
parent14fa43f53ff3a9c3d8b9662574b7369812a31a97 (diff)
downloadblackbird-op-linux-99cbb86180bccd77f331f6e8eb7ce26aeea2cb72.tar.gz
blackbird-op-linux-99cbb86180bccd77f331f6e8eb7ce26aeea2cb72.zip
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound/soc/codecs/tlv320aic3x.c')
-rw-r--r--sound/soc/codecs/tlv320aic3x.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index b47a749c5ea2..aea0cb72d80a 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -165,10 +165,13 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
- int reg = kcontrol->private_value & 0xff;
- int shift = (kcontrol->private_value >> 8) & 0x0f;
- int mask = (kcontrol->private_value >> 16) & 0xff;
- int invert = (kcontrol->private_value >> 24) & 0x01;
+ struct soc_mixer_control *mc =
+ (struct soc_mixer_control *)kcontrol->private_value;
+ unsigned int reg = mc->reg;
+ unsigned int shift = mc->shift;
+ int max = mc->max;
+ unsigned int mask = (1 << fls(max)) - 1;
+ unsigned int invert = mc->invert;
unsigned short val, val_mask;
int ret;
struct snd_soc_dapm_path *path;
OpenPOWER on IntegriCloud