aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/ice1712/ice1712.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index df292af67381..38e93ca12e27 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -1297,11 +1297,14 @@ static void snd_ice1712_update_volume(struct snd_ice1712 *ice, int index)
1297static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1297static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1298{ 1298{
1299 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1299 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1300 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1300 int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
1301 kcontrol->private_value;
1301 1302
1302 spin_lock_irq(&ice->reg_lock); 1303 spin_lock_irq(&ice->reg_lock);
1303 ucontrol->value.integer.value[0] = !((ice->pro_volumes[index] >> 15) & 1); 1304 ucontrol->value.integer.value[0] =
1304 ucontrol->value.integer.value[1] = !((ice->pro_volumes[index] >> 31) & 1); 1305 !((ice->pro_volumes[priv_idx] >> 15) & 1);
1306 ucontrol->value.integer.value[1] =
1307 !((ice->pro_volumes[priv_idx] >> 31) & 1);
1305 spin_unlock_irq(&ice->reg_lock); 1308 spin_unlock_irq(&ice->reg_lock);
1306 return 0; 1309 return 0;
1307} 1310}
@@ -1309,16 +1312,17 @@ static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struc
1309static int snd_ice1712_pro_mixer_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1312static int snd_ice1712_pro_mixer_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1310{ 1313{
1311 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1314 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1312 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1315 int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
1316 kcontrol->private_value;
1313 unsigned int nval, change; 1317 unsigned int nval, change;
1314 1318
1315 nval = (ucontrol->value.integer.value[0] ? 0 : 0x00008000) | 1319 nval = (ucontrol->value.integer.value[0] ? 0 : 0x00008000) |
1316 (ucontrol->value.integer.value[1] ? 0 : 0x80000000); 1320 (ucontrol->value.integer.value[1] ? 0 : 0x80000000);
1317 spin_lock_irq(&ice->reg_lock); 1321 spin_lock_irq(&ice->reg_lock);
1318 nval |= ice->pro_volumes[index] & ~0x80008000; 1322 nval |= ice->pro_volumes[priv_idx] & ~0x80008000;
1319 change = nval != ice->pro_volumes[index]; 1323 change = nval != ice->pro_volumes[priv_idx];
1320 ice->pro_volumes[index] = nval; 1324 ice->pro_volumes[priv_idx] = nval;
1321 snd_ice1712_update_volume(ice, index); 1325 snd_ice1712_update_volume(ice, priv_idx);
1322 spin_unlock_irq(&ice->reg_lock); 1326 spin_unlock_irq(&ice->reg_lock);
1323 return change; 1327 return change;
1324} 1328}
@@ -1335,11 +1339,14 @@ static int snd_ice1712_pro_mixer_volume_info(struct snd_kcontrol *kcontrol, stru
1335static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1339static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1336{ 1340{
1337 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1341 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1338 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1342 int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
1343 kcontrol->private_value;
1339 1344
1340 spin_lock_irq(&ice->reg_lock); 1345 spin_lock_irq(&ice->reg_lock);
1341 ucontrol->value.integer.value[0] = (ice->pro_volumes[index] >> 0) & 127; 1346 ucontrol->value.integer.value[0] =
1342 ucontrol->value.integer.value[1] = (ice->pro_volumes[index] >> 16) & 127; 1347 (ice->pro_volumes[priv_idx] >> 0) & 127;
1348 ucontrol->value.integer.value[1] =
1349 (ice->pro_volumes[priv_idx] >> 16) & 127;
1343 spin_unlock_irq(&ice->reg_lock); 1350 spin_unlock_irq(&ice->reg_lock);
1344 return 0; 1351 return 0;
1345} 1352}
@@ -1347,16 +1354,17 @@ static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struc
1347static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1354static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1348{ 1355{
1349 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1356 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1350 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1357 int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
1358 kcontrol->private_value;
1351 unsigned int nval, change; 1359 unsigned int nval, change;
1352 1360
1353 nval = (ucontrol->value.integer.value[0] & 127) | 1361 nval = (ucontrol->value.integer.value[0] & 127) |
1354 ((ucontrol->value.integer.value[1] & 127) << 16); 1362 ((ucontrol->value.integer.value[1] & 127) << 16);
1355 spin_lock_irq(&ice->reg_lock); 1363 spin_lock_irq(&ice->reg_lock);
1356 nval |= ice->pro_volumes[index] & ~0x007f007f; 1364 nval |= ice->pro_volumes[priv_idx] & ~0x007f007f;
1357 change = nval != ice->pro_volumes[index]; 1365 change = nval != ice->pro_volumes[priv_idx];
1358 ice->pro_volumes[index] = nval; 1366 ice->pro_volumes[priv_idx] = nval;
1359 snd_ice1712_update_volume(ice, index); 1367 snd_ice1712_update_volume(ice, priv_idx);
1360 spin_unlock_irq(&ice->reg_lock); 1368 spin_unlock_irq(&ice->reg_lock);
1361 return change; 1369 return change;
1362} 1370}