Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92091
b: refs/heads/master
c: c3daa92
h: refs/heads/master
i:
  92089: 6910ad7
  92087: 6642e04
v: v3
  • Loading branch information
Harvey Harrison authored and Takashi Iwai committed Apr 24, 2008
1 parent 7706643 commit becc899
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2948fc2f0e1c19b8bea77a14338d338e941ac9a
refs/heads/master: c3daa92d60552891057b65f278d882348b76fffe
40 changes: 24 additions & 16 deletions trunk/sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,28 +1297,32 @@ static void snd_ice1712_update_volume(struct snd_ice1712 *ice, int index)
static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
kcontrol->private_value;

spin_lock_irq(&ice->reg_lock);
ucontrol->value.integer.value[0] = !((ice->pro_volumes[index] >> 15) & 1);
ucontrol->value.integer.value[1] = !((ice->pro_volumes[index] >> 31) & 1);
ucontrol->value.integer.value[0] =
!((ice->pro_volumes[priv_idx] >> 15) & 1);
ucontrol->value.integer.value[1] =
!((ice->pro_volumes[priv_idx] >> 31) & 1);
spin_unlock_irq(&ice->reg_lock);
return 0;
}

static int snd_ice1712_pro_mixer_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
kcontrol->private_value;
unsigned int nval, change;

nval = (ucontrol->value.integer.value[0] ? 0 : 0x00008000) |
(ucontrol->value.integer.value[1] ? 0 : 0x80000000);
spin_lock_irq(&ice->reg_lock);
nval |= ice->pro_volumes[index] & ~0x80008000;
change = nval != ice->pro_volumes[index];
ice->pro_volumes[index] = nval;
snd_ice1712_update_volume(ice, index);
nval |= ice->pro_volumes[priv_idx] & ~0x80008000;
change = nval != ice->pro_volumes[priv_idx];
ice->pro_volumes[priv_idx] = nval;
snd_ice1712_update_volume(ice, priv_idx);
spin_unlock_irq(&ice->reg_lock);
return change;
}
Expand All @@ -1335,28 +1339,32 @@ static int snd_ice1712_pro_mixer_volume_info(struct snd_kcontrol *kcontrol, stru
static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
kcontrol->private_value;

spin_lock_irq(&ice->reg_lock);
ucontrol->value.integer.value[0] = (ice->pro_volumes[index] >> 0) & 127;
ucontrol->value.integer.value[1] = (ice->pro_volumes[index] >> 16) & 127;
ucontrol->value.integer.value[0] =
(ice->pro_volumes[priv_idx] >> 0) & 127;
ucontrol->value.integer.value[1] =
(ice->pro_volumes[priv_idx] >> 16) & 127;
spin_unlock_irq(&ice->reg_lock);
return 0;
}

static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
kcontrol->private_value;
unsigned int nval, change;

nval = (ucontrol->value.integer.value[0] & 127) |
((ucontrol->value.integer.value[1] & 127) << 16);
spin_lock_irq(&ice->reg_lock);
nval |= ice->pro_volumes[index] & ~0x007f007f;
change = nval != ice->pro_volumes[index];
ice->pro_volumes[index] = nval;
snd_ice1712_update_volume(ice, index);
nval |= ice->pro_volumes[priv_idx] & ~0x007f007f;
change = nval != ice->pro_volumes[priv_idx];
ice->pro_volumes[priv_idx] = nval;
snd_ice1712_update_volume(ice, priv_idx);
spin_unlock_irq(&ice->reg_lock);
return change;
}
Expand Down

0 comments on commit becc899

Please sign in to comment.