ASoC: 88pm860x: Replace direct snd_soc_codec dapm field access
Subsystems (4)
PATCH 1/11 ASoC: 88pm860x: 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().
---
All patches in this series have a dependency on topic/dapm
--- sound/soc/codecs/88pm860x-codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/88pm860x-codec.c +1 -1
@@ -1140,7 +1140,7 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,break ;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 ) {/* Enable Audio PLL & Audio section */ data =AUDIO_PLL |AUDIO_SECTION_ON ;pm860x_reg_write (pm860x->i2c,REG_MISC2 , data);
Signature · 1 line
1.8.0
PATCH 2/11 ASoC: ab8500: 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 with snd_soc_codec_get_dapm().
--- sound/soc/codecs/ab8500-codec.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
sound/soc/codecs/ab8500-codec.c +11 -9
@@ -1209,6 +1209,7 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol); +struct snd_soc_dapm_context *dapm =snd_soc_codec_get_dapm (codec);struct ab8500_codec_drvdata *drvdata =dev_get_drvdata (codec->dev);struct device *dev = codec->dev;bool apply_fir, apply_iir;
@@ -1234,15 +1235,14 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol, apply_fir = req ==ANC_APPLY_FIR || req ==ANC_APPLY_FIR_IIR ; apply_iir = req ==ANC_APPLY_IIR || req ==ANC_APPLY_FIR_IIR ; - status =snd_soc_dapm_force_enable_pin (&codec->dapm, -"ANC Configure Input" ); + status =snd_soc_dapm_force_enable_pin (dapm,"ANC Configure Input" );if (status <0 ) {dev_err (dev,"%s: ERROR: Failed to enable power (status = %d)!\n" , __func__, status); goto cleanup; } -snd_soc_dapm_sync (&codec->dapm); +snd_soc_dapm_sync (dapm);anc_configure (codec, apply_fir, apply_iir);
@@ -1259,8 +1259,8 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol, drvdata->anc_status =ANC_IIR_CONFIGURED ; } - status =snd_soc_dapm_disable_pin (&codec->dapm,"ANC Configure Input" ); -snd_soc_dapm_sync (&codec->dapm); + status =snd_soc_dapm_disable_pin (dapm,"ANC Configure Input" ); +snd_soc_dapm_sync (dapm); cleanup:mutex_unlock (&drvdata->ctrl_lock);
@@ -1947,6 +1947,7 @@ static int ab8500_audio_init_audioblock(struct snd_soc_codec *codec)static int ab8500_audio_setup_mics (struct snd_soc_codec *codec,struct amic_settings *amics) { +struct snd_soc_dapm_context *dapm =snd_soc_codec_get_dapm (codec);u8 value8;unsigned int value;int status;
@@ -1973,15 +1974,15 @@ static int ab8500_audio_setup_mics(struct snd_soc_codec *codec,dev_dbg (codec->dev,"%s: Mic 1a regulator: %s\n" , __func__,amic_micbias_str (amics->mic1a_micbias)); route = &ab8500_dapm_routes_mic1a_vamicx[amics->mic1a_micbias]; - status =snd_soc_dapm_add_routes (&codec->dapm, route,1 ); + status =snd_soc_dapm_add_routes (dapm, route,1 );dev_dbg (codec->dev,"%s: Mic 1b regulator: %s\n" , __func__,amic_micbias_str (amics->mic1b_micbias)); route = &ab8500_dapm_routes_mic1b_vamicx[amics->mic1b_micbias]; - status |=snd_soc_dapm_add_routes (&codec->dapm, route,1 ); + status |=snd_soc_dapm_add_routes (dapm, route,1 );dev_dbg (codec->dev,"%s: Mic 2 regulator: %s\n" , __func__,amic_micbias_str (amics->mic2_micbias)); route = &ab8500_dapm_routes_mic2_vamicx[amics->mic2_micbias]; - status |=snd_soc_dapm_add_routes (&codec->dapm, route,1 ); + status |=snd_soc_dapm_add_routes (dapm, route,1 );if (status <0 ) { dev_err(codec->dev, "%s: Failed to add AMic-regulator DAPM-routes (%d).\n",
@@ -2461,6 +2462,7 @@ static void ab8500_codec_of_probe(struct device *dev, struct device_node *np,static int ab8500_codec_probe (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm =snd_soc_codec_get_dapm (codec);struct device *dev = codec->dev;struct device_node *np = dev->of_node;struct ab8500_codec_drvdata *drvdata =dev_get_drvdata (dev);
@@ -2541,7 +2543,7 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) &ab8500_filter_controls[AB8500_FILTER_SID_FIR ].private_value; drvdata->sid_fir_values = (long *)fc->value; - (void )snd_soc_dapm_disable_pin (&codec->dapm,"ANC Configure Input" ); +snd_soc_dapm_disable_pin (dapm,"ANC Configure Input" );mutex_init (&drvdata->ctrl_lock);
Signature · 1 line
1.8.0
PATCH 3/11 ASoC: ak4641: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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().
--- sound/soc/codecs/ak4641.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/ak4641.c +1 -1
@@ -412,7 +412,7 @@ static int ak4641_set_bias_level(struct snd_soc_codec *codec,snd_soc_update_bits (codec,AK4641_DAC ,0x20 ,0x20 );break ;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 ) {if (pdata &&gpio_is_valid (pdata->gpio_power))gpio_set_value (pdata->gpio_power,1 );mdelay (1 );
Signature · 1 line
1.8.0
PATCH 4/11 ASoC: cx20442: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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().
--- sound/soc/codecs/cx20442.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cx20442.c +2 -2
@@ -333,7 +333,7 @@ static int cx20442_set_bias_level(struct snd_soc_codec *codec,switch (level) {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 )break ;if (IS_ERR (cx20442->por)) err =PTR_ERR (cx20442->por);
@@ -341,7 +341,7 @@ static int cx20442_set_bias_level(struct snd_soc_codec *codec, err =regulator_enable (cx20442->por);break ;case SND_SOC_BIAS_STANDBY : -if (codec->dapm.bias_level !=SND_SOC_BIAS_PREPARE ) +if (snd_soc_codec_get_bias_level (codec) !=SND_SOC_BIAS_PREPARE )break ;if (IS_ERR (cx20442->por)) err =PTR_ERR (cx20442->por);
Signature · 1 line
1.8.0
PATCH 5/11 ASoC: es8328: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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().
--- sound/soc/codecs/es8328.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/es8328.c +1 -1
@@ -536,7 +536,7 @@ static int es8328_set_bias_level(struct snd_soc_codec *codec,break ;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 ) { snd_soc_update_bits(codec, ES8328_CONTROL1, ES8328_CONTROL1_VMIDSEL_MASK | ES8328_CONTROL1_ENREF,
Signature · 1 line
1.8.0
PATCH 6/11 ASoC: jz4740: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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().
--- sound/soc/codecs/jz4740.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/jz4740.c +1 -1
@@ -258,7 +258,7 @@ static int jz4740_codec_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY :/* The only way to clear the suspend flag is to reset the codec */ -if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) +if (snd_soc_codec_get_bias_level (codec) ==SND_SOC_BIAS_OFF )jz4740_codec_wakeup (regmap); mask = JZ4740_CODEC_1_VREF_DISABLE |
Signature · 1 line
1.8.0
PATCH 7/11 ASoC: ml26124: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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().
--- sound/soc/codecs/ml26124.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/ml26124.c +1 -1
@@ -523,7 +523,7 @@ static int ml26124_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY :/* VMID ON */ -if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { +if (snd_soc_codec_get_bias_level (codec) ==SND_SOC_BIAS_OFF ) {snd_soc_update_bits (codec,ML26124_PW_REF_PW_MNG ,ML26124_VMID ,ML26124_VMID );msleep (500 );
Signature · 1 line
1.8.0
PATCH 8/11 ASoC: uda134x: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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 with snd_soc_codec_get_dapm().
--- sound/soc/codecs/uda134x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/uda134x.c +2 -1
@@ -477,6 +477,7 @@ static struct snd_soc_dai_driver uda134x_dai = {static int uda134x_soc_probe (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm =snd_soc_codec_get_dapm (codec);struct uda134x_priv *uda134x;struct uda134x_platform_data *pd = codec->component.card->dev->platform_data;const struct snd_soc_dapm_widget *widgets;
@@ -525,7 +526,7 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec) num_widgets =ARRAY_SIZE (uda1340_dapm_widgets); } - ret =snd_soc_dapm_new_controls (&codec->dapm, widgets, num_widgets); + ret =snd_soc_dapm_new_controls (dapm, widgets, num_widgets);if (ret) {printk (KERN_ERR "%s failed to register dapm controls: %d" , __func__, ret);
Signature · 1 line
1.8.0
PATCH 9/11 ASoC: uda1380: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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().
Also drop the unnecessary check at the beginning of the uda1380_set_bias_level() which compares the current level to the target level and aborts if they are the same. Since the core will not call the set_bias_level() callback if we already are in the target state the result of the check is always false.
--- sound/soc/codecs/uda1380.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/codecs/uda1380.c +1 -4
@@ -590,9 +590,6 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,int reg;struct uda1380_platform_data *pdata = codec->dev->platform_data; -if (codec->dapm.bias_level == level) -return 0 ; -switch (level) {case SND_SOC_BIAS_ON :case SND_SOC_BIAS_PREPARE :
@@ -600,7 +597,7 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,uda1380_write (codec,UDA1380_PM ,R02_PON_BIAS | pm);break ;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 ) {if (gpio_is_valid (pdata->gpio_power)) {gpio_set_value (pdata->gpio_power,1 );mdelay (1 );
Signature · 1 line
1.8.0
PATCH 10/11 ASoC: sgtl5000: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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().
--- sound/soc/codecs/sgtl5000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/sgtl5000.c +1 -1
@@ -948,7 +948,7 @@ static int sgtl5000_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;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 ) { ret =regulator_bulk_enable (ARRAY_SIZE (sgtl5000->supplies), sgtl5000->supplies);
Signature · 1 line
1.8.0
PATCH 11/11 ASoC: sirf-audio-codec: Replace direct snd_soc_codec dapm field access
In reply to Lars-Peter ClausenThe 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 with snd_soc_codec_get_dapm().
--- sound/soc/codecs/sirf-audio-codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/sirf-audio-codec.c +1 -1
@@ -395,7 +395,7 @@ struct snd_soc_dai_driver sirf_audio_codec_dai = {static int sirf_audio_codec_probe (struct snd_soc_codec *codec) { -struct snd_soc_dapm_context *dapm = &codec->dapm; +struct snd_soc_dapm_context *dapm =snd_soc_codec_get_dapm (codec);pm_runtime_enable (codec->dev);
Signature · 1 line
1.8.0
Quoted 3 lines · Lars-Peter Clausen
The dapm field of the
snd_soc_codecstruct is eventually going to be removed, in preparation for this replace all manual access tocodec->dapm.bias_levelwithsnd_soc_codec_get_bias_level().
Applied all, thanks.