提交 6e06509c 编写于 作者: L Lars-Peter Clausen 提交者: Mark Brown

ASoC: wm8994: Use SOC_SINGLE_EXT() instead of open-coding it

Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 9578121c
...@@ -289,10 +289,8 @@ static const DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0); ...@@ -289,10 +289,8 @@ static const DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
static const DECLARE_TLV_DB_SCALE(mixin_boost_tlv, 0, 900, 0); static const DECLARE_TLV_DB_SCALE(mixin_boost_tlv, 0, 900, 0);
#define WM8994_DRC_SWITCH(xname, reg, shift) \ #define WM8994_DRC_SWITCH(xname, reg, shift) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ SOC_SINGLE_EXT(xname, reg, shift, 1, 0, \
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ snd_soc_get_volsw, wm8994_put_drc_sw)
.put = wm8994_put_drc_sw, \
.private_value = SOC_SINGLE_VALUE(reg, shift, 1, 0) }
static int wm8994_put_drc_sw(struct snd_kcontrol *kcontrol, static int wm8994_put_drc_sw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1432,10 +1430,8 @@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING, ...@@ -1432,10 +1430,8 @@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
}; };
#define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \ #define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ SOC_SINGLE_EXT(xname, reg, shift, max, invert, \
.info = snd_soc_info_volsw, \ snd_soc_get_volsw, wm8994_put_class_w)
.get = snd_soc_dapm_get_volsw, .put = wm8994_put_class_w, \
.private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
static int wm8994_put_class_w(struct snd_kcontrol *kcontrol, static int wm8994_put_class_w(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册