summaryrefslogtreecommitdiff
path: root/sound/soc/qcom/sc7180.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/qcom/sc7180.c')
-rw-r--r--sound/soc/qcom/sc7180.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/qcom/sc7180.c b/sound/soc/qcom/sc7180.c
index 84b6ac5d2a20..bc5a18883479 100644
--- a/sound/soc/qcom/sc7180.c
+++ b/sound/soc/qcom/sc7180.c
@@ -287,8 +287,9 @@ static int sc7180_qdsp_snd_startup(struct snd_pcm_substream *substream)
static int dmic_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
- struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card);
+ struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
+ struct snd_soc_card *card = snd_soc_dapm_to_card(dapm);
+ struct sc7180_snd_data *data = snd_soc_card_get_drvdata(card);
ucontrol->value.integer.value[0] = data->dmic_switch;
return 0;
@@ -297,8 +298,9 @@ static int dmic_get(struct snd_kcontrol *kcontrol,
static int dmic_set(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
- struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card);
+ struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
+ struct snd_soc_card *card = snd_soc_dapm_to_card(dapm);
+ struct sc7180_snd_data *data = snd_soc_card_get_drvdata(card);
data->dmic_switch = ucontrol->value.integer.value[0];
gpiod_set_value(data->dmic_sel, data->dmic_switch);