Merge "ASoC: add missing switch mixer controls"
This commit is contained in:
commit
ec2c50f78a
1 changed files with 74 additions and 0 deletions
|
@ -64,6 +64,8 @@ static struct cal_type_data *cal_data;
|
|||
|
||||
static int fm_switch_enable;
|
||||
static int hfp_switch_enable;
|
||||
static int int0_mi2s_switch_enable;
|
||||
static int int4_mi2s_switch_enable;
|
||||
static int pri_mi2s_switch_enable;
|
||||
static int sec_mi2s_switch_enable;
|
||||
static int tert_mi2s_switch_enable;
|
||||
|
@ -1692,6 +1694,64 @@ static int msm_routing_put_hfp_switch_mixer(struct snd_kcontrol *kcontrol,
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int msm_routing_get_int0_mi2s_switch_mixer(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = int0_mi2s_switch_enable;
|
||||
pr_debug("%s: INT0 MI2S Switch enable %ld\n", __func__,
|
||||
ucontrol->value.integer.value[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_routing_put_int0_mi2s_switch_mixer(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_dapm_widget_list *wlist =
|
||||
dapm_kcontrol_get_wlist(kcontrol);
|
||||
struct snd_soc_dapm_widget *widget = wlist->widgets[0];
|
||||
struct snd_soc_dapm_update *update = NULL;
|
||||
|
||||
pr_debug("%s: INT0 MI2S Switch enable %ld\n", __func__,
|
||||
ucontrol->value.integer.value[0]);
|
||||
if (ucontrol->value.integer.value[0])
|
||||
snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, 1,
|
||||
update);
|
||||
else
|
||||
snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, 0,
|
||||
update);
|
||||
int0_mi2s_switch_enable = ucontrol->value.integer.value[0];
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int msm_routing_get_int4_mi2s_switch_mixer(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = int4_mi2s_switch_enable;
|
||||
pr_debug("%s: INT4 MI2S Switch enable %ld\n", __func__,
|
||||
ucontrol->value.integer.value[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_routing_put_int4_mi2s_switch_mixer(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_dapm_widget_list *wlist =
|
||||
dapm_kcontrol_get_wlist(kcontrol);
|
||||
struct snd_soc_dapm_widget *widget = wlist->widgets[0];
|
||||
struct snd_soc_dapm_update *update = NULL;
|
||||
|
||||
pr_debug("%s: INT4 MI2S Switch enable %ld\n", __func__,
|
||||
ucontrol->value.integer.value[0]);
|
||||
if (ucontrol->value.integer.value[0])
|
||||
snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, 1,
|
||||
update);
|
||||
else
|
||||
snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, 0,
|
||||
update);
|
||||
int4_mi2s_switch_enable = ucontrol->value.integer.value[0];
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int msm_routing_get_usb_switch_mixer(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
|
@ -7691,6 +7751,16 @@ static const struct snd_kcontrol_new pcm_rx_switch_mixer_controls =
|
|||
0, 1, 0, msm_routing_get_fm_pcmrx_switch_mixer,
|
||||
msm_routing_put_fm_pcmrx_switch_mixer);
|
||||
|
||||
static const struct snd_kcontrol_new int0_mi2s_rx_switch_mixer_controls =
|
||||
SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
|
||||
0, 1, 0, msm_routing_get_int0_mi2s_switch_mixer,
|
||||
msm_routing_put_int0_mi2s_switch_mixer);
|
||||
|
||||
static const struct snd_kcontrol_new int4_mi2s_rx_switch_mixer_controls =
|
||||
SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
|
||||
0, 1, 0, msm_routing_get_int4_mi2s_switch_mixer,
|
||||
msm_routing_put_int4_mi2s_switch_mixer);
|
||||
|
||||
static const struct snd_kcontrol_new pri_mi2s_rx_switch_mixer_controls =
|
||||
SOC_SINGLE_EXT("Switch", SND_SOC_NOPM,
|
||||
0, 1, 0, msm_routing_get_pri_mi2s_switch_mixer,
|
||||
|
@ -9205,6 +9275,10 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
|
|||
&slim6_fm_switch_mixer_controls),
|
||||
SND_SOC_DAPM_SWITCH("PCM_RX_DL_HL", SND_SOC_NOPM, 0, 0,
|
||||
&pcm_rx_switch_mixer_controls),
|
||||
SND_SOC_DAPM_SWITCH("INT0_MI2S_RX_DL_HL", SND_SOC_NOPM, 0, 0,
|
||||
&int0_mi2s_rx_switch_mixer_controls),
|
||||
SND_SOC_DAPM_SWITCH("INT4_MI2S_RX_DL_HL", SND_SOC_NOPM, 0, 0,
|
||||
&int4_mi2s_rx_switch_mixer_controls),
|
||||
SND_SOC_DAPM_SWITCH("PRI_MI2S_RX_DL_HL", SND_SOC_NOPM, 0, 0,
|
||||
&pri_mi2s_rx_switch_mixer_controls),
|
||||
SND_SOC_DAPM_SWITCH("SEC_MI2S_RX_DL_HL", SND_SOC_NOPM, 0, 0,
|
||||
|
|
Loading…
Add table
Reference in a new issue