ASoC: codecs: rt1320-sdw: convert to snd_soc_dapm_xxx()

This patch converts below functions.

snd_soc_component_get_bias_level() -> snd_soc_dapm_get_bias_level()
snd_soc_component_get_dapm()       -> snd_soc_component_to_dapm()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87344f3bko.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2026-01-08 23:54:15 +00:00 committed by Mark Brown
parent 35bffbe49d
commit 77157cb45c
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -1246,7 +1246,7 @@ static int rt1320_r0_cali_put(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt1320_sdw_priv *rt1320 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(rt1320->component);
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt1320->component);
int ret;
if (!rt1320->hw_init)
@ -1258,7 +1258,7 @@ static int rt1320_r0_cali_put(struct snd_kcontrol *kcontrol,
rt1320->cali_done = false;
snd_soc_dapm_mutex_lock(dapm);
if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF &&
if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF &&
ucontrol->value.integer.value[0]) {
rt1320_calibrate(rt1320);
}
@ -1582,8 +1582,7 @@ struct rt1320_dspfwheader {
short crc;
};
struct snd_soc_dapm_context *dapm =
snd_soc_component_get_dapm(rt1320->component);
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt1320->component);
struct device *dev = &rt1320->sdw_slave->dev;
unsigned int val, i, fw_offset, fw_ready;
unsigned int fw_status_addr;
@ -2388,7 +2387,7 @@ static int rt1320_r0_load_mode_put(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt1320_sdw_priv *rt1320 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(rt1320->component);
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt1320->component);
int ret;
if (!rt1320->hw_init)
@ -2403,7 +2402,7 @@ static int rt1320_r0_load_mode_put(struct snd_kcontrol *kcontrol,
return ret;
snd_soc_dapm_mutex_lock(dapm);
if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) {
rt1320->r0_l_reg = ucontrol->value.integer.value[0];
rt1320->r0_r_reg = ucontrol->value.integer.value[1];
rt1320_calc_r0(rt1320);
@ -2447,6 +2446,7 @@ static int rt1320_dspfw_load_put(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt1320_sdw_priv *rt1320 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
int ret;
if (!rt1320->hw_init)
@ -2456,7 +2456,7 @@ static int rt1320_dspfw_load_put(struct snd_kcontrol *kcontrol,
if (ret < 0 && ret != -EACCES)
return ret;
if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF &&
if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF &&
ucontrol->value.integer.value[0])
rt1320_dspfw_load_code(rt1320);
@ -2481,6 +2481,7 @@ static int rt1320_rae_update_put(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt1320_sdw_priv *rt1320 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
int ret;
if (!rt1320->hw_init)
@ -2490,7 +2491,7 @@ static int rt1320_rae_update_put(struct snd_kcontrol *kcontrol,
if (ret < 0 && ret != -EACCES)
return ret;
if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF &&
if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF &&
ucontrol->value.integer.value[0] && rt1320->fw_load_done)
rt1320_rae_load(rt1320);
@ -2516,7 +2517,7 @@ static int rt1320_r0_temperature_put(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt1320_sdw_priv *rt1320 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(rt1320->component);
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(rt1320->component);
int ret;
if (!rt1320->hw_init)
@ -2527,7 +2528,7 @@ static int rt1320_r0_temperature_put(struct snd_kcontrol *kcontrol,
return ret;
snd_soc_dapm_mutex_lock(dapm);
if ((snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) &&
if ((snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) &&
ucontrol->value.integer.value[0] && ucontrol->value.integer.value[1])
rt1320_t0_load(rt1320, ucontrol->value.integer.value[0], ucontrol->value.integer.value[1]);
snd_soc_dapm_mutex_unlock(dapm);