mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
Merge remote-tracking branch 'asoc/topic/enum' into asoc-next
This commit is contained in:
commit
b8f861586c
27 changed files with 542 additions and 791 deletions
|
@ -108,13 +108,9 @@ struct device;
|
||||||
SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
|
SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
|
||||||
.kcontrol_news = wcontrols, .num_kcontrols = 1}
|
.kcontrol_news = wcontrols, .num_kcontrols = 1}
|
||||||
#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
|
#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
|
||||||
{ .id = snd_soc_dapm_virt_mux, .name = wname, \
|
SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols)
|
||||||
SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
|
|
||||||
.kcontrol_news = wcontrols, .num_kcontrols = 1}
|
|
||||||
#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
|
#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
|
||||||
{ .id = snd_soc_dapm_value_mux, .name = wname, \
|
SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols)
|
||||||
SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
|
|
||||||
.kcontrol_news = wcontrols, .num_kcontrols = 1}
|
|
||||||
|
|
||||||
/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
|
/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
|
||||||
#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
|
#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
|
||||||
|
@ -172,10 +168,8 @@ struct device;
|
||||||
.event = wevent, .event_flags = wflags}
|
.event = wevent, .event_flags = wflags}
|
||||||
#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
|
#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
|
||||||
wevent, wflags) \
|
wevent, wflags) \
|
||||||
{ .id = snd_soc_dapm_virt_mux, .name = wname, \
|
SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, wevent, \
|
||||||
SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
|
wflags)
|
||||||
.kcontrol_news = wcontrols, .num_kcontrols = 1, \
|
|
||||||
.event = wevent, .event_flags = wflags}
|
|
||||||
|
|
||||||
/* additional sequencing control within an event type */
|
/* additional sequencing control within an event type */
|
||||||
#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
|
#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
|
||||||
|
@ -312,11 +306,7 @@ struct device;
|
||||||
.put = snd_soc_dapm_put_enum_double, \
|
.put = snd_soc_dapm_put_enum_double, \
|
||||||
.private_value = (unsigned long)&xenum }
|
.private_value = (unsigned long)&xenum }
|
||||||
#define SOC_DAPM_ENUM_VIRT(xname, xenum) \
|
#define SOC_DAPM_ENUM_VIRT(xname, xenum) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
SOC_DAPM_ENUM(xname, xenum)
|
||||||
.info = snd_soc_info_enum_double, \
|
|
||||||
.get = snd_soc_dapm_get_enum_virt, \
|
|
||||||
.put = snd_soc_dapm_put_enum_virt, \
|
|
||||||
.private_value = (unsigned long)&xenum }
|
|
||||||
#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \
|
#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
||||||
.info = snd_soc_info_enum_double, \
|
.info = snd_soc_info_enum_double, \
|
||||||
|
@ -324,11 +314,7 @@ struct device;
|
||||||
.put = xput, \
|
.put = xput, \
|
||||||
.private_value = (unsigned long)&xenum }
|
.private_value = (unsigned long)&xenum }
|
||||||
#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
|
#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
SOC_DAPM_ENUM(xname, xenum)
|
||||||
.info = snd_soc_info_enum_double, \
|
|
||||||
.get = snd_soc_dapm_get_value_enum_double, \
|
|
||||||
.put = snd_soc_dapm_put_value_enum_double, \
|
|
||||||
.private_value = (unsigned long)&xenum }
|
|
||||||
#define SOC_DAPM_PIN_SWITCH(xname) \
|
#define SOC_DAPM_PIN_SWITCH(xname) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname " Switch", \
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname " Switch", \
|
||||||
.info = snd_soc_dapm_info_pin_switch, \
|
.info = snd_soc_dapm_info_pin_switch, \
|
||||||
|
@ -392,14 +378,6 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
struct snd_ctl_elem_value *ucontrol);
|
||||||
int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
|
int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
struct snd_ctl_elem_value *ucontrol);
|
||||||
int snd_soc_dapm_get_enum_virt(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
|
||||||
int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
|
||||||
int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
|
||||||
int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
|
||||||
int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol,
|
int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_info *uinfo);
|
struct snd_ctl_elem_info *uinfo);
|
||||||
int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
|
int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
|
||||||
|
@ -484,8 +462,6 @@ enum snd_soc_dapm_type {
|
||||||
snd_soc_dapm_input = 0, /* input pin */
|
snd_soc_dapm_input = 0, /* input pin */
|
||||||
snd_soc_dapm_output, /* output pin */
|
snd_soc_dapm_output, /* output pin */
|
||||||
snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
|
snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
|
||||||
snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */
|
|
||||||
snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */
|
|
||||||
snd_soc_dapm_mixer, /* mixes several analog signals together */
|
snd_soc_dapm_mixer, /* mixes several analog signals together */
|
||||||
snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
|
snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
|
||||||
snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
|
snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
|
||||||
|
|
|
@ -45,6 +45,11 @@
|
||||||
((unsigned long)&(struct soc_mixer_control) \
|
((unsigned long)&(struct soc_mixer_control) \
|
||||||
{.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
|
{.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
|
||||||
.max = xmax, .platform_max = xmax, .invert = xinvert})
|
.max = xmax, .platform_max = xmax, .invert = xinvert})
|
||||||
|
#define SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, xsign_bit, xinvert) \
|
||||||
|
((unsigned long)&(struct soc_mixer_control) \
|
||||||
|
{.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
|
||||||
|
.max = xmax, .min = xmin, .platform_max = xmax, .sign_bit = xsign_bit, \
|
||||||
|
.invert = xinvert})
|
||||||
#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
|
#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
|
||||||
((unsigned long)&(struct soc_mixer_control) \
|
((unsigned long)&(struct soc_mixer_control) \
|
||||||
{.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
|
{.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
|
||||||
|
@ -152,6 +157,15 @@
|
||||||
{.reg = xreg, .rreg = xrreg, \
|
{.reg = xreg, .rreg = xrreg, \
|
||||||
.shift = xshift, .rshift = xshift, \
|
.shift = xshift, .rshift = xshift, \
|
||||||
.max = xmax, .min = xmin} }
|
.max = xmax, .min = xmin} }
|
||||||
|
#define SOC_DOUBLE_R_S_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) \
|
||||||
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
|
||||||
|
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
|
||||||
|
SNDRV_CTL_ELEM_ACCESS_READWRITE,\
|
||||||
|
.tlv.p = (tlv_array), \
|
||||||
|
.info = snd_soc_info_volsw, \
|
||||||
|
.get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
|
||||||
|
.private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
|
||||||
|
xmin, xmax, xsign_bit, xinvert) }
|
||||||
#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
|
#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
|
||||||
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
|
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
|
||||||
|
@ -162,30 +176,28 @@
|
||||||
.private_value = (unsigned long)&(struct soc_mixer_control) \
|
.private_value = (unsigned long)&(struct soc_mixer_control) \
|
||||||
{.reg = xreg, .min = xmin, .max = xmax, \
|
{.reg = xreg, .min = xmin, .max = xmax, \
|
||||||
.platform_max = xmax} }
|
.platform_max = xmax} }
|
||||||
#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \
|
#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xitems, xtexts) \
|
||||||
{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
|
{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
|
||||||
.max = xmax, .texts = xtexts, \
|
.items = xitems, .texts = xtexts, \
|
||||||
.mask = xmax ? roundup_pow_of_two(xmax) - 1 : 0}
|
.mask = xitems ? roundup_pow_of_two(xitems) - 1 : 0}
|
||||||
#define SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) \
|
#define SOC_ENUM_SINGLE(xreg, xshift, xitems, xtexts) \
|
||||||
SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts)
|
SOC_ENUM_DOUBLE(xreg, xshift, xshift, xitems, xtexts)
|
||||||
#define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \
|
#define SOC_ENUM_SINGLE_EXT(xitems, xtexts) \
|
||||||
{ .max = xmax, .texts = xtexts }
|
{ .items = xitems, .texts = xtexts }
|
||||||
#define SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xmax, xtexts, xvalues) \
|
#define SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xitems, xtexts, xvalues) \
|
||||||
{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
|
{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
|
||||||
.mask = xmask, .max = xmax, .texts = xtexts, .values = xvalues}
|
.mask = xmask, .items = xitems, .texts = xtexts, .values = xvalues}
|
||||||
#define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xmax, xtexts, xvalues) \
|
#define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xnitmes, xtexts, xvalues) \
|
||||||
SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xmax, xtexts, xvalues)
|
SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xnitmes, xtexts, xvalues)
|
||||||
|
#define SOC_ENUM_SINGLE_VIRT(xitems, xtexts) \
|
||||||
|
SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, xitems, xtexts)
|
||||||
#define SOC_ENUM(xname, xenum) \
|
#define SOC_ENUM(xname, xenum) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
|
||||||
.info = snd_soc_info_enum_double, \
|
.info = snd_soc_info_enum_double, \
|
||||||
.get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \
|
.get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \
|
||||||
.private_value = (unsigned long)&xenum }
|
.private_value = (unsigned long)&xenum }
|
||||||
#define SOC_VALUE_ENUM(xname, xenum) \
|
#define SOC_VALUE_ENUM(xname, xenum) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
|
SOC_ENUM(xname, xenum)
|
||||||
.info = snd_soc_info_enum_double, \
|
|
||||||
.get = snd_soc_get_value_enum_double, \
|
|
||||||
.put = snd_soc_put_value_enum_double, \
|
|
||||||
.private_value = (unsigned long)&xenum }
|
|
||||||
#define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\
|
#define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\
|
||||||
xhandler_get, xhandler_put) \
|
xhandler_get, xhandler_put) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
||||||
|
@ -272,17 +284,19 @@
|
||||||
* ARRAY_SIZE internally
|
* ARRAY_SIZE internally
|
||||||
*/
|
*/
|
||||||
#define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \
|
#define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \
|
||||||
struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \
|
const struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \
|
||||||
ARRAY_SIZE(xtexts), xtexts)
|
ARRAY_SIZE(xtexts), xtexts)
|
||||||
#define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \
|
#define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \
|
||||||
SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts)
|
SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts)
|
||||||
#define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \
|
#define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \
|
||||||
struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts)
|
const struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts)
|
||||||
#define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \
|
#define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \
|
||||||
struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \
|
const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \
|
||||||
ARRAY_SIZE(xtexts), xtexts, xvalues)
|
ARRAY_SIZE(xtexts), xtexts, xvalues)
|
||||||
#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
|
#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
|
||||||
SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
|
SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
|
||||||
|
#define SOC_ENUM_SINGLE_VIRT_DECL(name, xtexts) \
|
||||||
|
const struct soc_enum name = SOC_ENUM_SINGLE_VIRT(ARRAY_SIZE(xtexts), xtexts)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Component probe and remove ordering levels for components with runtime
|
* Component probe and remove ordering levels for components with runtime
|
||||||
|
@ -500,10 +514,6 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
struct snd_ctl_elem_value *ucontrol);
|
||||||
int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
|
int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
struct snd_ctl_elem_value *ucontrol);
|
||||||
int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
|
||||||
int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
|
||||||
int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
|
int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_info *uinfo);
|
struct snd_ctl_elem_info *uinfo);
|
||||||
#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info
|
#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info
|
||||||
|
@ -1076,6 +1086,7 @@ struct soc_mixer_control {
|
||||||
int min, max, platform_max;
|
int min, max, platform_max;
|
||||||
int reg, rreg;
|
int reg, rreg;
|
||||||
unsigned int shift, rshift;
|
unsigned int shift, rshift;
|
||||||
|
unsigned int sign_bit;
|
||||||
unsigned int invert:1;
|
unsigned int invert:1;
|
||||||
unsigned int autodisable:1;
|
unsigned int autodisable:1;
|
||||||
};
|
};
|
||||||
|
@ -1094,11 +1105,10 @@ struct soc_mreg_control {
|
||||||
|
|
||||||
/* enumerated kcontrol */
|
/* enumerated kcontrol */
|
||||||
struct soc_enum {
|
struct soc_enum {
|
||||||
unsigned short reg;
|
int reg;
|
||||||
unsigned short reg2;
|
|
||||||
unsigned char shift_l;
|
unsigned char shift_l;
|
||||||
unsigned char shift_r;
|
unsigned char shift_r;
|
||||||
unsigned int max;
|
unsigned int items;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
const char * const *texts;
|
const char * const *texts;
|
||||||
const unsigned int *values;
|
const unsigned int *values;
|
||||||
|
@ -1177,6 +1187,30 @@ static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline unsigned int snd_soc_enum_val_to_item(struct soc_enum *e,
|
||||||
|
unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
if (!e->values)
|
||||||
|
return val;
|
||||||
|
|
||||||
|
for (i = 0; i < e->items; i++)
|
||||||
|
if (val == e->values[i])
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline unsigned int snd_soc_enum_item_to_val(struct soc_enum *e,
|
||||||
|
unsigned int item)
|
||||||
|
{
|
||||||
|
if (!e->values)
|
||||||
|
return item;
|
||||||
|
|
||||||
|
return e->values[item];
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool snd_soc_component_is_active(
|
static inline bool snd_soc_component_is_active(
|
||||||
struct snd_soc_component *component)
|
struct snd_soc_component *component)
|
||||||
{
|
{
|
||||||
|
|
|
@ -345,15 +345,15 @@ static const char *adau1373_fdsp_sel_text[] = {
|
||||||
"Channel 5",
|
"Channel 5",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_drc1_channel_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_drc1_channel_enum,
|
||||||
ADAU1373_FDSP_SEL1, 4, adau1373_fdsp_sel_text);
|
ADAU1373_FDSP_SEL1, 4, adau1373_fdsp_sel_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_drc2_channel_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_drc2_channel_enum,
|
||||||
ADAU1373_FDSP_SEL1, 0, adau1373_fdsp_sel_text);
|
ADAU1373_FDSP_SEL1, 0, adau1373_fdsp_sel_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_drc3_channel_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_drc3_channel_enum,
|
||||||
ADAU1373_FDSP_SEL2, 0, adau1373_fdsp_sel_text);
|
ADAU1373_FDSP_SEL2, 0, adau1373_fdsp_sel_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_hpf_channel_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_hpf_channel_enum,
|
||||||
ADAU1373_FDSP_SEL3, 0, adau1373_fdsp_sel_text);
|
ADAU1373_FDSP_SEL3, 0, adau1373_fdsp_sel_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_bass_channel_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_bass_channel_enum,
|
||||||
ADAU1373_FDSP_SEL4, 4, adau1373_fdsp_sel_text);
|
ADAU1373_FDSP_SEL4, 4, adau1373_fdsp_sel_text);
|
||||||
|
|
||||||
static const char *adau1373_hpf_cutoff_text[] = {
|
static const char *adau1373_hpf_cutoff_text[] = {
|
||||||
|
@ -362,7 +362,7 @@ static const char *adau1373_hpf_cutoff_text[] = {
|
||||||
"800Hz",
|
"800Hz",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_hpf_cutoff_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_hpf_cutoff_enum,
|
||||||
ADAU1373_HPF_CTRL, 3, adau1373_hpf_cutoff_text);
|
ADAU1373_HPF_CTRL, 3, adau1373_hpf_cutoff_text);
|
||||||
|
|
||||||
static const char *adau1373_bass_lpf_cutoff_text[] = {
|
static const char *adau1373_bass_lpf_cutoff_text[] = {
|
||||||
|
@ -388,14 +388,14 @@ static const unsigned int adau1373_bass_tlv[] = {
|
||||||
5, 7, TLV_DB_SCALE_ITEM(1400, 150, 0),
|
5, 7, TLV_DB_SCALE_ITEM(1400, 150, 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_bass_lpf_cutoff_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_bass_lpf_cutoff_enum,
|
||||||
ADAU1373_BASS1, 5, adau1373_bass_lpf_cutoff_text);
|
ADAU1373_BASS1, 5, adau1373_bass_lpf_cutoff_text);
|
||||||
|
|
||||||
static const SOC_VALUE_ENUM_SINGLE_DECL(adau1373_bass_clip_level_enum,
|
static SOC_VALUE_ENUM_SINGLE_DECL(adau1373_bass_clip_level_enum,
|
||||||
ADAU1373_BASS1, 2, 7, adau1373_bass_clip_level_text,
|
ADAU1373_BASS1, 2, 7, adau1373_bass_clip_level_text,
|
||||||
adau1373_bass_clip_level_values);
|
adau1373_bass_clip_level_values);
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_bass_hpf_cutoff_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_bass_hpf_cutoff_enum,
|
||||||
ADAU1373_BASS1, 0, adau1373_bass_hpf_cutoff_text);
|
ADAU1373_BASS1, 0, adau1373_bass_hpf_cutoff_text);
|
||||||
|
|
||||||
static const char *adau1373_3d_level_text[] = {
|
static const char *adau1373_3d_level_text[] = {
|
||||||
|
@ -409,9 +409,9 @@ static const char *adau1373_3d_cutoff_text[] = {
|
||||||
"0.16875 fs", "0.27083 fs"
|
"0.16875 fs", "0.27083 fs"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_3d_level_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_3d_level_enum,
|
||||||
ADAU1373_3D_CTRL1, 4, adau1373_3d_level_text);
|
ADAU1373_3D_CTRL1, 4, adau1373_3d_level_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_3d_cutoff_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_3d_cutoff_enum,
|
||||||
ADAU1373_3D_CTRL1, 0, adau1373_3d_cutoff_text);
|
ADAU1373_3D_CTRL1, 0, adau1373_3d_cutoff_text);
|
||||||
|
|
||||||
static const unsigned int adau1373_3d_tlv[] = {
|
static const unsigned int adau1373_3d_tlv[] = {
|
||||||
|
@ -427,11 +427,11 @@ static const char *adau1373_lr_mux_text[] = {
|
||||||
"Stereo",
|
"Stereo",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_lineout1_lr_mux_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_lineout1_lr_mux_enum,
|
||||||
ADAU1373_OUTPUT_CTRL, 4, adau1373_lr_mux_text);
|
ADAU1373_OUTPUT_CTRL, 4, adau1373_lr_mux_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_lineout2_lr_mux_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_lineout2_lr_mux_enum,
|
||||||
ADAU1373_OUTPUT_CTRL, 6, adau1373_lr_mux_text);
|
ADAU1373_OUTPUT_CTRL, 6, adau1373_lr_mux_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(adau1373_speaker_lr_mux_enum,
|
static SOC_ENUM_SINGLE_DECL(adau1373_speaker_lr_mux_enum,
|
||||||
ADAU1373_LS_CTRL, 4, adau1373_lr_mux_text);
|
ADAU1373_LS_CTRL, 4, adau1373_lr_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new adau1373_controls[] = {
|
static const struct snd_kcontrol_new adau1373_controls[] = {
|
||||||
|
@ -576,8 +576,8 @@ static const char *adau1373_decimator_text[] = {
|
||||||
"DMIC1",
|
"DMIC1",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct soc_enum adau1373_decimator_enum =
|
static SOC_ENUM_SINGLE_VIRT_DECL(adau1373_decimator_enum,
|
||||||
SOC_ENUM_SINGLE(0, 0, 2, adau1373_decimator_text);
|
adau1373_decimator_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new adau1373_decimator_mux =
|
static const struct snd_kcontrol_new adau1373_decimator_mux =
|
||||||
SOC_DAPM_ENUM_VIRT("Decimator Mux", adau1373_decimator_enum);
|
SOC_DAPM_ENUM_VIRT("Decimator Mux", adau1373_decimator_enum);
|
||||||
|
|
|
@ -542,47 +542,55 @@ static const char *arizona_vol_ramp_text[] = {
|
||||||
"15ms/6dB", "30ms/6dB",
|
"15ms/6dB", "30ms/6dB",
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct soc_enum arizona_in_vd_ramp =
|
SOC_ENUM_SINGLE_DECL(arizona_in_vd_ramp,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_INPUT_VOLUME_RAMP,
|
ARIZONA_INPUT_VOLUME_RAMP,
|
||||||
ARIZONA_IN_VD_RAMP_SHIFT, 7, arizona_vol_ramp_text);
|
ARIZONA_IN_VD_RAMP_SHIFT,
|
||||||
|
arizona_vol_ramp_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_in_vd_ramp);
|
EXPORT_SYMBOL_GPL(arizona_in_vd_ramp);
|
||||||
|
|
||||||
const struct soc_enum arizona_in_vi_ramp =
|
SOC_ENUM_SINGLE_DECL(arizona_in_vi_ramp,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_INPUT_VOLUME_RAMP,
|
ARIZONA_INPUT_VOLUME_RAMP,
|
||||||
ARIZONA_IN_VI_RAMP_SHIFT, 7, arizona_vol_ramp_text);
|
ARIZONA_IN_VI_RAMP_SHIFT,
|
||||||
|
arizona_vol_ramp_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_in_vi_ramp);
|
EXPORT_SYMBOL_GPL(arizona_in_vi_ramp);
|
||||||
|
|
||||||
const struct soc_enum arizona_out_vd_ramp =
|
SOC_ENUM_SINGLE_DECL(arizona_out_vd_ramp,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_VOLUME_RAMP,
|
ARIZONA_OUTPUT_VOLUME_RAMP,
|
||||||
ARIZONA_OUT_VD_RAMP_SHIFT, 7, arizona_vol_ramp_text);
|
ARIZONA_OUT_VD_RAMP_SHIFT,
|
||||||
|
arizona_vol_ramp_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_out_vd_ramp);
|
EXPORT_SYMBOL_GPL(arizona_out_vd_ramp);
|
||||||
|
|
||||||
const struct soc_enum arizona_out_vi_ramp =
|
SOC_ENUM_SINGLE_DECL(arizona_out_vi_ramp,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_VOLUME_RAMP,
|
ARIZONA_OUTPUT_VOLUME_RAMP,
|
||||||
ARIZONA_OUT_VI_RAMP_SHIFT, 7, arizona_vol_ramp_text);
|
ARIZONA_OUT_VI_RAMP_SHIFT,
|
||||||
|
arizona_vol_ramp_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_out_vi_ramp);
|
EXPORT_SYMBOL_GPL(arizona_out_vi_ramp);
|
||||||
|
|
||||||
static const char *arizona_lhpf_mode_text[] = {
|
static const char *arizona_lhpf_mode_text[] = {
|
||||||
"Low-pass", "High-pass"
|
"Low-pass", "High-pass"
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct soc_enum arizona_lhpf1_mode =
|
SOC_ENUM_SINGLE_DECL(arizona_lhpf1_mode,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_HPLPF1_1, ARIZONA_LHPF1_MODE_SHIFT, 2,
|
ARIZONA_HPLPF1_1,
|
||||||
|
ARIZONA_LHPF1_MODE_SHIFT,
|
||||||
arizona_lhpf_mode_text);
|
arizona_lhpf_mode_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_lhpf1_mode);
|
EXPORT_SYMBOL_GPL(arizona_lhpf1_mode);
|
||||||
|
|
||||||
const struct soc_enum arizona_lhpf2_mode =
|
SOC_ENUM_SINGLE_DECL(arizona_lhpf2_mode,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_HPLPF2_1, ARIZONA_LHPF2_MODE_SHIFT, 2,
|
ARIZONA_HPLPF2_1,
|
||||||
|
ARIZONA_LHPF2_MODE_SHIFT,
|
||||||
arizona_lhpf_mode_text);
|
arizona_lhpf_mode_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_lhpf2_mode);
|
EXPORT_SYMBOL_GPL(arizona_lhpf2_mode);
|
||||||
|
|
||||||
const struct soc_enum arizona_lhpf3_mode =
|
SOC_ENUM_SINGLE_DECL(arizona_lhpf3_mode,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_HPLPF3_1, ARIZONA_LHPF3_MODE_SHIFT, 2,
|
ARIZONA_HPLPF3_1,
|
||||||
|
ARIZONA_LHPF3_MODE_SHIFT,
|
||||||
arizona_lhpf_mode_text);
|
arizona_lhpf_mode_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_lhpf3_mode);
|
EXPORT_SYMBOL_GPL(arizona_lhpf3_mode);
|
||||||
|
|
||||||
const struct soc_enum arizona_lhpf4_mode =
|
SOC_ENUM_SINGLE_DECL(arizona_lhpf4_mode,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_HPLPF4_1, ARIZONA_LHPF4_MODE_SHIFT, 2,
|
ARIZONA_HPLPF4_1,
|
||||||
|
ARIZONA_LHPF4_MODE_SHIFT,
|
||||||
arizona_lhpf_mode_text);
|
arizona_lhpf_mode_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_lhpf4_mode);
|
EXPORT_SYMBOL_GPL(arizona_lhpf4_mode);
|
||||||
|
|
||||||
|
@ -590,18 +598,19 @@ static const char *arizona_ng_hold_text[] = {
|
||||||
"30ms", "120ms", "250ms", "500ms",
|
"30ms", "120ms", "250ms", "500ms",
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct soc_enum arizona_ng_hold =
|
SOC_ENUM_SINGLE_DECL(arizona_ng_hold,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_NOISE_GATE_CONTROL, ARIZONA_NGATE_HOLD_SHIFT,
|
ARIZONA_NOISE_GATE_CONTROL,
|
||||||
4, arizona_ng_hold_text);
|
ARIZONA_NGATE_HOLD_SHIFT,
|
||||||
|
arizona_ng_hold_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_ng_hold);
|
EXPORT_SYMBOL_GPL(arizona_ng_hold);
|
||||||
|
|
||||||
static const char * const arizona_in_hpf_cut_text[] = {
|
static const char * const arizona_in_hpf_cut_text[] = {
|
||||||
"2.5Hz", "5Hz", "10Hz", "20Hz", "40Hz"
|
"2.5Hz", "5Hz", "10Hz", "20Hz", "40Hz"
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct soc_enum arizona_in_hpf_cut_enum =
|
SOC_ENUM_SINGLE_DECL(arizona_in_hpf_cut_enum,
|
||||||
SOC_ENUM_SINGLE(ARIZONA_HPF_CONTROL, ARIZONA_IN_HPF_CUT_SHIFT,
|
ARIZONA_HPF_CONTROL,
|
||||||
ARRAY_SIZE(arizona_in_hpf_cut_text),
|
ARIZONA_IN_HPF_CUT_SHIFT,
|
||||||
arizona_in_hpf_cut_text);
|
arizona_in_hpf_cut_text);
|
||||||
EXPORT_SYMBOL_GPL(arizona_in_hpf_cut_enum);
|
EXPORT_SYMBOL_GPL(arizona_in_hpf_cut_enum);
|
||||||
|
|
||||||
|
|
|
@ -113,9 +113,6 @@
|
||||||
#define DA732X_EQ_OVERALL_VOL_DB_MIN -1800
|
#define DA732X_EQ_OVERALL_VOL_DB_MIN -1800
|
||||||
#define DA732X_EQ_OVERALL_VOL_DB_INC 600
|
#define DA732X_EQ_OVERALL_VOL_DB_INC 600
|
||||||
|
|
||||||
#define DA732X_SOC_ENUM_DOUBLE_R(xreg, xrreg, xmax, xtext) \
|
|
||||||
{.reg = xreg, .reg2 = xrreg, .max = xmax, .texts = xtext}
|
|
||||||
|
|
||||||
enum da732x_sysctl {
|
enum da732x_sysctl {
|
||||||
DA732X_SR_8KHZ = 0x1,
|
DA732X_SR_8KHZ = 0x1,
|
||||||
DA732X_SR_11_025KHZ = 0x2,
|
DA732X_SR_11_025KHZ = 0x2,
|
||||||
|
|
|
@ -195,18 +195,18 @@ struct lm49453_priv {
|
||||||
|
|
||||||
static const char *lm49453_mic2mode_text[] = {"Single Ended", "Differential"};
|
static const char *lm49453_mic2mode_text[] = {"Single Ended", "Differential"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(lm49453_mic2mode_enum, LM49453_P0_MICR_REG, 5,
|
static SOC_ENUM_SINGLE_DECL(lm49453_mic2mode_enum, LM49453_P0_MICR_REG, 5,
|
||||||
lm49453_mic2mode_text);
|
lm49453_mic2mode_text);
|
||||||
|
|
||||||
static const char *lm49453_dmic_cfg_text[] = {"DMICDAT1", "DMICDAT2"};
|
static const char *lm49453_dmic_cfg_text[] = {"DMICDAT1", "DMICDAT2"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(lm49453_dmic12_cfg_enum,
|
static SOC_ENUM_SINGLE_DECL(lm49453_dmic12_cfg_enum,
|
||||||
LM49453_P0_DIGITAL_MIC1_CONFIG_REG,
|
LM49453_P0_DIGITAL_MIC1_CONFIG_REG, 7,
|
||||||
7, lm49453_dmic_cfg_text);
|
lm49453_dmic_cfg_text);
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(lm49453_dmic34_cfg_enum,
|
static SOC_ENUM_SINGLE_DECL(lm49453_dmic34_cfg_enum,
|
||||||
LM49453_P0_DIGITAL_MIC2_CONFIG_REG,
|
LM49453_P0_DIGITAL_MIC2_CONFIG_REG, 7,
|
||||||
7, lm49453_dmic_cfg_text);
|
lm49453_dmic_cfg_text);
|
||||||
|
|
||||||
/* MUX Controls */
|
/* MUX Controls */
|
||||||
static const char *lm49453_adcl_mux_text[] = { "MIC1", "Aux_L" };
|
static const char *lm49453_adcl_mux_text[] = { "MIC1", "Aux_L" };
|
||||||
|
|
|
@ -1849,7 +1849,7 @@ static void max98088_handle_eq_pdata(struct snd_soc_codec *codec)
|
||||||
|
|
||||||
/* Now point the soc_enum to .texts array items */
|
/* Now point the soc_enum to .texts array items */
|
||||||
max98088->eq_enum.texts = max98088->eq_texts;
|
max98088->eq_enum.texts = max98088->eq_texts;
|
||||||
max98088->eq_enum.max = max98088->eq_textcnt;
|
max98088->eq_enum.items = max98088->eq_textcnt;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
|
|
@ -513,65 +513,75 @@ static const char *max98090_perf_pwr_text[] =
|
||||||
static const char *max98090_pwr_perf_text[] =
|
static const char *max98090_pwr_perf_text[] =
|
||||||
{ "Low Power", "High Performance" };
|
{ "Low Power", "High Performance" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_vcmbandgap_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_vcmbandgap_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_BIAS_CONTROL, M98090_VCM_MODE_SHIFT,
|
M98090_REG_BIAS_CONTROL,
|
||||||
ARRAY_SIZE(max98090_pwr_perf_text), max98090_pwr_perf_text);
|
M98090_VCM_MODE_SHIFT,
|
||||||
|
max98090_pwr_perf_text);
|
||||||
|
|
||||||
static const char *max98090_osr128_text[] = { "64*fs", "128*fs" };
|
static const char *max98090_osr128_text[] = { "64*fs", "128*fs" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_osr128_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_osr128_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_ADC_CONTROL, M98090_OSR128_SHIFT,
|
M98090_REG_ADC_CONTROL,
|
||||||
ARRAY_SIZE(max98090_osr128_text), max98090_osr128_text);
|
M98090_OSR128_SHIFT,
|
||||||
|
max98090_osr128_text);
|
||||||
|
|
||||||
static const char *max98090_mode_text[] = { "Voice", "Music" };
|
static const char *max98090_mode_text[] = { "Voice", "Music" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_mode_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_mode_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_FILTER_CONFIG, M98090_MODE_SHIFT,
|
M98090_REG_FILTER_CONFIG,
|
||||||
ARRAY_SIZE(max98090_mode_text), max98090_mode_text);
|
M98090_MODE_SHIFT,
|
||||||
|
max98090_mode_text);
|
||||||
|
|
||||||
static const struct soc_enum max98090_filter_dmic34mode_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_filter_dmic34mode_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_FILTER_CONFIG,
|
M98090_REG_FILTER_CONFIG,
|
||||||
M98090_FLT_DMIC34MODE_SHIFT,
|
M98090_FLT_DMIC34MODE_SHIFT,
|
||||||
ARRAY_SIZE(max98090_mode_text), max98090_mode_text);
|
max98090_mode_text);
|
||||||
|
|
||||||
static const char *max98090_drcatk_text[] =
|
static const char *max98090_drcatk_text[] =
|
||||||
{ "0.5ms", "1ms", "5ms", "10ms", "25ms", "50ms", "100ms", "200ms" };
|
{ "0.5ms", "1ms", "5ms", "10ms", "25ms", "50ms", "100ms", "200ms" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_drcatk_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_drcatk_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_DRC_TIMING, M98090_DRCATK_SHIFT,
|
M98090_REG_DRC_TIMING,
|
||||||
ARRAY_SIZE(max98090_drcatk_text), max98090_drcatk_text);
|
M98090_DRCATK_SHIFT,
|
||||||
|
max98090_drcatk_text);
|
||||||
|
|
||||||
static const char *max98090_drcrls_text[] =
|
static const char *max98090_drcrls_text[] =
|
||||||
{ "8s", "4s", "2s", "1s", "0.5s", "0.25s", "0.125s", "0.0625s" };
|
{ "8s", "4s", "2s", "1s", "0.5s", "0.25s", "0.125s", "0.0625s" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_drcrls_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_drcrls_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_DRC_TIMING, M98090_DRCRLS_SHIFT,
|
M98090_REG_DRC_TIMING,
|
||||||
ARRAY_SIZE(max98090_drcrls_text), max98090_drcrls_text);
|
M98090_DRCRLS_SHIFT,
|
||||||
|
max98090_drcrls_text);
|
||||||
|
|
||||||
static const char *max98090_alccmp_text[] =
|
static const char *max98090_alccmp_text[] =
|
||||||
{ "1:1", "1:1.5", "1:2", "1:4", "1:INF" };
|
{ "1:1", "1:1.5", "1:2", "1:4", "1:INF" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_alccmp_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_alccmp_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_DRC_COMPRESSOR, M98090_DRCCMP_SHIFT,
|
M98090_REG_DRC_COMPRESSOR,
|
||||||
ARRAY_SIZE(max98090_alccmp_text), max98090_alccmp_text);
|
M98090_DRCCMP_SHIFT,
|
||||||
|
max98090_alccmp_text);
|
||||||
|
|
||||||
static const char *max98090_drcexp_text[] = { "1:1", "2:1", "3:1" };
|
static const char *max98090_drcexp_text[] = { "1:1", "2:1", "3:1" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_drcexp_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_drcexp_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_DRC_EXPANDER, M98090_DRCEXP_SHIFT,
|
M98090_REG_DRC_EXPANDER,
|
||||||
ARRAY_SIZE(max98090_drcexp_text), max98090_drcexp_text);
|
M98090_DRCEXP_SHIFT,
|
||||||
|
max98090_drcexp_text);
|
||||||
|
|
||||||
static const struct soc_enum max98090_dac_perfmode_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_dac_perfmode_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_DAC_CONTROL, M98090_PERFMODE_SHIFT,
|
M98090_REG_DAC_CONTROL,
|
||||||
ARRAY_SIZE(max98090_perf_pwr_text), max98090_perf_pwr_text);
|
M98090_PERFMODE_SHIFT,
|
||||||
|
max98090_perf_pwr_text);
|
||||||
|
|
||||||
static const struct soc_enum max98090_dachp_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_dachp_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_DAC_CONTROL, M98090_DACHP_SHIFT,
|
M98090_REG_DAC_CONTROL,
|
||||||
ARRAY_SIZE(max98090_pwr_perf_text), max98090_pwr_perf_text);
|
M98090_DACHP_SHIFT,
|
||||||
|
max98090_pwr_perf_text);
|
||||||
|
|
||||||
static const struct soc_enum max98090_adchp_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_adchp_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_ADC_CONTROL, M98090_ADCHP_SHIFT,
|
M98090_REG_ADC_CONTROL,
|
||||||
ARRAY_SIZE(max98090_pwr_perf_text), max98090_pwr_perf_text);
|
M98090_ADCHP_SHIFT,
|
||||||
|
max98090_pwr_perf_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_snd_controls[] = {
|
static const struct snd_kcontrol_new max98090_snd_controls[] = {
|
||||||
SOC_ENUM("MIC Bias VCM Bandgap", max98090_vcmbandgap_enum),
|
SOC_ENUM("MIC Bias VCM Bandgap", max98090_vcmbandgap_enum),
|
||||||
|
@ -842,39 +852,42 @@ static int max98090_micinput_event(struct snd_soc_dapm_widget *w,
|
||||||
|
|
||||||
static const char *mic1_mux_text[] = { "IN12", "IN56" };
|
static const char *mic1_mux_text[] = { "IN12", "IN56" };
|
||||||
|
|
||||||
static const struct soc_enum mic1_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(mic1_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_INPUT_MODE, M98090_EXTMIC1_SHIFT,
|
M98090_REG_INPUT_MODE,
|
||||||
ARRAY_SIZE(mic1_mux_text), mic1_mux_text);
|
M98090_EXTMIC1_SHIFT,
|
||||||
|
mic1_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_mic1_mux =
|
static const struct snd_kcontrol_new max98090_mic1_mux =
|
||||||
SOC_DAPM_ENUM("MIC1 Mux", mic1_mux_enum);
|
SOC_DAPM_ENUM("MIC1 Mux", mic1_mux_enum);
|
||||||
|
|
||||||
static const char *mic2_mux_text[] = { "IN34", "IN56" };
|
static const char *mic2_mux_text[] = { "IN34", "IN56" };
|
||||||
|
|
||||||
static const struct soc_enum mic2_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(mic2_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_INPUT_MODE, M98090_EXTMIC2_SHIFT,
|
M98090_REG_INPUT_MODE,
|
||||||
ARRAY_SIZE(mic2_mux_text), mic2_mux_text);
|
M98090_EXTMIC2_SHIFT,
|
||||||
|
mic2_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_mic2_mux =
|
static const struct snd_kcontrol_new max98090_mic2_mux =
|
||||||
SOC_DAPM_ENUM("MIC2 Mux", mic2_mux_enum);
|
SOC_DAPM_ENUM("MIC2 Mux", mic2_mux_enum);
|
||||||
|
|
||||||
static const char *dmic_mux_text[] = { "ADC", "DMIC" };
|
static const char *dmic_mux_text[] = { "ADC", "DMIC" };
|
||||||
|
|
||||||
static const struct soc_enum dmic_mux_enum =
|
static SOC_ENUM_SINGLE_VIRT_DECL(dmic_mux_enum, dmic_mux_text);
|
||||||
SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(dmic_mux_text), dmic_mux_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_dmic_mux =
|
static const struct snd_kcontrol_new max98090_dmic_mux =
|
||||||
SOC_DAPM_ENUM_VIRT("DMIC Mux", dmic_mux_enum);
|
SOC_DAPM_ENUM_VIRT("DMIC Mux", dmic_mux_enum);
|
||||||
|
|
||||||
static const char *max98090_micpre_text[] = { "Off", "On" };
|
static const char *max98090_micpre_text[] = { "Off", "On" };
|
||||||
|
|
||||||
static const struct soc_enum max98090_pa1en_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_pa1en_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_MIC1_INPUT_LEVEL, M98090_MIC_PA1EN_SHIFT,
|
M98090_REG_MIC1_INPUT_LEVEL,
|
||||||
ARRAY_SIZE(max98090_micpre_text), max98090_micpre_text);
|
M98090_MIC_PA1EN_SHIFT,
|
||||||
|
max98090_micpre_text);
|
||||||
|
|
||||||
static const struct soc_enum max98090_pa2en_enum =
|
static SOC_ENUM_SINGLE_DECL(max98090_pa2en_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_MIC2_INPUT_LEVEL, M98090_MIC_PA2EN_SHIFT,
|
M98090_REG_MIC2_INPUT_LEVEL,
|
||||||
ARRAY_SIZE(max98090_micpre_text), max98090_micpre_text);
|
M98090_MIC_PA2EN_SHIFT,
|
||||||
|
max98090_micpre_text);
|
||||||
|
|
||||||
/* LINEA mixer switch */
|
/* LINEA mixer switch */
|
||||||
static const struct snd_kcontrol_new max98090_linea_mixer_controls[] = {
|
static const struct snd_kcontrol_new max98090_linea_mixer_controls[] = {
|
||||||
|
@ -938,13 +951,15 @@ static const struct snd_kcontrol_new max98090_right_adc_mixer_controls[] = {
|
||||||
|
|
||||||
static const char *lten_mux_text[] = { "Normal", "Loopthrough" };
|
static const char *lten_mux_text[] = { "Normal", "Loopthrough" };
|
||||||
|
|
||||||
static const struct soc_enum ltenl_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(ltenl_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_IO_CONFIGURATION, M98090_LTEN_SHIFT,
|
M98090_REG_IO_CONFIGURATION,
|
||||||
ARRAY_SIZE(lten_mux_text), lten_mux_text);
|
M98090_LTEN_SHIFT,
|
||||||
|
lten_mux_text);
|
||||||
|
|
||||||
static const struct soc_enum ltenr_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(ltenr_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_IO_CONFIGURATION, M98090_LTEN_SHIFT,
|
M98090_REG_IO_CONFIGURATION,
|
||||||
ARRAY_SIZE(lten_mux_text), lten_mux_text);
|
M98090_LTEN_SHIFT,
|
||||||
|
lten_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_ltenl_mux =
|
static const struct snd_kcontrol_new max98090_ltenl_mux =
|
||||||
SOC_DAPM_ENUM("LTENL Mux", ltenl_mux_enum);
|
SOC_DAPM_ENUM("LTENL Mux", ltenl_mux_enum);
|
||||||
|
@ -954,13 +969,15 @@ static const struct snd_kcontrol_new max98090_ltenr_mux =
|
||||||
|
|
||||||
static const char *lben_mux_text[] = { "Normal", "Loopback" };
|
static const char *lben_mux_text[] = { "Normal", "Loopback" };
|
||||||
|
|
||||||
static const struct soc_enum lbenl_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(lbenl_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_IO_CONFIGURATION, M98090_LBEN_SHIFT,
|
M98090_REG_IO_CONFIGURATION,
|
||||||
ARRAY_SIZE(lben_mux_text), lben_mux_text);
|
M98090_LBEN_SHIFT,
|
||||||
|
lben_mux_text);
|
||||||
|
|
||||||
static const struct soc_enum lbenr_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(lbenr_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_IO_CONFIGURATION, M98090_LBEN_SHIFT,
|
M98090_REG_IO_CONFIGURATION,
|
||||||
ARRAY_SIZE(lben_mux_text), lben_mux_text);
|
M98090_LBEN_SHIFT,
|
||||||
|
lben_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_lbenl_mux =
|
static const struct snd_kcontrol_new max98090_lbenl_mux =
|
||||||
SOC_DAPM_ENUM("LBENL Mux", lbenl_mux_enum);
|
SOC_DAPM_ENUM("LBENL Mux", lbenl_mux_enum);
|
||||||
|
@ -972,13 +989,15 @@ static const char *stenl_mux_text[] = { "Normal", "Sidetone Left" };
|
||||||
|
|
||||||
static const char *stenr_mux_text[] = { "Normal", "Sidetone Right" };
|
static const char *stenr_mux_text[] = { "Normal", "Sidetone Right" };
|
||||||
|
|
||||||
static const struct soc_enum stenl_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(stenl_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_ADC_SIDETONE, M98090_DSTSL_SHIFT,
|
M98090_REG_ADC_SIDETONE,
|
||||||
ARRAY_SIZE(stenl_mux_text), stenl_mux_text);
|
M98090_DSTSL_SHIFT,
|
||||||
|
stenl_mux_text);
|
||||||
|
|
||||||
static const struct soc_enum stenr_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(stenr_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_ADC_SIDETONE, M98090_DSTSR_SHIFT,
|
M98090_REG_ADC_SIDETONE,
|
||||||
ARRAY_SIZE(stenr_mux_text), stenr_mux_text);
|
M98090_DSTSR_SHIFT,
|
||||||
|
stenr_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_stenl_mux =
|
static const struct snd_kcontrol_new max98090_stenl_mux =
|
||||||
SOC_DAPM_ENUM("STENL Mux", stenl_mux_enum);
|
SOC_DAPM_ENUM("STENL Mux", stenl_mux_enum);
|
||||||
|
@ -1086,9 +1105,10 @@ static const struct snd_kcontrol_new max98090_right_rcv_mixer_controls[] = {
|
||||||
|
|
||||||
static const char *linmod_mux_text[] = { "Left Only", "Left and Right" };
|
static const char *linmod_mux_text[] = { "Left Only", "Left and Right" };
|
||||||
|
|
||||||
static const struct soc_enum linmod_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(linmod_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_LOUTR_MIXER, M98090_LINMOD_SHIFT,
|
M98090_REG_LOUTR_MIXER,
|
||||||
ARRAY_SIZE(linmod_mux_text), linmod_mux_text);
|
M98090_LINMOD_SHIFT,
|
||||||
|
linmod_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_linmod_mux =
|
static const struct snd_kcontrol_new max98090_linmod_mux =
|
||||||
SOC_DAPM_ENUM("LINMOD Mux", linmod_mux_enum);
|
SOC_DAPM_ENUM("LINMOD Mux", linmod_mux_enum);
|
||||||
|
@ -1098,16 +1118,18 @@ static const char *mixhpsel_mux_text[] = { "DAC Only", "HP Mixer" };
|
||||||
/*
|
/*
|
||||||
* This is a mux as it selects the HP output, but to DAPM it is a Mixer enable
|
* This is a mux as it selects the HP output, but to DAPM it is a Mixer enable
|
||||||
*/
|
*/
|
||||||
static const struct soc_enum mixhplsel_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(mixhplsel_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_HP_CONTROL, M98090_MIXHPLSEL_SHIFT,
|
M98090_REG_HP_CONTROL,
|
||||||
ARRAY_SIZE(mixhpsel_mux_text), mixhpsel_mux_text);
|
M98090_MIXHPLSEL_SHIFT,
|
||||||
|
mixhpsel_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_mixhplsel_mux =
|
static const struct snd_kcontrol_new max98090_mixhplsel_mux =
|
||||||
SOC_DAPM_ENUM("MIXHPLSEL Mux", mixhplsel_mux_enum);
|
SOC_DAPM_ENUM("MIXHPLSEL Mux", mixhplsel_mux_enum);
|
||||||
|
|
||||||
static const struct soc_enum mixhprsel_mux_enum =
|
static SOC_ENUM_SINGLE_DECL(mixhprsel_mux_enum,
|
||||||
SOC_ENUM_SINGLE(M98090_REG_HP_CONTROL, M98090_MIXHPRSEL_SHIFT,
|
M98090_REG_HP_CONTROL,
|
||||||
ARRAY_SIZE(mixhpsel_mux_text), mixhpsel_mux_text);
|
M98090_MIXHPRSEL_SHIFT,
|
||||||
|
mixhpsel_mux_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new max98090_mixhprsel_mux =
|
static const struct snd_kcontrol_new max98090_mixhprsel_mux =
|
||||||
SOC_DAPM_ENUM("MIXHPRSEL Mux", mixhprsel_mux_enum);
|
SOC_DAPM_ENUM("MIXHPRSEL Mux", mixhprsel_mux_enum);
|
||||||
|
|
|
@ -1861,7 +1861,7 @@ static void max98095_handle_eq_pdata(struct snd_soc_codec *codec)
|
||||||
|
|
||||||
/* Now point the soc_enum to .texts array items */
|
/* Now point the soc_enum to .texts array items */
|
||||||
max98095->eq_enum.texts = max98095->eq_texts;
|
max98095->eq_enum.texts = max98095->eq_texts;
|
||||||
max98095->eq_enum.max = max98095->eq_textcnt;
|
max98095->eq_enum.items = max98095->eq_textcnt;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
@ -2016,7 +2016,7 @@ static void max98095_handle_bq_pdata(struct snd_soc_codec *codec)
|
||||||
|
|
||||||
/* Now point the soc_enum to .texts array items */
|
/* Now point the soc_enum to .texts array items */
|
||||||
max98095->bq_enum.texts = max98095->bq_texts;
|
max98095->bq_enum.texts = max98095->bq_texts;
|
||||||
max98095->bq_enum.max = max98095->bq_textcnt;
|
max98095->bq_enum.items = max98095->bq_textcnt;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
|
|
@ -408,8 +408,7 @@ static const char * const adcl_enum_text[] = {
|
||||||
"MC1L", "RXINL",
|
"MC1L", "RXINL",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct soc_enum adcl_enum =
|
static SOC_ENUM_SINGLE_VIRT_DECL(adcl_enum, adcl_enum_text);
|
||||||
SOC_ENUM_SINGLE(0, 0, ARRAY_SIZE(adcl_enum_text), adcl_enum_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new left_input_mux =
|
static const struct snd_kcontrol_new left_input_mux =
|
||||||
SOC_DAPM_ENUM_VIRT("Route", adcl_enum);
|
SOC_DAPM_ENUM_VIRT("Route", adcl_enum);
|
||||||
|
@ -418,8 +417,7 @@ static const char * const adcr_enum_text[] = {
|
||||||
"MC1R", "MC2", "RXINR", "TXIN",
|
"MC1R", "MC2", "RXINR", "TXIN",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct soc_enum adcr_enum =
|
static SOC_ENUM_SINGLE_VIRT_DECL(adcr_enum, adcr_enum_text);
|
||||||
SOC_ENUM_SINGLE(0, 0, ARRAY_SIZE(adcr_enum_text), adcr_enum_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new right_input_mux =
|
static const struct snd_kcontrol_new right_input_mux =
|
||||||
SOC_DAPM_ENUM_VIRT("Route", adcr_enum);
|
SOC_DAPM_ENUM_VIRT("Route", adcr_enum);
|
||||||
|
@ -430,7 +428,7 @@ static const struct snd_kcontrol_new samp_ctl =
|
||||||
static const char * const speaker_amp_source_text[] = {
|
static const char * const speaker_amp_source_text[] = {
|
||||||
"CODEC", "Right"
|
"CODEC", "Right"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(speaker_amp_source, MC13783_AUDIO_RX0, 4,
|
static SOC_ENUM_SINGLE_DECL(speaker_amp_source, MC13783_AUDIO_RX0, 4,
|
||||||
speaker_amp_source_text);
|
speaker_amp_source_text);
|
||||||
static const struct snd_kcontrol_new speaker_amp_source_mux =
|
static const struct snd_kcontrol_new speaker_amp_source_mux =
|
||||||
SOC_DAPM_ENUM("Speaker Amp Source MUX", speaker_amp_source);
|
SOC_DAPM_ENUM("Speaker Amp Source MUX", speaker_amp_source);
|
||||||
|
@ -439,7 +437,7 @@ static const char * const headset_amp_source_text[] = {
|
||||||
"CODEC", "Mixer"
|
"CODEC", "Mixer"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(headset_amp_source, MC13783_AUDIO_RX0, 11,
|
static SOC_ENUM_SINGLE_DECL(headset_amp_source, MC13783_AUDIO_RX0, 11,
|
||||||
headset_amp_source_text);
|
headset_amp_source_text);
|
||||||
static const struct snd_kcontrol_new headset_amp_source_mux =
|
static const struct snd_kcontrol_new headset_amp_source_mux =
|
||||||
SOC_DAPM_ENUM("Headset Amp Source MUX", headset_amp_source);
|
SOC_DAPM_ENUM("Headset Amp Source MUX", headset_amp_source);
|
||||||
|
@ -580,8 +578,8 @@ static struct snd_soc_dapm_route mc13783_routes[] = {
|
||||||
static const char * const mc13783_3d_mixer[] = {"Stereo", "Phase Mix",
|
static const char * const mc13783_3d_mixer[] = {"Stereo", "Phase Mix",
|
||||||
"Mono", "Mono Mix"};
|
"Mono", "Mono Mix"};
|
||||||
|
|
||||||
static const struct soc_enum mc13783_enum_3d_mixer =
|
static SOC_ENUM_SINGLE_DECL(mc13783_enum_3d_mixer,
|
||||||
SOC_ENUM_SINGLE(MC13783_AUDIO_RX1, 16, ARRAY_SIZE(mc13783_3d_mixer),
|
MC13783_AUDIO_RX1, 16,
|
||||||
mc13783_3d_mixer);
|
mc13783_3d_mixer);
|
||||||
|
|
||||||
static struct snd_kcontrol_new mc13783_control_list[] = {
|
static struct snd_kcontrol_new mc13783_control_list[] = {
|
||||||
|
|
|
@ -210,25 +210,21 @@ static int rt5631_dmic_put(struct snd_kcontrol *kcontrol,
|
||||||
static const char *rt5631_input_mode[] = {
|
static const char *rt5631_input_mode[] = {
|
||||||
"Single ended", "Differential"};
|
"Single ended", "Differential"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_mic1_mode_enum, RT5631_MIC_CTRL_1,
|
||||||
rt5631_mic1_mode_enum, RT5631_MIC_CTRL_1,
|
|
||||||
RT5631_MIC1_DIFF_INPUT_SHIFT, rt5631_input_mode);
|
RT5631_MIC1_DIFF_INPUT_SHIFT, rt5631_input_mode);
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_mic2_mode_enum, RT5631_MIC_CTRL_1,
|
||||||
rt5631_mic2_mode_enum, RT5631_MIC_CTRL_1,
|
|
||||||
RT5631_MIC2_DIFF_INPUT_SHIFT, rt5631_input_mode);
|
RT5631_MIC2_DIFF_INPUT_SHIFT, rt5631_input_mode);
|
||||||
|
|
||||||
/* MONO Input Type */
|
/* MONO Input Type */
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_monoin_mode_enum, RT5631_MONO_INPUT_VOL,
|
||||||
rt5631_monoin_mode_enum, RT5631_MONO_INPUT_VOL,
|
|
||||||
RT5631_MONO_DIFF_INPUT_SHIFT, rt5631_input_mode);
|
RT5631_MONO_DIFF_INPUT_SHIFT, rt5631_input_mode);
|
||||||
|
|
||||||
/* SPK Ratio Gain Control */
|
/* SPK Ratio Gain Control */
|
||||||
static const char *rt5631_spk_ratio[] = {"1.00x", "1.09x", "1.27x", "1.44x",
|
static const char *rt5631_spk_ratio[] = {"1.00x", "1.09x", "1.27x", "1.44x",
|
||||||
"1.56x", "1.68x", "1.99x", "2.34x"};
|
"1.56x", "1.68x", "1.99x", "2.34x"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_spk_ratio_enum, RT5631_GEN_PUR_CTRL_REG,
|
||||||
rt5631_spk_ratio_enum, RT5631_GEN_PUR_CTRL_REG,
|
|
||||||
RT5631_SPK_AMP_RATIO_CTRL_SHIFT, rt5631_spk_ratio);
|
RT5631_SPK_AMP_RATIO_CTRL_SHIFT, rt5631_spk_ratio);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_snd_controls[] = {
|
static const struct snd_kcontrol_new rt5631_snd_controls[] = {
|
||||||
|
@ -759,8 +755,7 @@ static const struct snd_kcontrol_new rt5631_monomix_mixer_controls[] = {
|
||||||
/* Left SPK Volume Input */
|
/* Left SPK Volume Input */
|
||||||
static const char *rt5631_spkvoll_sel[] = {"Vmid", "SPKMIXL"};
|
static const char *rt5631_spkvoll_sel[] = {"Vmid", "SPKMIXL"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_spkvoll_enum, RT5631_SPK_OUT_VOL,
|
||||||
rt5631_spkvoll_enum, RT5631_SPK_OUT_VOL,
|
|
||||||
RT5631_L_EN_SHIFT, rt5631_spkvoll_sel);
|
RT5631_L_EN_SHIFT, rt5631_spkvoll_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_spkvoll_mux_control =
|
static const struct snd_kcontrol_new rt5631_spkvoll_mux_control =
|
||||||
|
@ -769,8 +764,7 @@ static const struct snd_kcontrol_new rt5631_spkvoll_mux_control =
|
||||||
/* Left HP Volume Input */
|
/* Left HP Volume Input */
|
||||||
static const char *rt5631_hpvoll_sel[] = {"Vmid", "OUTMIXL"};
|
static const char *rt5631_hpvoll_sel[] = {"Vmid", "OUTMIXL"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_hpvoll_enum, RT5631_HP_OUT_VOL,
|
||||||
rt5631_hpvoll_enum, RT5631_HP_OUT_VOL,
|
|
||||||
RT5631_L_EN_SHIFT, rt5631_hpvoll_sel);
|
RT5631_L_EN_SHIFT, rt5631_hpvoll_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_hpvoll_mux_control =
|
static const struct snd_kcontrol_new rt5631_hpvoll_mux_control =
|
||||||
|
@ -779,8 +773,7 @@ static const struct snd_kcontrol_new rt5631_hpvoll_mux_control =
|
||||||
/* Left Out Volume Input */
|
/* Left Out Volume Input */
|
||||||
static const char *rt5631_outvoll_sel[] = {"Vmid", "OUTMIXL"};
|
static const char *rt5631_outvoll_sel[] = {"Vmid", "OUTMIXL"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_outvoll_enum, RT5631_MONO_AXO_1_2_VOL,
|
||||||
rt5631_outvoll_enum, RT5631_MONO_AXO_1_2_VOL,
|
|
||||||
RT5631_L_EN_SHIFT, rt5631_outvoll_sel);
|
RT5631_L_EN_SHIFT, rt5631_outvoll_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_outvoll_mux_control =
|
static const struct snd_kcontrol_new rt5631_outvoll_mux_control =
|
||||||
|
@ -789,8 +782,7 @@ static const struct snd_kcontrol_new rt5631_outvoll_mux_control =
|
||||||
/* Right Out Volume Input */
|
/* Right Out Volume Input */
|
||||||
static const char *rt5631_outvolr_sel[] = {"Vmid", "OUTMIXR"};
|
static const char *rt5631_outvolr_sel[] = {"Vmid", "OUTMIXR"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_outvolr_enum, RT5631_MONO_AXO_1_2_VOL,
|
||||||
rt5631_outvolr_enum, RT5631_MONO_AXO_1_2_VOL,
|
|
||||||
RT5631_R_EN_SHIFT, rt5631_outvolr_sel);
|
RT5631_R_EN_SHIFT, rt5631_outvolr_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_outvolr_mux_control =
|
static const struct snd_kcontrol_new rt5631_outvolr_mux_control =
|
||||||
|
@ -799,8 +791,7 @@ static const struct snd_kcontrol_new rt5631_outvolr_mux_control =
|
||||||
/* Right HP Volume Input */
|
/* Right HP Volume Input */
|
||||||
static const char *rt5631_hpvolr_sel[] = {"Vmid", "OUTMIXR"};
|
static const char *rt5631_hpvolr_sel[] = {"Vmid", "OUTMIXR"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_hpvolr_enum, RT5631_HP_OUT_VOL,
|
||||||
rt5631_hpvolr_enum, RT5631_HP_OUT_VOL,
|
|
||||||
RT5631_R_EN_SHIFT, rt5631_hpvolr_sel);
|
RT5631_R_EN_SHIFT, rt5631_hpvolr_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_hpvolr_mux_control =
|
static const struct snd_kcontrol_new rt5631_hpvolr_mux_control =
|
||||||
|
@ -809,8 +800,7 @@ static const struct snd_kcontrol_new rt5631_hpvolr_mux_control =
|
||||||
/* Right SPK Volume Input */
|
/* Right SPK Volume Input */
|
||||||
static const char *rt5631_spkvolr_sel[] = {"Vmid", "SPKMIXR"};
|
static const char *rt5631_spkvolr_sel[] = {"Vmid", "SPKMIXR"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_spkvolr_enum, RT5631_SPK_OUT_VOL,
|
||||||
rt5631_spkvolr_enum, RT5631_SPK_OUT_VOL,
|
|
||||||
RT5631_R_EN_SHIFT, rt5631_spkvolr_sel);
|
RT5631_R_EN_SHIFT, rt5631_spkvolr_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_spkvolr_mux_control =
|
static const struct snd_kcontrol_new rt5631_spkvolr_mux_control =
|
||||||
|
@ -820,8 +810,7 @@ static const struct snd_kcontrol_new rt5631_spkvolr_mux_control =
|
||||||
static const char *rt5631_spol_src_sel[] = {
|
static const char *rt5631_spol_src_sel[] = {
|
||||||
"SPOLMIX", "MONOIN_RX", "VDAC", "DACL"};
|
"SPOLMIX", "MONOIN_RX", "VDAC", "DACL"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_spol_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
||||||
rt5631_spol_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
|
||||||
RT5631_SPK_L_MUX_SEL_SHIFT, rt5631_spol_src_sel);
|
RT5631_SPK_L_MUX_SEL_SHIFT, rt5631_spol_src_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_spol_mux_control =
|
static const struct snd_kcontrol_new rt5631_spol_mux_control =
|
||||||
|
@ -831,8 +820,7 @@ static const struct snd_kcontrol_new rt5631_spol_mux_control =
|
||||||
static const char *rt5631_spor_src_sel[] = {
|
static const char *rt5631_spor_src_sel[] = {
|
||||||
"SPORMIX", "MONOIN_RX", "VDAC", "DACR"};
|
"SPORMIX", "MONOIN_RX", "VDAC", "DACR"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_spor_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
||||||
rt5631_spor_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
|
||||||
RT5631_SPK_R_MUX_SEL_SHIFT, rt5631_spor_src_sel);
|
RT5631_SPK_R_MUX_SEL_SHIFT, rt5631_spor_src_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_spor_mux_control =
|
static const struct snd_kcontrol_new rt5631_spor_mux_control =
|
||||||
|
@ -841,8 +829,7 @@ static const struct snd_kcontrol_new rt5631_spor_mux_control =
|
||||||
/* MONO Input */
|
/* MONO Input */
|
||||||
static const char *rt5631_mono_src_sel[] = {"MONOMIX", "MONOIN_RX", "VDAC"};
|
static const char *rt5631_mono_src_sel[] = {"MONOMIX", "MONOIN_RX", "VDAC"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_mono_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
||||||
rt5631_mono_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
|
||||||
RT5631_MONO_MUX_SEL_SHIFT, rt5631_mono_src_sel);
|
RT5631_MONO_MUX_SEL_SHIFT, rt5631_mono_src_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_mono_mux_control =
|
static const struct snd_kcontrol_new rt5631_mono_mux_control =
|
||||||
|
@ -851,8 +838,7 @@ static const struct snd_kcontrol_new rt5631_mono_mux_control =
|
||||||
/* Left HPO Input */
|
/* Left HPO Input */
|
||||||
static const char *rt5631_hpl_src_sel[] = {"Left HPVOL", "Left DAC"};
|
static const char *rt5631_hpl_src_sel[] = {"Left HPVOL", "Left DAC"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_hpl_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
||||||
rt5631_hpl_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
|
||||||
RT5631_HP_L_MUX_SEL_SHIFT, rt5631_hpl_src_sel);
|
RT5631_HP_L_MUX_SEL_SHIFT, rt5631_hpl_src_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_hpl_mux_control =
|
static const struct snd_kcontrol_new rt5631_hpl_mux_control =
|
||||||
|
@ -861,8 +847,7 @@ static const struct snd_kcontrol_new rt5631_hpl_mux_control =
|
||||||
/* Right HPO Input */
|
/* Right HPO Input */
|
||||||
static const char *rt5631_hpr_src_sel[] = {"Right HPVOL", "Right DAC"};
|
static const char *rt5631_hpr_src_sel[] = {"Right HPVOL", "Right DAC"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5631_hpr_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
||||||
rt5631_hpr_src_enum, RT5631_SPK_MONO_HP_OUT_CTRL,
|
|
||||||
RT5631_HP_R_MUX_SEL_SHIFT, rt5631_hpr_src_sel);
|
RT5631_HP_R_MUX_SEL_SHIFT, rt5631_hpr_src_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5631_hpr_mux_control =
|
static const struct snd_kcontrol_new rt5631_hpr_mux_control =
|
||||||
|
|
|
@ -361,24 +361,23 @@ static unsigned int bst_tlv[] = {
|
||||||
static const char * const rt5640_data_select[] = {
|
static const char * const rt5640_data_select[] = {
|
||||||
"Normal", "left copy to right", "right copy to left", "Swap"};
|
"Normal", "left copy to right", "right copy to left", "Swap"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(rt5640_if1_dac_enum, RT5640_DIG_INF_DATA,
|
static SOC_ENUM_SINGLE_DECL(rt5640_if1_dac_enum, RT5640_DIG_INF_DATA,
|
||||||
RT5640_IF1_DAC_SEL_SFT, rt5640_data_select);
|
RT5640_IF1_DAC_SEL_SFT, rt5640_data_select);
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(rt5640_if1_adc_enum, RT5640_DIG_INF_DATA,
|
static SOC_ENUM_SINGLE_DECL(rt5640_if1_adc_enum, RT5640_DIG_INF_DATA,
|
||||||
RT5640_IF1_ADC_SEL_SFT, rt5640_data_select);
|
RT5640_IF1_ADC_SEL_SFT, rt5640_data_select);
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(rt5640_if2_dac_enum, RT5640_DIG_INF_DATA,
|
static SOC_ENUM_SINGLE_DECL(rt5640_if2_dac_enum, RT5640_DIG_INF_DATA,
|
||||||
RT5640_IF2_DAC_SEL_SFT, rt5640_data_select);
|
RT5640_IF2_DAC_SEL_SFT, rt5640_data_select);
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(rt5640_if2_adc_enum, RT5640_DIG_INF_DATA,
|
static SOC_ENUM_SINGLE_DECL(rt5640_if2_adc_enum, RT5640_DIG_INF_DATA,
|
||||||
RT5640_IF2_ADC_SEL_SFT, rt5640_data_select);
|
RT5640_IF2_ADC_SEL_SFT, rt5640_data_select);
|
||||||
|
|
||||||
/* Class D speaker gain ratio */
|
/* Class D speaker gain ratio */
|
||||||
static const char * const rt5640_clsd_spk_ratio[] = {"1.66x", "1.83x", "1.94x",
|
static const char * const rt5640_clsd_spk_ratio[] = {"1.66x", "1.83x", "1.94x",
|
||||||
"2x", "2.11x", "2.22x", "2.33x", "2.44x", "2.55x", "2.66x", "2.77x"};
|
"2x", "2.11x", "2.22x", "2.33x", "2.44x", "2.55x", "2.66x", "2.77x"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_clsd_spk_ratio_enum, RT5640_CLS_D_OUT,
|
||||||
rt5640_clsd_spk_ratio_enum, RT5640_CLS_D_OUT,
|
|
||||||
RT5640_CLSD_RATIO_SFT, rt5640_clsd_spk_ratio);
|
RT5640_CLSD_RATIO_SFT, rt5640_clsd_spk_ratio);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_snd_controls[] = {
|
static const struct snd_kcontrol_new rt5640_snd_controls[] = {
|
||||||
|
@ -753,8 +752,7 @@ static const char * const rt5640_stereo_adc1_src[] = {
|
||||||
"DIG MIX", "ADC"
|
"DIG MIX", "ADC"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_stereo_adc1_enum, RT5640_STO_ADC_MIXER,
|
||||||
rt5640_stereo_adc1_enum, RT5640_STO_ADC_MIXER,
|
|
||||||
RT5640_ADC_1_SRC_SFT, rt5640_stereo_adc1_src);
|
RT5640_ADC_1_SRC_SFT, rt5640_stereo_adc1_src);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_sto_adc_1_mux =
|
static const struct snd_kcontrol_new rt5640_sto_adc_1_mux =
|
||||||
|
@ -764,8 +762,7 @@ static const char * const rt5640_stereo_adc2_src[] = {
|
||||||
"DMIC1", "DMIC2", "DIG MIX"
|
"DMIC1", "DMIC2", "DIG MIX"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_stereo_adc2_enum, RT5640_STO_ADC_MIXER,
|
||||||
rt5640_stereo_adc2_enum, RT5640_STO_ADC_MIXER,
|
|
||||||
RT5640_ADC_2_SRC_SFT, rt5640_stereo_adc2_src);
|
RT5640_ADC_2_SRC_SFT, rt5640_stereo_adc2_src);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_sto_adc_2_mux =
|
static const struct snd_kcontrol_new rt5640_sto_adc_2_mux =
|
||||||
|
@ -776,8 +773,7 @@ static const char * const rt5640_mono_adc_l1_src[] = {
|
||||||
"Mono DAC MIXL", "ADCL"
|
"Mono DAC MIXL", "ADCL"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_mono_adc_l1_enum, RT5640_MONO_ADC_MIXER,
|
||||||
rt5640_mono_adc_l1_enum, RT5640_MONO_ADC_MIXER,
|
|
||||||
RT5640_MONO_ADC_L1_SRC_SFT, rt5640_mono_adc_l1_src);
|
RT5640_MONO_ADC_L1_SRC_SFT, rt5640_mono_adc_l1_src);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_mono_adc_l1_mux =
|
static const struct snd_kcontrol_new rt5640_mono_adc_l1_mux =
|
||||||
|
@ -787,8 +783,7 @@ static const char * const rt5640_mono_adc_l2_src[] = {
|
||||||
"DMIC L1", "DMIC L2", "Mono DAC MIXL"
|
"DMIC L1", "DMIC L2", "Mono DAC MIXL"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_mono_adc_l2_enum, RT5640_MONO_ADC_MIXER,
|
||||||
rt5640_mono_adc_l2_enum, RT5640_MONO_ADC_MIXER,
|
|
||||||
RT5640_MONO_ADC_L2_SRC_SFT, rt5640_mono_adc_l2_src);
|
RT5640_MONO_ADC_L2_SRC_SFT, rt5640_mono_adc_l2_src);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_mono_adc_l2_mux =
|
static const struct snd_kcontrol_new rt5640_mono_adc_l2_mux =
|
||||||
|
@ -798,8 +793,7 @@ static const char * const rt5640_mono_adc_r1_src[] = {
|
||||||
"Mono DAC MIXR", "ADCR"
|
"Mono DAC MIXR", "ADCR"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_mono_adc_r1_enum, RT5640_MONO_ADC_MIXER,
|
||||||
rt5640_mono_adc_r1_enum, RT5640_MONO_ADC_MIXER,
|
|
||||||
RT5640_MONO_ADC_R1_SRC_SFT, rt5640_mono_adc_r1_src);
|
RT5640_MONO_ADC_R1_SRC_SFT, rt5640_mono_adc_r1_src);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_mono_adc_r1_mux =
|
static const struct snd_kcontrol_new rt5640_mono_adc_r1_mux =
|
||||||
|
@ -809,8 +803,7 @@ static const char * const rt5640_mono_adc_r2_src[] = {
|
||||||
"DMIC R1", "DMIC R2", "Mono DAC MIXR"
|
"DMIC R1", "DMIC R2", "Mono DAC MIXR"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_mono_adc_r2_enum, RT5640_MONO_ADC_MIXER,
|
||||||
rt5640_mono_adc_r2_enum, RT5640_MONO_ADC_MIXER,
|
|
||||||
RT5640_MONO_ADC_R2_SRC_SFT, rt5640_mono_adc_r2_src);
|
RT5640_MONO_ADC_R2_SRC_SFT, rt5640_mono_adc_r2_src);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_mono_adc_r2_mux =
|
static const struct snd_kcontrol_new rt5640_mono_adc_r2_mux =
|
||||||
|
@ -826,8 +819,8 @@ static int rt5640_dac_l2_values[] = {
|
||||||
3,
|
3,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_VALUE_ENUM_SINGLE_DECL(
|
static SOC_VALUE_ENUM_SINGLE_DECL(rt5640_dac_l2_enum,
|
||||||
rt5640_dac_l2_enum, RT5640_DSP_PATH2, RT5640_DAC_L2_SEL_SFT,
|
RT5640_DSP_PATH2, RT5640_DAC_L2_SEL_SFT,
|
||||||
0x3, rt5640_dac_l2_src, rt5640_dac_l2_values);
|
0x3, rt5640_dac_l2_src, rt5640_dac_l2_values);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_dac_l2_mux =
|
static const struct snd_kcontrol_new rt5640_dac_l2_mux =
|
||||||
|
@ -841,8 +834,8 @@ static int rt5640_dac_r2_values[] = {
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_VALUE_ENUM_SINGLE_DECL(
|
static SOC_VALUE_ENUM_SINGLE_DECL(rt5640_dac_r2_enum,
|
||||||
rt5640_dac_r2_enum, RT5640_DSP_PATH2, RT5640_DAC_R2_SEL_SFT,
|
RT5640_DSP_PATH2, RT5640_DAC_R2_SEL_SFT,
|
||||||
0x3, rt5640_dac_r2_src, rt5640_dac_r2_values);
|
0x3, rt5640_dac_r2_src, rt5640_dac_r2_values);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_dac_r2_mux =
|
static const struct snd_kcontrol_new rt5640_dac_r2_mux =
|
||||||
|
@ -860,9 +853,10 @@ static int rt5640_dai_iis_map_values[] = {
|
||||||
7,
|
7,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_VALUE_ENUM_SINGLE_DECL(
|
static SOC_VALUE_ENUM_SINGLE_DECL(rt5640_dai_iis_map_enum,
|
||||||
rt5640_dai_iis_map_enum, RT5640_I2S1_SDP, RT5640_I2S_IF_SFT,
|
RT5640_I2S1_SDP, RT5640_I2S_IF_SFT,
|
||||||
0x7, rt5640_dai_iis_map, rt5640_dai_iis_map_values);
|
0x7, rt5640_dai_iis_map,
|
||||||
|
rt5640_dai_iis_map_values);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_dai_mux =
|
static const struct snd_kcontrol_new rt5640_dai_mux =
|
||||||
SOC_DAPM_VALUE_ENUM("DAI select", rt5640_dai_iis_map_enum);
|
SOC_DAPM_VALUE_ENUM("DAI select", rt5640_dai_iis_map_enum);
|
||||||
|
@ -872,8 +866,7 @@ static const char * const rt5640_sdi_sel[] = {
|
||||||
"IF1", "IF2"
|
"IF1", "IF2"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(
|
static SOC_ENUM_SINGLE_DECL(rt5640_sdi_sel_enum, RT5640_I2S2_SDP,
|
||||||
rt5640_sdi_sel_enum, RT5640_I2S2_SDP,
|
|
||||||
RT5640_I2S2_SDI_SFT, rt5640_sdi_sel);
|
RT5640_I2S2_SDI_SFT, rt5640_sdi_sel);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5640_sdi_mux =
|
static const struct snd_kcontrol_new rt5640_sdi_mux =
|
||||||
|
|
|
@ -169,19 +169,19 @@ static const char * const ssm2518_drc_hold_time_text[] = {
|
||||||
"682.24 ms", "1364 ms",
|
"682.24 ms", "1364 ms",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(ssm2518_drc_peak_detector_attack_time_enum,
|
static SOC_ENUM_SINGLE_DECL(ssm2518_drc_peak_detector_attack_time_enum,
|
||||||
SSM2518_REG_DRC_2, 4, ssm2518_drc_peak_detector_attack_time_text);
|
SSM2518_REG_DRC_2, 4, ssm2518_drc_peak_detector_attack_time_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(ssm2518_drc_peak_detector_release_time_enum,
|
static SOC_ENUM_SINGLE_DECL(ssm2518_drc_peak_detector_release_time_enum,
|
||||||
SSM2518_REG_DRC_2, 0, ssm2518_drc_peak_detector_release_time_text);
|
SSM2518_REG_DRC_2, 0, ssm2518_drc_peak_detector_release_time_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(ssm2518_drc_attack_time_enum,
|
static SOC_ENUM_SINGLE_DECL(ssm2518_drc_attack_time_enum,
|
||||||
SSM2518_REG_DRC_6, 4, ssm2518_drc_peak_detector_attack_time_text);
|
SSM2518_REG_DRC_6, 4, ssm2518_drc_peak_detector_attack_time_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(ssm2518_drc_decay_time_enum,
|
static SOC_ENUM_SINGLE_DECL(ssm2518_drc_decay_time_enum,
|
||||||
SSM2518_REG_DRC_6, 0, ssm2518_drc_peak_detector_release_time_text);
|
SSM2518_REG_DRC_6, 0, ssm2518_drc_peak_detector_release_time_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(ssm2518_drc_hold_time_enum,
|
static SOC_ENUM_SINGLE_DECL(ssm2518_drc_hold_time_enum,
|
||||||
SSM2518_REG_DRC_7, 4, ssm2518_drc_hold_time_text);
|
SSM2518_REG_DRC_7, 4, ssm2518_drc_hold_time_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(ssm2518_drc_noise_gate_hold_time_enum,
|
static SOC_ENUM_SINGLE_DECL(ssm2518_drc_noise_gate_hold_time_enum,
|
||||||
SSM2518_REG_DRC_7, 0, ssm2518_drc_hold_time_text);
|
SSM2518_REG_DRC_7, 0, ssm2518_drc_hold_time_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(ssm2518_drc_rms_averaging_time_enum,
|
static SOC_ENUM_SINGLE_DECL(ssm2518_drc_rms_averaging_time_enum,
|
||||||
SSM2518_REG_DRC_9, 0, ssm2518_drc_peak_detector_release_time_text);
|
SSM2518_REG_DRC_9, 0, ssm2518_drc_peak_detector_release_time_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new ssm2518_snd_controls[] = {
|
static const struct snd_kcontrol_new ssm2518_snd_controls[] = {
|
||||||
|
|
|
@ -141,7 +141,7 @@ static const char *pwm_mode_text[] = { "Binary", "Headphone", "Ternary",
|
||||||
|
|
||||||
static const DECLARE_TLV_DB_SCALE(out_gain_tlv, -9150, 50, 0);
|
static const DECLARE_TLV_DB_SCALE(out_gain_tlv, -9150, 50, 0);
|
||||||
static const DECLARE_TLV_DB_SCALE(master_vol_tlv, -12750, 50, 0);
|
static const DECLARE_TLV_DB_SCALE(master_vol_tlv, -12750, 50, 0);
|
||||||
static const SOC_ENUM_SINGLE_DECL(pwm_src, STA529_FFXCFG1, 4, pwm_mode_text);
|
static SOC_ENUM_SINGLE_DECL(pwm_src, STA529_FFXCFG1, 4, pwm_mode_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new sta529_snd_controls[] = {
|
static const struct snd_kcontrol_new sta529_snd_controls[] = {
|
||||||
SOC_DOUBLE_R_TLV("Digital Playback Volume", STA529_LVOL, STA529_RVOL, 0,
|
SOC_DOUBLE_R_TLV("Digital Playback Volume", STA529_LVOL, STA529_RVOL, 0,
|
||||||
|
|
|
@ -965,9 +965,6 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||||
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
||||||
unsigned short val;
|
|
||||||
unsigned short mask;
|
|
||||||
|
|
||||||
if (twl4030->configured) {
|
if (twl4030->configured) {
|
||||||
dev_err(codec->dev,
|
dev_err(codec->dev,
|
||||||
|
@ -975,19 +972,7 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > e->max - 1)
|
return snd_soc_put_enum_double(kcontrol, ucontrol);
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
val = ucontrol->value.enumerated.item[0] << e->shift_l;
|
|
||||||
mask = e->mask << e->shift_l;
|
|
||||||
if (e->shift_l != e->shift_r) {
|
|
||||||
if (ucontrol->value.enumerated.item[1] > e->max - 1)
|
|
||||||
return -EINVAL;
|
|
||||||
val |= ucontrol->value.enumerated.item[1] << e->shift_r;
|
|
||||||
mask |= e->mask << e->shift_r;
|
|
||||||
}
|
|
||||||
|
|
||||||
return snd_soc_update_bits(codec, e->reg, mask, val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -92,7 +92,7 @@ WM8804_REGULATOR_EVENT(0)
|
||||||
WM8804_REGULATOR_EVENT(1)
|
WM8804_REGULATOR_EVENT(1)
|
||||||
|
|
||||||
static const char *txsrc_text[] = { "S/PDIF RX", "AIF" };
|
static const char *txsrc_text[] = { "S/PDIF RX", "AIF" };
|
||||||
static const SOC_ENUM_SINGLE_EXT_DECL(txsrc, txsrc_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(txsrc, txsrc_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new wm8804_snd_controls[] = {
|
static const struct snd_kcontrol_new wm8804_snd_controls[] = {
|
||||||
SOC_ENUM_EXT("Input Source", txsrc, txsrc_get, txsrc_put),
|
SOC_ENUM_EXT("Input Source", txsrc, txsrc_get, txsrc_put),
|
||||||
|
|
|
@ -1981,7 +1981,7 @@ static void wm8904_handle_retune_mobile_pdata(struct snd_soc_codec *codec)
|
||||||
dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
|
dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
|
||||||
wm8904->num_retune_mobile_texts);
|
wm8904->num_retune_mobile_texts);
|
||||||
|
|
||||||
wm8904->retune_mobile_enum.max = wm8904->num_retune_mobile_texts;
|
wm8904->retune_mobile_enum.items = wm8904->num_retune_mobile_texts;
|
||||||
wm8904->retune_mobile_enum.texts = wm8904->retune_mobile_texts;
|
wm8904->retune_mobile_enum.texts = wm8904->retune_mobile_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, &control, 1);
|
ret = snd_soc_add_codec_controls(codec, &control, 1);
|
||||||
|
@ -2022,7 +2022,7 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
|
||||||
for (i = 0; i < pdata->num_drc_cfgs; i++)
|
for (i = 0; i < pdata->num_drc_cfgs; i++)
|
||||||
wm8904->drc_texts[i] = pdata->drc_cfgs[i].name;
|
wm8904->drc_texts[i] = pdata->drc_cfgs[i].name;
|
||||||
|
|
||||||
wm8904->drc_enum.max = pdata->num_drc_cfgs;
|
wm8904->drc_enum.items = pdata->num_drc_cfgs;
|
||||||
wm8904->drc_enum.texts = wm8904->drc_texts;
|
wm8904->drc_enum.texts = wm8904->drc_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, &control, 1);
|
ret = snd_soc_add_codec_controls(codec, &control, 1);
|
||||||
|
|
|
@ -944,7 +944,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
|
||||||
for (i = 0; i < pdata->num_mbc_cfgs; i++)
|
for (i = 0; i < pdata->num_mbc_cfgs; i++)
|
||||||
wm8994->mbc_texts[i] = pdata->mbc_cfgs[i].name;
|
wm8994->mbc_texts[i] = pdata->mbc_cfgs[i].name;
|
||||||
|
|
||||||
wm8994->mbc_enum.max = pdata->num_mbc_cfgs;
|
wm8994->mbc_enum.items = pdata->num_mbc_cfgs;
|
||||||
wm8994->mbc_enum.texts = wm8994->mbc_texts;
|
wm8994->mbc_enum.texts = wm8994->mbc_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
||||||
|
@ -973,7 +973,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
|
||||||
for (i = 0; i < pdata->num_vss_cfgs; i++)
|
for (i = 0; i < pdata->num_vss_cfgs; i++)
|
||||||
wm8994->vss_texts[i] = pdata->vss_cfgs[i].name;
|
wm8994->vss_texts[i] = pdata->vss_cfgs[i].name;
|
||||||
|
|
||||||
wm8994->vss_enum.max = pdata->num_vss_cfgs;
|
wm8994->vss_enum.items = pdata->num_vss_cfgs;
|
||||||
wm8994->vss_enum.texts = wm8994->vss_texts;
|
wm8994->vss_enum.texts = wm8994->vss_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
||||||
|
@ -1003,7 +1003,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
|
||||||
for (i = 0; i < pdata->num_vss_hpf_cfgs; i++)
|
for (i = 0; i < pdata->num_vss_hpf_cfgs; i++)
|
||||||
wm8994->vss_hpf_texts[i] = pdata->vss_hpf_cfgs[i].name;
|
wm8994->vss_hpf_texts[i] = pdata->vss_hpf_cfgs[i].name;
|
||||||
|
|
||||||
wm8994->vss_hpf_enum.max = pdata->num_vss_hpf_cfgs;
|
wm8994->vss_hpf_enum.items = pdata->num_vss_hpf_cfgs;
|
||||||
wm8994->vss_hpf_enum.texts = wm8994->vss_hpf_texts;
|
wm8994->vss_hpf_enum.texts = wm8994->vss_hpf_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
||||||
|
@ -1034,7 +1034,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
|
||||||
for (i = 0; i < pdata->num_enh_eq_cfgs; i++)
|
for (i = 0; i < pdata->num_enh_eq_cfgs; i++)
|
||||||
wm8994->enh_eq_texts[i] = pdata->enh_eq_cfgs[i].name;
|
wm8994->enh_eq_texts[i] = pdata->enh_eq_cfgs[i].name;
|
||||||
|
|
||||||
wm8994->enh_eq_enum.max = pdata->num_enh_eq_cfgs;
|
wm8994->enh_eq_enum.items = pdata->num_enh_eq_cfgs;
|
||||||
wm8994->enh_eq_enum.texts = wm8994->enh_eq_texts;
|
wm8994->enh_eq_enum.texts = wm8994->enh_eq_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
ret = snd_soc_add_codec_controls(wm8994->hubs.codec,
|
||||||
|
|
|
@ -117,21 +117,21 @@ static const char *wm8978_eq5[] = {"5.3kHz", "6.9kHz", "9kHz", "11.7kHz"};
|
||||||
static const char *wm8978_alc3[] = {"ALC", "Limiter"};
|
static const char *wm8978_alc3[] = {"ALC", "Limiter"};
|
||||||
static const char *wm8978_alc1[] = {"Off", "Right", "Left", "Both"};
|
static const char *wm8978_alc1[] = {"Off", "Right", "Left", "Both"};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(adc_compand, WM8978_COMPANDING_CONTROL, 1,
|
static SOC_ENUM_SINGLE_DECL(adc_compand, WM8978_COMPANDING_CONTROL, 1,
|
||||||
wm8978_companding);
|
wm8978_companding);
|
||||||
static const SOC_ENUM_SINGLE_DECL(dac_compand, WM8978_COMPANDING_CONTROL, 3,
|
static SOC_ENUM_SINGLE_DECL(dac_compand, WM8978_COMPANDING_CONTROL, 3,
|
||||||
wm8978_companding);
|
wm8978_companding);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eqmode, WM8978_EQ1, 8, wm8978_eqmode);
|
static SOC_ENUM_SINGLE_DECL(eqmode, WM8978_EQ1, 8, wm8978_eqmode);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq1, WM8978_EQ1, 5, wm8978_eq1);
|
static SOC_ENUM_SINGLE_DECL(eq1, WM8978_EQ1, 5, wm8978_eq1);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq2bw, WM8978_EQ2, 8, wm8978_bw);
|
static SOC_ENUM_SINGLE_DECL(eq2bw, WM8978_EQ2, 8, wm8978_bw);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq2, WM8978_EQ2, 5, wm8978_eq2);
|
static SOC_ENUM_SINGLE_DECL(eq2, WM8978_EQ2, 5, wm8978_eq2);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq3bw, WM8978_EQ3, 8, wm8978_bw);
|
static SOC_ENUM_SINGLE_DECL(eq3bw, WM8978_EQ3, 8, wm8978_bw);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq3, WM8978_EQ3, 5, wm8978_eq3);
|
static SOC_ENUM_SINGLE_DECL(eq3, WM8978_EQ3, 5, wm8978_eq3);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq4bw, WM8978_EQ4, 8, wm8978_bw);
|
static SOC_ENUM_SINGLE_DECL(eq4bw, WM8978_EQ4, 8, wm8978_bw);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq4, WM8978_EQ4, 5, wm8978_eq4);
|
static SOC_ENUM_SINGLE_DECL(eq4, WM8978_EQ4, 5, wm8978_eq4);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq5, WM8978_EQ5, 5, wm8978_eq5);
|
static SOC_ENUM_SINGLE_DECL(eq5, WM8978_EQ5, 5, wm8978_eq5);
|
||||||
static const SOC_ENUM_SINGLE_DECL(alc3, WM8978_ALC_CONTROL_3, 8, wm8978_alc3);
|
static SOC_ENUM_SINGLE_DECL(alc3, WM8978_ALC_CONTROL_3, 8, wm8978_alc3);
|
||||||
static const SOC_ENUM_SINGLE_DECL(alc1, WM8978_ALC_CONTROL_1, 7, wm8978_alc1);
|
static SOC_ENUM_SINGLE_DECL(alc1, WM8978_ALC_CONTROL_1, 7, wm8978_alc1);
|
||||||
|
|
||||||
static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1);
|
static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1);
|
||||||
static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
|
static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
|
||||||
|
|
|
@ -205,48 +205,43 @@ static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
|
||||||
static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0);
|
static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0);
|
||||||
|
|
||||||
static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" };
|
static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" };
|
||||||
static const SOC_ENUM_SINGLE_DECL(alc_sel, WM8983_ALC_CONTROL_1, 7,
|
static SOC_ENUM_SINGLE_DECL(alc_sel, WM8983_ALC_CONTROL_1, 7, alc_sel_text);
|
||||||
alc_sel_text);
|
|
||||||
|
|
||||||
static const char *alc_mode_text[] = { "ALC", "Limiter" };
|
static const char *alc_mode_text[] = { "ALC", "Limiter" };
|
||||||
static const SOC_ENUM_SINGLE_DECL(alc_mode, WM8983_ALC_CONTROL_3, 8,
|
static SOC_ENUM_SINGLE_DECL(alc_mode, WM8983_ALC_CONTROL_3, 8, alc_mode_text);
|
||||||
alc_mode_text);
|
|
||||||
|
|
||||||
static const char *filter_mode_text[] = { "Audio", "Application" };
|
static const char *filter_mode_text[] = { "Audio", "Application" };
|
||||||
static const SOC_ENUM_SINGLE_DECL(filter_mode, WM8983_ADC_CONTROL, 7,
|
static SOC_ENUM_SINGLE_DECL(filter_mode, WM8983_ADC_CONTROL, 7,
|
||||||
filter_mode_text);
|
filter_mode_text);
|
||||||
|
|
||||||
static const char *eq_bw_text[] = { "Narrow", "Wide" };
|
static const char *eq_bw_text[] = { "Narrow", "Wide" };
|
||||||
static const char *eqmode_text[] = { "Capture", "Playback" };
|
static const char *eqmode_text[] = { "Capture", "Playback" };
|
||||||
static const SOC_ENUM_SINGLE_EXT_DECL(eqmode, eqmode_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(eqmode, eqmode_text);
|
||||||
|
|
||||||
static const char *eq1_cutoff_text[] = {
|
static const char *eq1_cutoff_text[] = {
|
||||||
"80Hz", "105Hz", "135Hz", "175Hz"
|
"80Hz", "105Hz", "135Hz", "175Hz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq1_cutoff, WM8983_EQ1_LOW_SHELF, 5,
|
static SOC_ENUM_SINGLE_DECL(eq1_cutoff, WM8983_EQ1_LOW_SHELF, 5,
|
||||||
eq1_cutoff_text);
|
eq1_cutoff_text);
|
||||||
static const char *eq2_cutoff_text[] = {
|
static const char *eq2_cutoff_text[] = {
|
||||||
"230Hz", "300Hz", "385Hz", "500Hz"
|
"230Hz", "300Hz", "385Hz", "500Hz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq2_bw, WM8983_EQ2_PEAK_1, 8, eq_bw_text);
|
static SOC_ENUM_SINGLE_DECL(eq2_bw, WM8983_EQ2_PEAK_1, 8, eq_bw_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq2_cutoff, WM8983_EQ2_PEAK_1, 5,
|
static SOC_ENUM_SINGLE_DECL(eq2_cutoff, WM8983_EQ2_PEAK_1, 5, eq2_cutoff_text);
|
||||||
eq2_cutoff_text);
|
|
||||||
static const char *eq3_cutoff_text[] = {
|
static const char *eq3_cutoff_text[] = {
|
||||||
"650Hz", "850Hz", "1.1kHz", "1.4kHz"
|
"650Hz", "850Hz", "1.1kHz", "1.4kHz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq3_bw, WM8983_EQ3_PEAK_2, 8, eq_bw_text);
|
static SOC_ENUM_SINGLE_DECL(eq3_bw, WM8983_EQ3_PEAK_2, 8, eq_bw_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq3_cutoff, WM8983_EQ3_PEAK_2, 5,
|
static SOC_ENUM_SINGLE_DECL(eq3_cutoff, WM8983_EQ3_PEAK_2, 5, eq3_cutoff_text);
|
||||||
eq3_cutoff_text);
|
|
||||||
static const char *eq4_cutoff_text[] = {
|
static const char *eq4_cutoff_text[] = {
|
||||||
"1.8kHz", "2.4kHz", "3.2kHz", "4.1kHz"
|
"1.8kHz", "2.4kHz", "3.2kHz", "4.1kHz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq4_bw, WM8983_EQ4_PEAK_3, 8, eq_bw_text);
|
static SOC_ENUM_SINGLE_DECL(eq4_bw, WM8983_EQ4_PEAK_3, 8, eq_bw_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq4_cutoff, WM8983_EQ4_PEAK_3, 5,
|
static SOC_ENUM_SINGLE_DECL(eq4_cutoff, WM8983_EQ4_PEAK_3, 5, eq4_cutoff_text);
|
||||||
eq4_cutoff_text);
|
|
||||||
static const char *eq5_cutoff_text[] = {
|
static const char *eq5_cutoff_text[] = {
|
||||||
"5.3kHz", "6.9kHz", "9kHz", "11.7kHz"
|
"5.3kHz", "6.9kHz", "9kHz", "11.7kHz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq5_cutoff, WM8983_EQ5_HIGH_SHELF, 5,
|
static SOC_ENUM_SINGLE_DECL(eq5_cutoff, WM8983_EQ5_HIGH_SHELF, 5,
|
||||||
eq5_cutoff_text);
|
eq5_cutoff_text);
|
||||||
|
|
||||||
static const char *depth_3d_text[] = {
|
static const char *depth_3d_text[] = {
|
||||||
|
@ -267,7 +262,7 @@ static const char *depth_3d_text[] = {
|
||||||
"93.3%",
|
"93.3%",
|
||||||
"100%"
|
"100%"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(depth_3d, WM8983_3D_CONTROL, 0,
|
static SOC_ENUM_SINGLE_DECL(depth_3d, WM8983_3D_CONTROL, 0,
|
||||||
depth_3d_text);
|
depth_3d_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new wm8983_snd_controls[] = {
|
static const struct snd_kcontrol_new wm8983_snd_controls[] = {
|
||||||
|
|
|
@ -226,52 +226,48 @@ static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
|
||||||
static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0);
|
static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0);
|
||||||
|
|
||||||
static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" };
|
static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" };
|
||||||
static const SOC_ENUM_SINGLE_DECL(alc_sel, WM8985_ALC_CONTROL_1, 7,
|
static SOC_ENUM_SINGLE_DECL(alc_sel, WM8985_ALC_CONTROL_1, 7, alc_sel_text);
|
||||||
alc_sel_text);
|
|
||||||
|
|
||||||
static const char *alc_mode_text[] = { "ALC", "Limiter" };
|
static const char *alc_mode_text[] = { "ALC", "Limiter" };
|
||||||
static const SOC_ENUM_SINGLE_DECL(alc_mode, WM8985_ALC_CONTROL_3, 8,
|
static SOC_ENUM_SINGLE_DECL(alc_mode, WM8985_ALC_CONTROL_3, 8, alc_mode_text);
|
||||||
alc_mode_text);
|
|
||||||
|
|
||||||
static const char *filter_mode_text[] = { "Audio", "Application" };
|
static const char *filter_mode_text[] = { "Audio", "Application" };
|
||||||
static const SOC_ENUM_SINGLE_DECL(filter_mode, WM8985_ADC_CONTROL, 7,
|
static SOC_ENUM_SINGLE_DECL(filter_mode, WM8985_ADC_CONTROL, 7,
|
||||||
filter_mode_text);
|
filter_mode_text);
|
||||||
|
|
||||||
static const char *eq_bw_text[] = { "Narrow", "Wide" };
|
static const char *eq_bw_text[] = { "Narrow", "Wide" };
|
||||||
static const char *eqmode_text[] = { "Capture", "Playback" };
|
static const char *eqmode_text[] = { "Capture", "Playback" };
|
||||||
static const SOC_ENUM_SINGLE_EXT_DECL(eqmode, eqmode_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(eqmode, eqmode_text);
|
||||||
|
|
||||||
static const char *eq1_cutoff_text[] = {
|
static const char *eq1_cutoff_text[] = {
|
||||||
"80Hz", "105Hz", "135Hz", "175Hz"
|
"80Hz", "105Hz", "135Hz", "175Hz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq1_cutoff, WM8985_EQ1_LOW_SHELF, 5,
|
static SOC_ENUM_SINGLE_DECL(eq1_cutoff, WM8985_EQ1_LOW_SHELF, 5,
|
||||||
eq1_cutoff_text);
|
eq1_cutoff_text);
|
||||||
static const char *eq2_cutoff_text[] = {
|
static const char *eq2_cutoff_text[] = {
|
||||||
"230Hz", "300Hz", "385Hz", "500Hz"
|
"230Hz", "300Hz", "385Hz", "500Hz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq2_bw, WM8985_EQ2_PEAK_1, 8, eq_bw_text);
|
static SOC_ENUM_SINGLE_DECL(eq2_bw, WM8985_EQ2_PEAK_1, 8, eq_bw_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq2_cutoff, WM8985_EQ2_PEAK_1, 5,
|
static SOC_ENUM_SINGLE_DECL(eq2_cutoff, WM8985_EQ2_PEAK_1, 5, eq2_cutoff_text);
|
||||||
eq2_cutoff_text);
|
|
||||||
static const char *eq3_cutoff_text[] = {
|
static const char *eq3_cutoff_text[] = {
|
||||||
"650Hz", "850Hz", "1.1kHz", "1.4kHz"
|
"650Hz", "850Hz", "1.1kHz", "1.4kHz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq3_bw, WM8985_EQ3_PEAK_2, 8, eq_bw_text);
|
static SOC_ENUM_SINGLE_DECL(eq3_bw, WM8985_EQ3_PEAK_2, 8, eq_bw_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq3_cutoff, WM8985_EQ3_PEAK_2, 5,
|
static SOC_ENUM_SINGLE_DECL(eq3_cutoff, WM8985_EQ3_PEAK_2, 5,
|
||||||
eq3_cutoff_text);
|
eq3_cutoff_text);
|
||||||
static const char *eq4_cutoff_text[] = {
|
static const char *eq4_cutoff_text[] = {
|
||||||
"1.8kHz", "2.4kHz", "3.2kHz", "4.1kHz"
|
"1.8kHz", "2.4kHz", "3.2kHz", "4.1kHz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq4_bw, WM8985_EQ4_PEAK_3, 8, eq_bw_text);
|
static SOC_ENUM_SINGLE_DECL(eq4_bw, WM8985_EQ4_PEAK_3, 8, eq_bw_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq4_cutoff, WM8985_EQ4_PEAK_3, 5,
|
static SOC_ENUM_SINGLE_DECL(eq4_cutoff, WM8985_EQ4_PEAK_3, 5, eq4_cutoff_text);
|
||||||
eq4_cutoff_text);
|
|
||||||
static const char *eq5_cutoff_text[] = {
|
static const char *eq5_cutoff_text[] = {
|
||||||
"5.3kHz", "6.9kHz", "9kHz", "11.7kHz"
|
"5.3kHz", "6.9kHz", "9kHz", "11.7kHz"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(eq5_cutoff, WM8985_EQ5_HIGH_SHELF, 5,
|
static SOC_ENUM_SINGLE_DECL(eq5_cutoff, WM8985_EQ5_HIGH_SHELF, 5,
|
||||||
eq5_cutoff_text);
|
eq5_cutoff_text);
|
||||||
|
|
||||||
static const char *speaker_mode_text[] = { "Class A/B", "Class D" };
|
static const char *speaker_mode_text[] = { "Class A/B", "Class D" };
|
||||||
static const SOC_ENUM_SINGLE_DECL(speaker_mode, 0x17, 8, speaker_mode_text);
|
static SOC_ENUM_SINGLE_DECL(speaker_mode, 0x17, 8, speaker_mode_text);
|
||||||
|
|
||||||
static const char *depth_3d_text[] = {
|
static const char *depth_3d_text[] = {
|
||||||
"Off",
|
"Off",
|
||||||
|
@ -291,8 +287,7 @@ static const char *depth_3d_text[] = {
|
||||||
"93.3%",
|
"93.3%",
|
||||||
"100%"
|
"100%"
|
||||||
};
|
};
|
||||||
static const SOC_ENUM_SINGLE_DECL(depth_3d, WM8985_3D_CONTROL, 0,
|
static SOC_ENUM_SINGLE_DECL(depth_3d, WM8985_3D_CONTROL, 0, depth_3d_text);
|
||||||
depth_3d_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new wm8985_snd_controls[] = {
|
static const struct snd_kcontrol_new wm8985_snd_controls[] = {
|
||||||
SOC_SINGLE("Digital Loopback Switch", WM8985_COMPANDING_CONTROL,
|
SOC_SINGLE("Digital Loopback Switch", WM8985_COMPANDING_CONTROL,
|
||||||
|
|
|
@ -1344,8 +1344,7 @@ static const char *adc_mux_text[] = {
|
||||||
"DMIC",
|
"DMIC",
|
||||||
};
|
};
|
||||||
|
|
||||||
static SOC_ENUM_SINGLE_DECL(adc_enum,
|
static SOC_ENUM_SINGLE_VIRT_DECL(adc_enum, adc_mux_text);
|
||||||
0, 0, adc_mux_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new adcl_mux =
|
static const struct snd_kcontrol_new adcl_mux =
|
||||||
SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum);
|
SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum);
|
||||||
|
@ -3251,7 +3250,7 @@ static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994)
|
||||||
dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
|
dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
|
||||||
wm8994->num_retune_mobile_texts);
|
wm8994->num_retune_mobile_texts);
|
||||||
|
|
||||||
wm8994->retune_mobile_enum.max = wm8994->num_retune_mobile_texts;
|
wm8994->retune_mobile_enum.items = wm8994->num_retune_mobile_texts;
|
||||||
wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts;
|
wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(wm8994->hubs.codec, controls,
|
ret = snd_soc_add_codec_controls(wm8994->hubs.codec, controls,
|
||||||
|
@ -3307,7 +3306,7 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
|
||||||
for (i = 0; i < pdata->num_drc_cfgs; i++)
|
for (i = 0; i < pdata->num_drc_cfgs; i++)
|
||||||
wm8994->drc_texts[i] = pdata->drc_cfgs[i].name;
|
wm8994->drc_texts[i] = pdata->drc_cfgs[i].name;
|
||||||
|
|
||||||
wm8994->drc_enum.max = pdata->num_drc_cfgs;
|
wm8994->drc_enum.items = pdata->num_drc_cfgs;
|
||||||
wm8994->drc_enum.texts = wm8994->drc_texts;
|
wm8994->drc_enum.texts = wm8994->drc_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(wm8994->hubs.codec, controls,
|
ret = snd_soc_add_codec_controls(wm8994->hubs.codec, controls,
|
||||||
|
|
|
@ -423,23 +423,23 @@ static const char *in1l_text[] = {
|
||||||
"Differential", "Single-ended IN1LN", "Single-ended IN1LP"
|
"Differential", "Single-ended IN1LN", "Single-ended IN1LP"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(in1l_enum, WM8995_LEFT_LINE_INPUT_CONTROL,
|
static SOC_ENUM_SINGLE_DECL(in1l_enum, WM8995_LEFT_LINE_INPUT_CONTROL,
|
||||||
2, in1l_text);
|
2, in1l_text);
|
||||||
|
|
||||||
static const char *in1r_text[] = {
|
static const char *in1r_text[] = {
|
||||||
"Differential", "Single-ended IN1RN", "Single-ended IN1RP"
|
"Differential", "Single-ended IN1RN", "Single-ended IN1RP"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(in1r_enum, WM8995_LEFT_LINE_INPUT_CONTROL,
|
static SOC_ENUM_SINGLE_DECL(in1r_enum, WM8995_LEFT_LINE_INPUT_CONTROL,
|
||||||
0, in1r_text);
|
0, in1r_text);
|
||||||
|
|
||||||
static const char *dmic_src_text[] = {
|
static const char *dmic_src_text[] = {
|
||||||
"DMICDAT1", "DMICDAT2", "DMICDAT3"
|
"DMICDAT1", "DMICDAT2", "DMICDAT3"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(dmic_src1_enum, WM8995_POWER_MANAGEMENT_5,
|
static SOC_ENUM_SINGLE_DECL(dmic_src1_enum, WM8995_POWER_MANAGEMENT_5,
|
||||||
8, dmic_src_text);
|
8, dmic_src_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(dmic_src2_enum, WM8995_POWER_MANAGEMENT_5,
|
static SOC_ENUM_SINGLE_DECL(dmic_src2_enum, WM8995_POWER_MANAGEMENT_5,
|
||||||
6, dmic_src_text);
|
6, dmic_src_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new wm8995_snd_controls[] = {
|
static const struct snd_kcontrol_new wm8995_snd_controls[] = {
|
||||||
|
@ -561,10 +561,8 @@ static int hp_supply_event(struct snd_soc_dapm_widget *w,
|
||||||
struct snd_kcontrol *kcontrol, int event)
|
struct snd_kcontrol *kcontrol, int event)
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec;
|
struct snd_soc_codec *codec;
|
||||||
struct wm8995_priv *wm8995;
|
|
||||||
|
|
||||||
codec = w->codec;
|
codec = w->codec;
|
||||||
wm8995 = snd_soc_codec_get_drvdata(codec);
|
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case SND_SOC_DAPM_PRE_PMU:
|
case SND_SOC_DAPM_PRE_PMU:
|
||||||
|
@ -783,14 +781,12 @@ static const char *sidetone_text[] = {
|
||||||
"ADC/DMIC1", "DMIC2",
|
"ADC/DMIC1", "DMIC2",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct soc_enum sidetone1_enum =
|
static SOC_ENUM_SINGLE_DECL(sidetone1_enum, WM8995_SIDETONE, 0, sidetone_text);
|
||||||
SOC_ENUM_SINGLE(WM8995_SIDETONE, 0, 2, sidetone_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new sidetone1_mux =
|
static const struct snd_kcontrol_new sidetone1_mux =
|
||||||
SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum);
|
SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum);
|
||||||
|
|
||||||
static const struct soc_enum sidetone2_enum =
|
static SOC_ENUM_SINGLE_DECL(sidetone2_enum, WM8995_SIDETONE, 1, sidetone_text);
|
||||||
SOC_ENUM_SINGLE(WM8995_SIDETONE, 1, 2, sidetone_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new sidetone2_mux =
|
static const struct snd_kcontrol_new sidetone2_mux =
|
||||||
SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum);
|
SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum);
|
||||||
|
@ -886,8 +882,7 @@ static const char *adc_mux_text[] = {
|
||||||
"DMIC",
|
"DMIC",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct soc_enum adc_enum =
|
static SOC_ENUM_SINGLE_VIRT_DECL(adc_enum, adc_mux_text);
|
||||||
SOC_ENUM_SINGLE(0, 0, 2, adc_mux_text);
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new adcl_mux =
|
static const struct snd_kcontrol_new adcl_mux =
|
||||||
SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum);
|
SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum);
|
||||||
|
@ -899,13 +894,13 @@ static const char *spk_src_text[] = {
|
||||||
"DAC1L", "DAC1R", "DAC2L", "DAC2R"
|
"DAC1L", "DAC1R", "DAC2L", "DAC2R"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SOC_ENUM_SINGLE_DECL(spk1l_src_enum, WM8995_LEFT_PDM_SPEAKER_1,
|
static SOC_ENUM_SINGLE_DECL(spk1l_src_enum, WM8995_LEFT_PDM_SPEAKER_1,
|
||||||
0, spk_src_text);
|
0, spk_src_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(spk1r_src_enum, WM8995_RIGHT_PDM_SPEAKER_1,
|
static SOC_ENUM_SINGLE_DECL(spk1r_src_enum, WM8995_RIGHT_PDM_SPEAKER_1,
|
||||||
0, spk_src_text);
|
0, spk_src_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(spk2l_src_enum, WM8995_LEFT_PDM_SPEAKER_2,
|
static SOC_ENUM_SINGLE_DECL(spk2l_src_enum, WM8995_LEFT_PDM_SPEAKER_2,
|
||||||
0, spk_src_text);
|
0, spk_src_text);
|
||||||
static const SOC_ENUM_SINGLE_DECL(spk2r_src_enum, WM8995_RIGHT_PDM_SPEAKER_2,
|
static SOC_ENUM_SINGLE_DECL(spk2r_src_enum, WM8995_RIGHT_PDM_SPEAKER_2,
|
||||||
0, spk_src_text);
|
0, spk_src_text);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new spk1l_mux =
|
static const struct snd_kcontrol_new spk1l_mux =
|
||||||
|
|
|
@ -2600,7 +2600,7 @@ static void wm8996_retune_mobile_pdata(struct snd_soc_codec *codec)
|
||||||
dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
|
dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
|
||||||
wm8996->num_retune_mobile_texts);
|
wm8996->num_retune_mobile_texts);
|
||||||
|
|
||||||
wm8996->retune_mobile_enum.max = wm8996->num_retune_mobile_texts;
|
wm8996->retune_mobile_enum.items = wm8996->num_retune_mobile_texts;
|
||||||
wm8996->retune_mobile_enum.texts = wm8996->retune_mobile_texts;
|
wm8996->retune_mobile_enum.texts = wm8996->retune_mobile_texts;
|
||||||
|
|
||||||
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
||||||
|
|
|
@ -103,7 +103,7 @@ static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol,
|
||||||
if (!codec->hw_write)
|
if (!codec->hw_write)
|
||||||
return -EUNATCH;
|
return -EUNATCH;
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] >= control->max)
|
if (ucontrol->value.enumerated.item[0] >= control->items)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
snd_soc_dapm_mutex_lock(dapm);
|
snd_soc_dapm_mutex_lock(dapm);
|
||||||
|
|
|
@ -2572,10 +2572,10 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
|
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
||||||
uinfo->count = e->shift_l == e->shift_r ? 1 : 2;
|
uinfo->count = e->shift_l == e->shift_r ? 1 : 2;
|
||||||
uinfo->value.enumerated.items = e->max;
|
uinfo->value.enumerated.items = e->items;
|
||||||
|
|
||||||
if (uinfo->value.enumerated.item > e->max - 1)
|
if (uinfo->value.enumerated.item >= e->items)
|
||||||
uinfo->value.enumerated.item = e->max - 1;
|
uinfo->value.enumerated.item = e->items - 1;
|
||||||
strlcpy(uinfo->value.enumerated.name,
|
strlcpy(uinfo->value.enumerated.name,
|
||||||
e->texts[uinfo->value.enumerated.item],
|
e->texts[uinfo->value.enumerated.item],
|
||||||
sizeof(uinfo->value.enumerated.name));
|
sizeof(uinfo->value.enumerated.name));
|
||||||
|
@ -2597,14 +2597,18 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||||
unsigned int val;
|
unsigned int val, item;
|
||||||
|
unsigned int reg_val;
|
||||||
|
|
||||||
val = snd_soc_read(codec, e->reg);
|
reg_val = snd_soc_read(codec, e->reg);
|
||||||
ucontrol->value.enumerated.item[0]
|
val = (reg_val >> e->shift_l) & e->mask;
|
||||||
= (val >> e->shift_l) & e->mask;
|
item = snd_soc_enum_val_to_item(e, val);
|
||||||
if (e->shift_l != e->shift_r)
|
ucontrol->value.enumerated.item[0] = item;
|
||||||
ucontrol->value.enumerated.item[1] =
|
if (e->shift_l != e->shift_r) {
|
||||||
(val >> e->shift_r) & e->mask;
|
val = (reg_val >> e->shift_l) & e->mask;
|
||||||
|
item = snd_soc_enum_val_to_item(e, val);
|
||||||
|
ucontrol->value.enumerated.item[1] = item;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2624,17 +2628,18 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||||
|
unsigned int *item = ucontrol->value.enumerated.item;
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > e->max - 1)
|
if (item[0] >= e->items)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
val = ucontrol->value.enumerated.item[0] << e->shift_l;
|
val = snd_soc_enum_item_to_val(e, item[0]) << e->shift_l;
|
||||||
mask = e->mask << e->shift_l;
|
mask = e->mask << e->shift_l;
|
||||||
if (e->shift_l != e->shift_r) {
|
if (e->shift_l != e->shift_r) {
|
||||||
if (ucontrol->value.enumerated.item[1] > e->max - 1)
|
if (item[1] >= e->items)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
val |= ucontrol->value.enumerated.item[1] << e->shift_r;
|
val |= snd_soc_enum_item_to_val(e, item[1]) << e->shift_r;
|
||||||
mask |= e->mask << e->shift_r;
|
mask |= e->mask << e->shift_r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2643,78 +2648,46 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_put_enum_double);
|
EXPORT_SYMBOL_GPL(snd_soc_put_enum_double);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* snd_soc_get_value_enum_double - semi enumerated double mixer get callback
|
* snd_soc_read_signed - Read a codec register and interprete as signed value
|
||||||
* @kcontrol: mixer control
|
* @codec: codec
|
||||||
* @ucontrol: control element information
|
* @reg: Register to read
|
||||||
|
* @mask: Mask to use after shifting the register value
|
||||||
|
* @shift: Right shift of register value
|
||||||
|
* @sign_bit: Bit that describes if a number is negative or not.
|
||||||
*
|
*
|
||||||
* Callback to get the value of a double semi enumerated mixer.
|
* This functions reads a codec register. The register value is shifted right
|
||||||
|
* by 'shift' bits and masked with the given 'mask'. Afterwards it translates
|
||||||
|
* the given registervalue into a signed integer if sign_bit is non-zero.
|
||||||
*
|
*
|
||||||
* Semi enumerated mixer: the enumerated items are referred as values. Can be
|
* Returns the register value as signed int.
|
||||||
* used for handling bitfield coded enumeration for example.
|
|
||||||
*
|
|
||||||
* Returns 0 for success.
|
|
||||||
*/
|
*/
|
||||||
int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol,
|
static int snd_soc_read_signed(struct snd_soc_codec *codec, unsigned int reg,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
unsigned int mask, unsigned int shift, unsigned int sign_bit)
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
int ret;
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
||||||
unsigned int reg_val, val, mux;
|
|
||||||
|
|
||||||
reg_val = snd_soc_read(codec, e->reg);
|
|
||||||
val = (reg_val >> e->shift_l) & e->mask;
|
|
||||||
for (mux = 0; mux < e->max; mux++) {
|
|
||||||
if (val == e->values[mux])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ucontrol->value.enumerated.item[0] = mux;
|
|
||||||
if (e->shift_l != e->shift_r) {
|
|
||||||
val = (reg_val >> e->shift_r) & e->mask;
|
|
||||||
for (mux = 0; mux < e->max; mux++) {
|
|
||||||
if (val == e->values[mux])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ucontrol->value.enumerated.item[1] = mux;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_get_value_enum_double);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* snd_soc_put_value_enum_double - semi enumerated double mixer put callback
|
|
||||||
* @kcontrol: mixer control
|
|
||||||
* @ucontrol: control element information
|
|
||||||
*
|
|
||||||
* Callback to set the value of a double semi enumerated mixer.
|
|
||||||
*
|
|
||||||
* Semi enumerated mixer: the enumerated items are referred as values. Can be
|
|
||||||
* used for handling bitfield coded enumeration for example.
|
|
||||||
*
|
|
||||||
* Returns 0 for success.
|
|
||||||
*/
|
|
||||||
int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
unsigned int mask;
|
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > e->max - 1)
|
val = (snd_soc_read(codec, reg) >> shift) & mask;
|
||||||
return -EINVAL;
|
|
||||||
val = e->values[ucontrol->value.enumerated.item[0]] << e->shift_l;
|
|
||||||
mask = e->mask << e->shift_l;
|
|
||||||
if (e->shift_l != e->shift_r) {
|
|
||||||
if (ucontrol->value.enumerated.item[1] > e->max - 1)
|
|
||||||
return -EINVAL;
|
|
||||||
val |= e->values[ucontrol->value.enumerated.item[1]] << e->shift_r;
|
|
||||||
mask |= e->mask << e->shift_r;
|
|
||||||
}
|
|
||||||
|
|
||||||
return snd_soc_update_bits_locked(codec, e->reg, mask, val);
|
if (!sign_bit)
|
||||||
|
return val;
|
||||||
|
|
||||||
|
/* non-negative number */
|
||||||
|
if (!(val & BIT(sign_bit)))
|
||||||
|
return val;
|
||||||
|
|
||||||
|
ret = val;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The register most probably does not contain a full-sized int.
|
||||||
|
* Instead we have an arbitrary number of bits in a signed
|
||||||
|
* representation which has to be translated into a full-sized int.
|
||||||
|
* This is done by filling up all bits above the sign-bit.
|
||||||
|
*/
|
||||||
|
ret |= ~((int)(BIT(sign_bit) - 1));
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_put_value_enum_double);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* snd_soc_info_volsw - single mixer info callback
|
* snd_soc_info_volsw - single mixer info callback
|
||||||
|
@ -2744,7 +2717,7 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
|
||||||
|
|
||||||
uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
|
uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
|
||||||
uinfo->value.integer.min = 0;
|
uinfo->value.integer.min = 0;
|
||||||
uinfo->value.integer.max = platform_max;
|
uinfo->value.integer.max = platform_max - mc->min;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_info_volsw);
|
EXPORT_SYMBOL_GPL(snd_soc_info_volsw);
|
||||||
|
@ -2770,11 +2743,16 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
|
||||||
unsigned int shift = mc->shift;
|
unsigned int shift = mc->shift;
|
||||||
unsigned int rshift = mc->rshift;
|
unsigned int rshift = mc->rshift;
|
||||||
int max = mc->max;
|
int max = mc->max;
|
||||||
|
int min = mc->min;
|
||||||
|
int sign_bit = mc->sign_bit;
|
||||||
unsigned int mask = (1 << fls(max)) - 1;
|
unsigned int mask = (1 << fls(max)) - 1;
|
||||||
unsigned int invert = mc->invert;
|
unsigned int invert = mc->invert;
|
||||||
|
|
||||||
ucontrol->value.integer.value[0] =
|
if (sign_bit)
|
||||||
(snd_soc_read(codec, reg) >> shift) & mask;
|
mask = BIT(sign_bit + 1) - 1;
|
||||||
|
|
||||||
|
ucontrol->value.integer.value[0] = snd_soc_read_signed(codec, reg, mask,
|
||||||
|
shift, sign_bit) - min;
|
||||||
if (invert)
|
if (invert)
|
||||||
ucontrol->value.integer.value[0] =
|
ucontrol->value.integer.value[0] =
|
||||||
max - ucontrol->value.integer.value[0];
|
max - ucontrol->value.integer.value[0];
|
||||||
|
@ -2782,10 +2760,12 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
|
||||||
if (snd_soc_volsw_is_stereo(mc)) {
|
if (snd_soc_volsw_is_stereo(mc)) {
|
||||||
if (reg == reg2)
|
if (reg == reg2)
|
||||||
ucontrol->value.integer.value[1] =
|
ucontrol->value.integer.value[1] =
|
||||||
(snd_soc_read(codec, reg) >> rshift) & mask;
|
snd_soc_read_signed(codec, reg, mask, rshift,
|
||||||
|
sign_bit) - min;
|
||||||
else
|
else
|
||||||
ucontrol->value.integer.value[1] =
|
ucontrol->value.integer.value[1] =
|
||||||
(snd_soc_read(codec, reg2) >> shift) & mask;
|
snd_soc_read_signed(codec, reg2, mask, shift,
|
||||||
|
sign_bit) - min;
|
||||||
if (invert)
|
if (invert)
|
||||||
ucontrol->value.integer.value[1] =
|
ucontrol->value.integer.value[1] =
|
||||||
max - ucontrol->value.integer.value[1];
|
max - ucontrol->value.integer.value[1];
|
||||||
|
@ -2816,6 +2796,8 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
|
||||||
unsigned int shift = mc->shift;
|
unsigned int shift = mc->shift;
|
||||||
unsigned int rshift = mc->rshift;
|
unsigned int rshift = mc->rshift;
|
||||||
int max = mc->max;
|
int max = mc->max;
|
||||||
|
int min = mc->min;
|
||||||
|
unsigned int sign_bit = mc->sign_bit;
|
||||||
unsigned int mask = (1 << fls(max)) - 1;
|
unsigned int mask = (1 << fls(max)) - 1;
|
||||||
unsigned int invert = mc->invert;
|
unsigned int invert = mc->invert;
|
||||||
int err;
|
int err;
|
||||||
|
@ -2823,13 +2805,16 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
|
||||||
unsigned int val2 = 0;
|
unsigned int val2 = 0;
|
||||||
unsigned int val, val_mask;
|
unsigned int val, val_mask;
|
||||||
|
|
||||||
val = (ucontrol->value.integer.value[0] & mask);
|
if (sign_bit)
|
||||||
|
mask = BIT(sign_bit + 1) - 1;
|
||||||
|
|
||||||
|
val = ((ucontrol->value.integer.value[0] + min) & mask);
|
||||||
if (invert)
|
if (invert)
|
||||||
val = max - val;
|
val = max - val;
|
||||||
val_mask = mask << shift;
|
val_mask = mask << shift;
|
||||||
val = val << shift;
|
val = val << shift;
|
||||||
if (snd_soc_volsw_is_stereo(mc)) {
|
if (snd_soc_volsw_is_stereo(mc)) {
|
||||||
val2 = (ucontrol->value.integer.value[1] & mask);
|
val2 = ((ucontrol->value.integer.value[1] + min) & mask);
|
||||||
if (invert)
|
if (invert)
|
||||||
val2 = max - val2;
|
val2 = max - val2;
|
||||||
if (reg == reg2) {
|
if (reg == reg2) {
|
||||||
|
|
|
@ -70,8 +70,6 @@ static int dapm_up_seq[] = {
|
||||||
[snd_soc_dapm_aif_out] = 4,
|
[snd_soc_dapm_aif_out] = 4,
|
||||||
[snd_soc_dapm_mic] = 5,
|
[snd_soc_dapm_mic] = 5,
|
||||||
[snd_soc_dapm_mux] = 6,
|
[snd_soc_dapm_mux] = 6,
|
||||||
[snd_soc_dapm_virt_mux] = 6,
|
|
||||||
[snd_soc_dapm_value_mux] = 6,
|
|
||||||
[snd_soc_dapm_dac] = 7,
|
[snd_soc_dapm_dac] = 7,
|
||||||
[snd_soc_dapm_switch] = 8,
|
[snd_soc_dapm_switch] = 8,
|
||||||
[snd_soc_dapm_mixer] = 8,
|
[snd_soc_dapm_mixer] = 8,
|
||||||
|
@ -102,8 +100,6 @@ static int dapm_down_seq[] = {
|
||||||
[snd_soc_dapm_mic] = 7,
|
[snd_soc_dapm_mic] = 7,
|
||||||
[snd_soc_dapm_micbias] = 8,
|
[snd_soc_dapm_micbias] = 8,
|
||||||
[snd_soc_dapm_mux] = 9,
|
[snd_soc_dapm_mux] = 9,
|
||||||
[snd_soc_dapm_virt_mux] = 9,
|
|
||||||
[snd_soc_dapm_value_mux] = 9,
|
|
||||||
[snd_soc_dapm_aif_in] = 10,
|
[snd_soc_dapm_aif_in] = 10,
|
||||||
[snd_soc_dapm_aif_out] = 10,
|
[snd_soc_dapm_aif_out] = 10,
|
||||||
[snd_soc_dapm_dai_in] = 10,
|
[snd_soc_dapm_dai_in] = 10,
|
||||||
|
@ -508,22 +504,59 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* connect mux widget to its interconnecting audio paths */
|
||||||
|
static int dapm_connect_mux(struct snd_soc_dapm_context *dapm,
|
||||||
|
struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest,
|
||||||
|
struct snd_soc_dapm_path *path, const char *control_name,
|
||||||
|
const struct snd_kcontrol_new *kcontrol)
|
||||||
|
{
|
||||||
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||||
|
unsigned int val, item;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (e->reg != SND_SOC_NOPM) {
|
||||||
|
soc_widget_read(dest, e->reg, &val);
|
||||||
|
val = (val >> e->shift_l) & e->mask;
|
||||||
|
item = snd_soc_enum_val_to_item(e, val);
|
||||||
|
} else {
|
||||||
|
/* since a virtual mux has no backing registers to
|
||||||
|
* decide which path to connect, it will try to match
|
||||||
|
* with the first enumeration. This is to ensure
|
||||||
|
* that the default mux choice (the first) will be
|
||||||
|
* correctly powered up during initialization.
|
||||||
|
*/
|
||||||
|
item = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < e->items; i++) {
|
||||||
|
if (!(strcmp(control_name, e->texts[i]))) {
|
||||||
|
list_add(&path->list, &dapm->card->paths);
|
||||||
|
list_add(&path->list_sink, &dest->sources);
|
||||||
|
list_add(&path->list_source, &src->sinks);
|
||||||
|
path->name = (char*)e->texts[i];
|
||||||
|
if (i == item)
|
||||||
|
path->connect = 1;
|
||||||
|
else
|
||||||
|
path->connect = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
/* set up initial codec paths */
|
/* set up initial codec paths */
|
||||||
static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
|
static void dapm_set_mixer_path_status(struct snd_soc_dapm_widget *w,
|
||||||
struct snd_soc_dapm_path *p, int i)
|
struct snd_soc_dapm_path *p, int i)
|
||||||
{
|
{
|
||||||
switch (w->id) {
|
|
||||||
case snd_soc_dapm_switch:
|
|
||||||
case snd_soc_dapm_mixer:
|
|
||||||
case snd_soc_dapm_mixer_named_ctl: {
|
|
||||||
unsigned int val;
|
|
||||||
struct soc_mixer_control *mc = (struct soc_mixer_control *)
|
struct soc_mixer_control *mc = (struct soc_mixer_control *)
|
||||||
w->kcontrol_news[i].private_value;
|
w->kcontrol_news[i].private_value;
|
||||||
int reg = mc->reg;
|
unsigned int reg = mc->reg;
|
||||||
unsigned int shift = mc->shift;
|
unsigned int shift = mc->shift;
|
||||||
int max = mc->max;
|
unsigned int max = mc->max;
|
||||||
unsigned int mask = (1 << fls(max)) - 1;
|
unsigned int mask = (1 << fls(max)) - 1;
|
||||||
unsigned int invert = mc->invert;
|
unsigned int invert = mc->invert;
|
||||||
|
unsigned int val;
|
||||||
|
|
||||||
if (reg != SND_SOC_NOPM) {
|
if (reg != SND_SOC_NOPM) {
|
||||||
soc_widget_read(w, reg, &val);
|
soc_widget_read(w, reg, &val);
|
||||||
|
@ -534,110 +567,6 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
|
||||||
} else {
|
} else {
|
||||||
p->connect = 0;
|
p->connect = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case snd_soc_dapm_mux: {
|
|
||||||
struct soc_enum *e = (struct soc_enum *)
|
|
||||||
w->kcontrol_news[i].private_value;
|
|
||||||
unsigned int val, item;
|
|
||||||
|
|
||||||
soc_widget_read(w, e->reg, &val);
|
|
||||||
item = (val >> e->shift_l) & e->mask;
|
|
||||||
|
|
||||||
if (item < e->max && !strcmp(p->name, e->texts[item]))
|
|
||||||
p->connect = 1;
|
|
||||||
else
|
|
||||||
p->connect = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case snd_soc_dapm_virt_mux: {
|
|
||||||
struct soc_enum *e = (struct soc_enum *)
|
|
||||||
w->kcontrol_news[i].private_value;
|
|
||||||
|
|
||||||
p->connect = 0;
|
|
||||||
/* since a virtual mux has no backing registers to
|
|
||||||
* decide which path to connect, it will try to match
|
|
||||||
* with the first enumeration. This is to ensure
|
|
||||||
* that the default mux choice (the first) will be
|
|
||||||
* correctly powered up during initialization.
|
|
||||||
*/
|
|
||||||
if (!strcmp(p->name, e->texts[0]))
|
|
||||||
p->connect = 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case snd_soc_dapm_value_mux: {
|
|
||||||
struct soc_enum *e = (struct soc_enum *)
|
|
||||||
w->kcontrol_news[i].private_value;
|
|
||||||
unsigned int val, item;
|
|
||||||
|
|
||||||
soc_widget_read(w, e->reg, &val);
|
|
||||||
val = (val >> e->shift_l) & e->mask;
|
|
||||||
for (item = 0; item < e->max; item++) {
|
|
||||||
if (val == e->values[item])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item < e->max && !strcmp(p->name, e->texts[item]))
|
|
||||||
p->connect = 1;
|
|
||||||
else
|
|
||||||
p->connect = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
/* does not affect routing - always connected */
|
|
||||||
case snd_soc_dapm_pga:
|
|
||||||
case snd_soc_dapm_out_drv:
|
|
||||||
case snd_soc_dapm_output:
|
|
||||||
case snd_soc_dapm_adc:
|
|
||||||
case snd_soc_dapm_input:
|
|
||||||
case snd_soc_dapm_siggen:
|
|
||||||
case snd_soc_dapm_dac:
|
|
||||||
case snd_soc_dapm_micbias:
|
|
||||||
case snd_soc_dapm_vmid:
|
|
||||||
case snd_soc_dapm_supply:
|
|
||||||
case snd_soc_dapm_regulator_supply:
|
|
||||||
case snd_soc_dapm_clock_supply:
|
|
||||||
case snd_soc_dapm_aif_in:
|
|
||||||
case snd_soc_dapm_aif_out:
|
|
||||||
case snd_soc_dapm_dai_in:
|
|
||||||
case snd_soc_dapm_dai_out:
|
|
||||||
case snd_soc_dapm_hp:
|
|
||||||
case snd_soc_dapm_mic:
|
|
||||||
case snd_soc_dapm_spk:
|
|
||||||
case snd_soc_dapm_line:
|
|
||||||
case snd_soc_dapm_dai_link:
|
|
||||||
case snd_soc_dapm_kcontrol:
|
|
||||||
p->connect = 1;
|
|
||||||
break;
|
|
||||||
/* does affect routing - dynamically connected */
|
|
||||||
case snd_soc_dapm_pre:
|
|
||||||
case snd_soc_dapm_post:
|
|
||||||
p->connect = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* connect mux widget to its interconnecting audio paths */
|
|
||||||
static int dapm_connect_mux(struct snd_soc_dapm_context *dapm,
|
|
||||||
struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest,
|
|
||||||
struct snd_soc_dapm_path *path, const char *control_name,
|
|
||||||
const struct snd_kcontrol_new *kcontrol)
|
|
||||||
{
|
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < e->max; i++) {
|
|
||||||
if (!(strcmp(control_name, e->texts[i]))) {
|
|
||||||
list_add(&path->list, &dapm->card->paths);
|
|
||||||
list_add(&path->list_sink, &dest->sources);
|
|
||||||
list_add(&path->list_source, &src->sinks);
|
|
||||||
path->name = (char*)e->texts[i];
|
|
||||||
dapm_set_path_status(dest, path, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* connect mixer widget to its interconnecting audio paths */
|
/* connect mixer widget to its interconnecting audio paths */
|
||||||
|
@ -654,7 +583,7 @@ static int dapm_connect_mixer(struct snd_soc_dapm_context *dapm,
|
||||||
list_add(&path->list_sink, &dest->sources);
|
list_add(&path->list_sink, &dest->sources);
|
||||||
list_add(&path->list_source, &src->sinks);
|
list_add(&path->list_source, &src->sinks);
|
||||||
path->name = dest->kcontrol_news[i].name;
|
path->name = dest->kcontrol_news[i].name;
|
||||||
dapm_set_path_status(dest, path, i);
|
dapm_set_mixer_path_status(dest, path, i);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -733,8 +662,6 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
|
||||||
kcname_in_long_name = true;
|
kcname_in_long_name = true;
|
||||||
break;
|
break;
|
||||||
case snd_soc_dapm_mux:
|
case snd_soc_dapm_mux:
|
||||||
case snd_soc_dapm_virt_mux:
|
|
||||||
case snd_soc_dapm_value_mux:
|
|
||||||
wname_in_long_name = true;
|
wname_in_long_name = true;
|
||||||
kcname_in_long_name = false;
|
kcname_in_long_name = false;
|
||||||
break;
|
break;
|
||||||
|
@ -2487,8 +2414,6 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
|
||||||
path->connect = 1;
|
path->connect = 1;
|
||||||
return 0;
|
return 0;
|
||||||
case snd_soc_dapm_mux:
|
case snd_soc_dapm_mux:
|
||||||
case snd_soc_dapm_virt_mux:
|
|
||||||
case snd_soc_dapm_value_mux:
|
|
||||||
ret = dapm_connect_mux(dapm, wsource, wsink, path, control,
|
ret = dapm_connect_mux(dapm, wsource, wsink, path, control,
|
||||||
&wsink->kcontrol_news[0]);
|
&wsink->kcontrol_news[0]);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
@ -2815,8 +2740,6 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
|
||||||
dapm_new_mixer(w);
|
dapm_new_mixer(w);
|
||||||
break;
|
break;
|
||||||
case snd_soc_dapm_mux:
|
case snd_soc_dapm_mux:
|
||||||
case snd_soc_dapm_virt_mux:
|
|
||||||
case snd_soc_dapm_value_mux:
|
|
||||||
dapm_new_mux(w);
|
dapm_new_mux(w);
|
||||||
break;
|
break;
|
||||||
case snd_soc_dapm_pga:
|
case snd_soc_dapm_pga:
|
||||||
|
@ -2978,13 +2901,20 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
|
struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||||
unsigned int val;
|
unsigned int reg_val, val;
|
||||||
|
|
||||||
val = snd_soc_read(codec, e->reg);
|
if (e->reg != SND_SOC_NOPM)
|
||||||
ucontrol->value.enumerated.item[0] = (val >> e->shift_l) & e->mask;
|
reg_val = snd_soc_read(codec, e->reg);
|
||||||
if (e->shift_l != e->shift_r)
|
else
|
||||||
ucontrol->value.enumerated.item[1] =
|
reg_val = dapm_kcontrol_get_value(kcontrol);
|
||||||
(val >> e->shift_r) & e->mask;
|
|
||||||
|
val = (reg_val >> e->shift_l) & e->mask;
|
||||||
|
ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(e, val);
|
||||||
|
if (e->shift_l != e->shift_r) {
|
||||||
|
val = (reg_val >> e->shift_r) & e->mask;
|
||||||
|
val = snd_soc_enum_val_to_item(e, val);
|
||||||
|
ucontrol->value.enumerated.item[1] = val;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3005,34 +2935,41 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
|
struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
|
||||||
struct snd_soc_card *card = codec->card;
|
struct snd_soc_card *card = codec->card;
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||||
unsigned int val, mux, change;
|
unsigned int *item = ucontrol->value.enumerated.item;
|
||||||
|
unsigned int val, change;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
struct snd_soc_dapm_update update;
|
struct snd_soc_dapm_update update;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > e->max - 1)
|
if (item[0] >= e->items)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
mux = ucontrol->value.enumerated.item[0];
|
|
||||||
val = mux << e->shift_l;
|
val = snd_soc_enum_item_to_val(e, item[0]) << e->shift_l;
|
||||||
mask = e->mask << e->shift_l;
|
mask = e->mask << e->shift_l;
|
||||||
if (e->shift_l != e->shift_r) {
|
if (e->shift_l != e->shift_r) {
|
||||||
if (ucontrol->value.enumerated.item[1] > e->max - 1)
|
if (item[1] > e->items)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
val |= ucontrol->value.enumerated.item[1] << e->shift_r;
|
val |= snd_soc_enum_item_to_val(e, item[1]) << e->shift_l;
|
||||||
mask |= e->mask << e->shift_r;
|
mask |= e->mask << e->shift_r;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
|
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
|
||||||
|
|
||||||
|
if (e->reg != SND_SOC_NOPM)
|
||||||
change = snd_soc_test_bits(codec, e->reg, mask, val);
|
change = snd_soc_test_bits(codec, e->reg, mask, val);
|
||||||
|
else
|
||||||
|
change = dapm_kcontrol_set_value(kcontrol, val);
|
||||||
|
|
||||||
if (change) {
|
if (change) {
|
||||||
|
if (e->reg != SND_SOC_NOPM) {
|
||||||
update.kcontrol = kcontrol;
|
update.kcontrol = kcontrol;
|
||||||
update.reg = e->reg;
|
update.reg = e->reg;
|
||||||
update.mask = mask;
|
update.mask = mask;
|
||||||
update.val = val;
|
update.val = val;
|
||||||
card->update = &update;
|
card->update = &update;
|
||||||
|
}
|
||||||
|
|
||||||
ret = soc_dapm_mux_update_power(card, kcontrol, mux, e);
|
ret = soc_dapm_mux_update_power(card, kcontrol, item[0], e);
|
||||||
|
|
||||||
card->update = NULL;
|
card->update = NULL;
|
||||||
}
|
}
|
||||||
|
@ -3046,158 +2983,6 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_double);
|
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_double);
|
||||||
|
|
||||||
/**
|
|
||||||
* snd_soc_dapm_get_enum_virt - Get virtual DAPM mux
|
|
||||||
* @kcontrol: mixer control
|
|
||||||
* @ucontrol: control element information
|
|
||||||
*
|
|
||||||
* Returns 0 for success.
|
|
||||||
*/
|
|
||||||
int snd_soc_dapm_get_enum_virt(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
ucontrol->value.enumerated.item[0] = dapm_kcontrol_get_value(kcontrol);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_virt);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* snd_soc_dapm_put_enum_virt - Set virtual DAPM mux
|
|
||||||
* @kcontrol: mixer control
|
|
||||||
* @ucontrol: control element information
|
|
||||||
*
|
|
||||||
* Returns 0 for success.
|
|
||||||
*/
|
|
||||||
int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
|
|
||||||
struct snd_soc_card *card = codec->card;
|
|
||||||
unsigned int value;
|
|
||||||
struct soc_enum *e =
|
|
||||||
(struct soc_enum *)kcontrol->private_value;
|
|
||||||
int change;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] >= e->max)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
|
|
||||||
|
|
||||||
value = ucontrol->value.enumerated.item[0];
|
|
||||||
change = dapm_kcontrol_set_value(kcontrol, value);
|
|
||||||
if (change)
|
|
||||||
ret = soc_dapm_mux_update_power(card, kcontrol, value, e);
|
|
||||||
|
|
||||||
mutex_unlock(&card->dapm_mutex);
|
|
||||||
|
|
||||||
if (ret > 0)
|
|
||||||
soc_dpcm_runtime_update(card);
|
|
||||||
|
|
||||||
return change;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_virt);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* snd_soc_dapm_get_value_enum_double - dapm semi enumerated double mixer get
|
|
||||||
* callback
|
|
||||||
* @kcontrol: mixer control
|
|
||||||
* @ucontrol: control element information
|
|
||||||
*
|
|
||||||
* Callback to get the value of a dapm semi enumerated double mixer control.
|
|
||||||
*
|
|
||||||
* Semi enumerated mixer: the enumerated items are referred as values. Can be
|
|
||||||
* used for handling bitfield coded enumeration for example.
|
|
||||||
*
|
|
||||||
* Returns 0 for success.
|
|
||||||
*/
|
|
||||||
int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
|
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
||||||
unsigned int reg_val, val, mux;
|
|
||||||
|
|
||||||
reg_val = snd_soc_read(codec, e->reg);
|
|
||||||
val = (reg_val >> e->shift_l) & e->mask;
|
|
||||||
for (mux = 0; mux < e->max; mux++) {
|
|
||||||
if (val == e->values[mux])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ucontrol->value.enumerated.item[0] = mux;
|
|
||||||
if (e->shift_l != e->shift_r) {
|
|
||||||
val = (reg_val >> e->shift_r) & e->mask;
|
|
||||||
for (mux = 0; mux < e->max; mux++) {
|
|
||||||
if (val == e->values[mux])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ucontrol->value.enumerated.item[1] = mux;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_dapm_get_value_enum_double);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* snd_soc_dapm_put_value_enum_double - dapm semi enumerated double mixer set
|
|
||||||
* callback
|
|
||||||
* @kcontrol: mixer control
|
|
||||||
* @ucontrol: control element information
|
|
||||||
*
|
|
||||||
* Callback to set the value of a dapm semi enumerated double mixer control.
|
|
||||||
*
|
|
||||||
* Semi enumerated mixer: the enumerated items are referred as values. Can be
|
|
||||||
* used for handling bitfield coded enumeration for example.
|
|
||||||
*
|
|
||||||
* Returns 0 for success.
|
|
||||||
*/
|
|
||||||
int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
|
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
|
||||||
{
|
|
||||||
struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
|
|
||||||
struct snd_soc_card *card = codec->card;
|
|
||||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
||||||
unsigned int val, mux, change;
|
|
||||||
unsigned int mask;
|
|
||||||
struct snd_soc_dapm_update update;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (ucontrol->value.enumerated.item[0] > e->max - 1)
|
|
||||||
return -EINVAL;
|
|
||||||
mux = ucontrol->value.enumerated.item[0];
|
|
||||||
val = e->values[ucontrol->value.enumerated.item[0]] << e->shift_l;
|
|
||||||
mask = e->mask << e->shift_l;
|
|
||||||
if (e->shift_l != e->shift_r) {
|
|
||||||
if (ucontrol->value.enumerated.item[1] > e->max - 1)
|
|
||||||
return -EINVAL;
|
|
||||||
val |= e->values[ucontrol->value.enumerated.item[1]] << e->shift_r;
|
|
||||||
mask |= e->mask << e->shift_r;
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
|
|
||||||
|
|
||||||
change = snd_soc_test_bits(codec, e->reg, mask, val);
|
|
||||||
if (change) {
|
|
||||||
update.kcontrol = kcontrol;
|
|
||||||
update.reg = e->reg;
|
|
||||||
update.mask = mask;
|
|
||||||
update.val = val;
|
|
||||||
card->update = &update;
|
|
||||||
|
|
||||||
ret = soc_dapm_mux_update_power(card, kcontrol, mux, e);
|
|
||||||
|
|
||||||
card->update = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_unlock(&card->dapm_mutex);
|
|
||||||
|
|
||||||
if (ret > 0)
|
|
||||||
soc_dpcm_runtime_update(card);
|
|
||||||
|
|
||||||
return change;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_value_enum_double);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* snd_soc_dapm_info_pin_switch - Info for a pin switch
|
* snd_soc_dapm_info_pin_switch - Info for a pin switch
|
||||||
*
|
*
|
||||||
|
@ -3326,8 +3111,6 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
|
||||||
w->power_check = dapm_generic_check_power;
|
w->power_check = dapm_generic_check_power;
|
||||||
break;
|
break;
|
||||||
case snd_soc_dapm_mux:
|
case snd_soc_dapm_mux:
|
||||||
case snd_soc_dapm_virt_mux:
|
|
||||||
case snd_soc_dapm_value_mux:
|
|
||||||
w->power_check = dapm_generic_check_power;
|
w->power_check = dapm_generic_check_power;
|
||||||
break;
|
break;
|
||||||
case snd_soc_dapm_dai_out:
|
case snd_soc_dapm_dai_out:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue