-#define snd_akm4xxx_ipga_gain_info snd_akm4xxx_volume_info
-
-static int snd_akm4xxx_ipga_gain_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
- int chip = AK_GET_CHIP(kcontrol->private_value);
- int addr = AK_GET_ADDR(kcontrol->private_value);
-
- ucontrol->value.integer.value[0] =
- snd_akm4xxx_get_ipga(ak, chip, addr);
- return 0;
-}
-
-static int put_ak_ipga(struct snd_kcontrol *kcontrol, int addr,
- unsigned char nval)
-{
- struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
- int chip = AK_GET_CHIP(kcontrol->private_value);
-
- if (snd_akm4xxx_get_ipga(ak, chip, addr) == nval)
- return 0;
- snd_akm4xxx_set_ipga(ak, chip, addr, nval);
- snd_akm4xxx_write(ak, chip, addr, nval | 0x80); /* need MSB */
- return 1;
-}
-
-static int snd_akm4xxx_ipga_gain_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- return put_ak_ipga(kcontrol, AK_GET_ADDR(kcontrol->private_value),
- ucontrol->value.integer.value[0]);
-}
-
-#define snd_akm4xxx_stereo_gain_info snd_akm4xxx_stereo_volume_info
-
-static int snd_akm4xxx_stereo_gain_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
- int chip = AK_GET_CHIP(kcontrol->private_value);
- int addr = AK_GET_ADDR(kcontrol->private_value);
-
- ucontrol->value.integer.value[0] =
- snd_akm4xxx_get_ipga(ak, chip, addr);
- ucontrol->value.integer.value[1] =
- snd_akm4xxx_get_ipga(ak, chip, addr + 1);
- return 0;
-}
-
-static int snd_akm4xxx_stereo_gain_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- int addr = AK_GET_ADDR(kcontrol->private_value);
- int change;
-
- change = put_ak_ipga(kcontrol, addr, ucontrol->value.integer.value[0]);
- change |= put_ak_ipga(kcontrol, addr + 1,
- ucontrol->value.integer.value[1]);
- return change;
-}
-