summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt715.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/rt715.c')
-rw-r--r--sound/soc/codecs/rt715.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/sound/soc/codecs/rt715.c b/sound/soc/codecs/rt715.c
index 7e1628a5c9d1..0881826de2f1 100644
--- a/sound/soc/codecs/rt715.c
+++ b/sound/soc/codecs/rt715.c
@@ -125,8 +125,7 @@ static int rt715_set_amp_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
- struct snd_soc_dapm_context *dapm =
- snd_soc_component_get_dapm(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
@@ -152,7 +151,7 @@ static int rt715_set_amp_gain_put(struct snd_kcontrol *kcontrol,
rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
- if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
+ if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY)
regmap_write(rt715->regmap,
RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0);
@@ -206,7 +205,7 @@ static int rt715_set_amp_gain_put(struct snd_kcontrol *kcontrol,
}
/* D0:power on state, D3: power saving mode */
- if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
+ if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY)
regmap_write(rt715->regmap,
RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3);
return k_vol_changed;
@@ -250,8 +249,7 @@ static int rt715_set_main_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
- struct snd_soc_dapm_context *dapm =
- snd_soc_component_get_dapm(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
static const unsigned int capture_reg_H[] = {
RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H,
@@ -274,7 +272,7 @@ static int rt715_set_main_switch_put(struct snd_kcontrol *kcontrol,
addr_l = capture_reg_L[j];
rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
- if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
+ if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY)
regmap_write(rt715->regmap,
RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0);
@@ -322,7 +320,7 @@ static int rt715_set_main_switch_put(struct snd_kcontrol *kcontrol,
}
/* D0:power on state, D3: power saving mode */
- if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
+ if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY)
regmap_write(rt715->regmap,
RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3);
return k_changed;
@@ -358,8 +356,7 @@ static int rt715_set_main_vol_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
- struct snd_soc_dapm_context *dapm =
- snd_soc_component_get_dapm(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
static const unsigned int capture_reg_H[] = {
RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H,
@@ -381,7 +378,7 @@ static int rt715_set_main_vol_put(struct snd_kcontrol *kcontrol,
addr_l = capture_reg_L[j];
rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
- if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
+ if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY)
regmap_write(rt715->regmap,
RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D0);
@@ -431,7 +428,7 @@ static int rt715_set_main_vol_put(struct snd_kcontrol *kcontrol,
}
/* D0:power on state, D3: power saving mode */
- if (dapm->bias_level <= SND_SOC_BIAS_STANDBY)
+ if (snd_soc_dapm_get_bias_level(dapm) <= SND_SOC_BIAS_STANDBY)
regmap_write(rt715->regmap,
RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3);
return k_changed;
@@ -546,8 +543,7 @@ static const struct snd_kcontrol_new rt715_snd_controls[] = {
static int rt715_mux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_dapm_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int reg, val;
@@ -577,10 +573,8 @@ static int rt715_mux_get(struct snd_kcontrol *kcontrol,
static int rt715_mux_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_dapm_kcontrol_component(kcontrol);
- struct snd_soc_dapm_context *dapm =
- snd_soc_dapm_kcontrol_dapm(kcontrol);
+ struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol);
+ struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int *item = ucontrol->value.enumerated.item;
@@ -752,13 +746,12 @@ static const struct snd_soc_dapm_route rt715_audio_map[] = {
static int rt715_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{
- struct snd_soc_dapm_context *dapm =
- snd_soc_component_get_dapm(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
switch (level) {
case SND_SOC_BIAS_PREPARE:
- if (dapm->bias_level == SND_SOC_BIAS_STANDBY) {
+ if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_STANDBY) {
regmap_write(rt715->regmap,
RT715_SET_AUDIO_POWER_STATE,
AC_PWRST_D0);