ASoC: twl6040: Simply call snd_soc_put_volsw form the custom code
The ASoC core now have one callback function, which can handle single, and double register mixer controls. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
974815ba4f
commit
db382da5ff
|
@ -746,7 +746,7 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol,
|
||||||
struct twl6040_output *out = NULL;
|
struct twl6040_output *out = NULL;
|
||||||
struct soc_mixer_control *mc =
|
struct soc_mixer_control *mc =
|
||||||
(struct soc_mixer_control *)kcontrol->private_value;
|
(struct soc_mixer_control *)kcontrol->private_value;
|
||||||
int ret, type_2r;
|
int ret;
|
||||||
|
|
||||||
/* For HS and HF we shadow the values and only actually write
|
/* For HS and HF we shadow the values and only actually write
|
||||||
* them out when active in order to ensure the amplifier comes on
|
* them out when active in order to ensure the amplifier comes on
|
||||||
|
@ -754,11 +754,9 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol,
|
||||||
switch (mc->reg) {
|
switch (mc->reg) {
|
||||||
case TWL6040_REG_HSGAIN:
|
case TWL6040_REG_HSGAIN:
|
||||||
out = &twl6040_priv->headset;
|
out = &twl6040_priv->headset;
|
||||||
type_2r = 0;
|
|
||||||
break;
|
break;
|
||||||
case TWL6040_REG_HFLGAIN:
|
case TWL6040_REG_HFLGAIN:
|
||||||
out = &twl6040_priv->handsfree;
|
out = &twl6040_priv->handsfree;
|
||||||
type_2r = 1;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -769,12 +767,7 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol,
|
||||||
if (!out->active)
|
if (!out->active)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* call the appropriate handler depending on the rreg */
|
ret = snd_soc_put_volsw(kcontrol, ucontrol);
|
||||||
if (type_2r)
|
|
||||||
ret = snd_soc_put_volsw_2r(kcontrol, ucontrol);
|
|
||||||
else
|
|
||||||
ret = snd_soc_put_volsw(kcontrol, ucontrol);
|
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue