ASoC: rt5677: Replace direct snd_soc_codec dapm field access
The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level() and replace all other manual access to codec->dapm with snd_soc_codec_get_dapm(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
6d8135ff00
Коммит
6b43c2eb9a
|
@ -817,7 +817,7 @@ static int rt5677_dsp_vad_put(struct snd_kcontrol *kcontrol,
|
||||||
|
|
||||||
rt5677->dsp_vad_en = !!ucontrol->value.integer.value[0];
|
rt5677->dsp_vad_en = !!ucontrol->value.integer.value[0];
|
||||||
|
|
||||||
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
|
if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF)
|
||||||
rt5677_set_dsp_vad(codec, rt5677->dsp_vad_en);
|
rt5677_set_dsp_vad(codec, rt5677->dsp_vad_en);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2476,7 +2476,7 @@ static int rt5677_vref_event(struct snd_soc_dapm_widget *w,
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case SND_SOC_DAPM_POST_PMU:
|
case SND_SOC_DAPM_POST_PMU:
|
||||||
if (codec->dapm.bias_level != SND_SOC_BIAS_ON &&
|
if (snd_soc_codec_get_bias_level(codec) != SND_SOC_BIAS_ON &&
|
||||||
!rt5677->is_vref_slow) {
|
!rt5677->is_vref_slow) {
|
||||||
mdelay(20);
|
mdelay(20);
|
||||||
regmap_update_bits(rt5677->regmap, RT5677_PWR_ANLG1,
|
regmap_update_bits(rt5677->regmap, RT5677_PWR_ANLG1,
|
||||||
|
@ -4350,7 +4350,7 @@ static int rt5677_set_bias_level(struct snd_soc_codec *codec,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_PREPARE:
|
case SND_SOC_BIAS_PREPARE:
|
||||||
if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) {
|
if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_STANDBY) {
|
||||||
rt5677_set_dsp_vad(codec, false);
|
rt5677_set_dsp_vad(codec, false);
|
||||||
|
|
||||||
regmap_update_bits(rt5677->regmap, RT5677_PWR_ANLG1,
|
regmap_update_bits(rt5677->regmap, RT5677_PWR_ANLG1,
|
||||||
|
@ -4602,17 +4602,18 @@ static void rt5677_free_gpio(struct i2c_client *i2c)
|
||||||
|
|
||||||
static int rt5677_probe(struct snd_soc_codec *codec)
|
static int rt5677_probe(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
|
struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
|
||||||
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
|
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
rt5677->codec = codec;
|
rt5677->codec = codec;
|
||||||
|
|
||||||
if (rt5677->pdata.dmic2_clk_pin == RT5677_DMIC_CLK2) {
|
if (rt5677->pdata.dmic2_clk_pin == RT5677_DMIC_CLK2) {
|
||||||
snd_soc_dapm_add_routes(&codec->dapm,
|
snd_soc_dapm_add_routes(dapm,
|
||||||
rt5677_dmic2_clk_2,
|
rt5677_dmic2_clk_2,
|
||||||
ARRAY_SIZE(rt5677_dmic2_clk_2));
|
ARRAY_SIZE(rt5677_dmic2_clk_2));
|
||||||
} else { /*use dmic1 clock by default*/
|
} else { /*use dmic1 clock by default*/
|
||||||
snd_soc_dapm_add_routes(&codec->dapm,
|
snd_soc_dapm_add_routes(dapm,
|
||||||
rt5677_dmic2_clk_1,
|
rt5677_dmic2_clk_1,
|
||||||
ARRAY_SIZE(rt5677_dmic2_clk_1));
|
ARRAY_SIZE(rt5677_dmic2_clk_1));
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче