mirror of https://gitee.com/openkylin/linux.git
ASoC: wm8960: 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> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
afcd11df6d
commit
93f32f534e
|
@ -445,7 +445,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
|
struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
|
||||||
struct wm8960_data *pdata = &wm8960->pdata;
|
struct wm8960_data *pdata = &wm8960->pdata;
|
||||||
struct snd_soc_dapm_context *dapm = &codec->dapm;
|
struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
|
||||||
struct snd_soc_dapm_widget *w;
|
struct snd_soc_dapm_widget *w;
|
||||||
|
|
||||||
snd_soc_dapm_new_controls(dapm, wm8960_dapm_widgets,
|
snd_soc_dapm_new_controls(dapm, wm8960_dapm_widgets,
|
||||||
|
@ -476,7 +476,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec)
|
||||||
* and save the result.
|
* and save the result.
|
||||||
*/
|
*/
|
||||||
list_for_each_entry(w, &codec->component.card->widgets, list) {
|
list_for_each_entry(w, &codec->component.card->widgets, list) {
|
||||||
if (w->dapm != &codec->dapm)
|
if (w->dapm != dapm)
|
||||||
continue;
|
continue;
|
||||||
if (strcmp(w->name, "LOUT1 PGA") == 0)
|
if (strcmp(w->name, "LOUT1 PGA") == 0)
|
||||||
wm8960->lout1 = w;
|
wm8960->lout1 = w;
|
||||||
|
@ -627,7 +627,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_PREPARE:
|
case SND_SOC_BIAS_PREPARE:
|
||||||
switch (codec->dapm.bias_level) {
|
switch (snd_soc_codec_get_bias_level(codec)) {
|
||||||
case SND_SOC_BIAS_STANDBY:
|
case SND_SOC_BIAS_STANDBY:
|
||||||
if (!IS_ERR(wm8960->mclk)) {
|
if (!IS_ERR(wm8960->mclk)) {
|
||||||
ret = clk_prepare_enable(wm8960->mclk);
|
ret = clk_prepare_enable(wm8960->mclk);
|
||||||
|
@ -655,7 +655,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_STANDBY:
|
case SND_SOC_BIAS_STANDBY:
|
||||||
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
|
if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) {
|
||||||
regcache_sync(wm8960->regmap);
|
regcache_sync(wm8960->regmap);
|
||||||
|
|
||||||
/* Enable anti-pop features */
|
/* Enable anti-pop features */
|
||||||
|
@ -705,7 +705,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_PREPARE:
|
case SND_SOC_BIAS_PREPARE:
|
||||||
switch (codec->dapm.bias_level) {
|
switch (snd_soc_codec_get_bias_level(codec)) {
|
||||||
case SND_SOC_BIAS_STANDBY:
|
case SND_SOC_BIAS_STANDBY:
|
||||||
/* Enable anti pop mode */
|
/* Enable anti pop mode */
|
||||||
snd_soc_update_bits(codec, WM8960_APOP1,
|
snd_soc_update_bits(codec, WM8960_APOP1,
|
||||||
|
@ -776,7 +776,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_STANDBY:
|
case SND_SOC_BIAS_STANDBY:
|
||||||
switch (codec->dapm.bias_level) {
|
switch (snd_soc_codec_get_bias_level(codec)) {
|
||||||
case SND_SOC_BIAS_PREPARE:
|
case SND_SOC_BIAS_PREPARE:
|
||||||
/* Disable HP discharge */
|
/* Disable HP discharge */
|
||||||
snd_soc_update_bits(codec, WM8960_APOP2,
|
snd_soc_update_bits(codec, WM8960_APOP2,
|
||||||
|
|
Loading…
Reference in New Issue