diff options
Diffstat (limited to 'sound/soc/codecs/wcd934x.c')
| -rw-r--r-- | sound/soc/codecs/wcd934x.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index 3c22f7149af8..c8db33f78a1b 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -2909,7 +2909,7 @@ static const struct wcd_mbhc_cb mbhc_cb = { static int wcd934x_get_hph_type(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct wcd934x_codec *wcd = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = wcd_mbhc_get_hph_type(wcd->mbhc); @@ -2923,7 +2923,7 @@ static int wcd934x_hph_impedance_get(struct snd_kcontrol *kcontrol, uint32_t zl, zr; bool hphr; struct soc_mixer_control *mc; - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct wcd934x_codec *wcd = snd_soc_component_get_drvdata(component); mc = (struct soc_mixer_control *)(kcontrol->private_value); @@ -3102,8 +3102,7 @@ static int wcd934x_put_iir_band_audio_mixer( struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = - snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct wcd_iir_filter_ctl *ctl = (struct wcd_iir_filter_ctl *)kcontrol->private_value; struct soc_bytes_ext *params = &ctl->bytes_ext; @@ -3131,8 +3130,7 @@ static int wcd934x_put_iir_band_audio_mixer( static int wcd934x_get_iir_band_audio_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = - snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct wcd_iir_filter_ctl *ctl = (struct wcd_iir_filter_ctl *)kcontrol->private_value; struct soc_bytes_ext *params = &ctl->bytes_ext; @@ -3167,7 +3165,7 @@ static int wcd934x_iir_filter_info(struct snd_kcontrol *kcontrol, static int wcd934x_compander_get(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = snd_soc_kcontrol_component(kc); + struct snd_soc_component *component = snd_kcontrol_chip(kc); int comp = ((struct soc_mixer_control *)kc->private_value)->shift; struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); @@ -3179,7 +3177,7 @@ static int wcd934x_compander_get(struct snd_kcontrol *kc, static int wcd934x_compander_set(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = snd_soc_kcontrol_component(kc); + struct snd_soc_component *component = snd_kcontrol_chip(kc); struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); int comp = ((struct soc_mixer_control *)kc->private_value)->shift; int value = ucontrol->value.integer.value[0]; @@ -3220,7 +3218,7 @@ static int wcd934x_compander_set(struct snd_kcontrol *kc, static int wcd934x_rx_hph_mode_get(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = snd_soc_kcontrol_component(kc); + struct snd_soc_component *component = snd_kcontrol_chip(kc); struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); ucontrol->value.enumerated.item[0] = wcd->hph_mode; @@ -3231,7 +3229,7 @@ static int wcd934x_rx_hph_mode_get(struct snd_kcontrol *kc, static int wcd934x_rx_hph_mode_put(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = snd_soc_kcontrol_component(kc); + struct snd_soc_component *component = snd_kcontrol_chip(kc); struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); u32 mode_val; @@ -3252,9 +3250,10 @@ static int wcd934x_rx_hph_mode_put(struct snd_kcontrol *kc, static int slim_rx_mux_get(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kc); - struct wcd934x_codec *wcd = dev_get_drvdata(dapm->dev); + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kc); + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kc); + struct device *dev = snd_soc_dapm_to_dev(dapm); + struct wcd934x_codec *wcd = dev_get_drvdata(dev); ucontrol->value.enumerated.item[0] = wcd->rx_port_value[w->shift]; @@ -3289,8 +3288,9 @@ static int slim_rx_mux_to_dai_id(int mux) static int slim_rx_mux_put(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kc); - struct wcd934x_codec *wcd = dev_get_drvdata(w->dapm->dev); + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kc); + struct device *dev = snd_soc_dapm_to_dev(w->dapm); + struct wcd934x_codec *wcd = dev_get_drvdata(dev); struct soc_enum *e = (struct soc_enum *)kc->private_value; struct snd_soc_dapm_update *update = NULL; struct wcd934x_slim_ch *ch, *c; @@ -3357,7 +3357,7 @@ static int wcd934x_int_dem_inp_mux_put(struct snd_kcontrol *kc, struct snd_soc_component *component; int reg, val; - component = snd_soc_dapm_kcontrol_component(kc); + component = snd_soc_dapm_kcontrol_to_component(kc); val = ucontrol->value.enumerated.item[0]; if (e->reg == WCD934X_CDC_RX0_RX_PATH_SEC0) reg = WCD934X_CDC_RX0_RX_PATH_CFG0; @@ -3390,7 +3390,7 @@ static int wcd934x_dec_enum_put(struct snd_kcontrol *kcontrol, u16 mic_sel_reg = 0; u8 mic_sel; - comp = snd_soc_dapm_kcontrol_component(kcontrol); + comp = snd_soc_dapm_kcontrol_to_component(kcontrol); val = ucontrol->value.enumerated.item[0]; if (val > e->items - 1) @@ -3769,8 +3769,9 @@ static const struct snd_kcontrol_new cdc_if_tx13_inp1_mux = static int slim_tx_mixer_get(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); - struct wcd934x_codec *wcd = dev_get_drvdata(dapm->dev); + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kc); + struct device *dev = snd_soc_dapm_to_dev(dapm); + struct wcd934x_codec *wcd = dev_get_drvdata(dev); struct soc_mixer_control *mixer = (struct soc_mixer_control *)kc->private_value; int port_id = mixer->shift; @@ -3783,8 +3784,9 @@ static int slim_tx_mixer_get(struct snd_kcontrol *kc, static int slim_tx_mixer_put(struct snd_kcontrol *kc, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kc); - struct wcd934x_codec *wcd = dev_get_drvdata(widget->dapm->dev); + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kc); + struct device *dev = snd_soc_dapm_to_dev(widget->dapm); + struct wcd934x_codec *wcd = dev_get_drvdata(dev); struct snd_soc_dapm_update *update = NULL; struct soc_mixer_control *mixer = (struct soc_mixer_control *)kc->private_value; |
