[PATCH 1/133] [Jaunty SRU] ARM.imx51 Freescale:ENGR00108905 sgtl5000: remove unneeded check of spk_amp_event

Bryan Wu bryan.wu at canonical.com
Fri Jul 10 01:18:15 UTC 2009


Brad Figg wrote:
> From: Richard Zhao <b20223 at freescale.com>
> 
> Remove unneeded check to make it more portable.
> 

This patch should go to ASoC subsystem as a cleanup patch.

Thanks
-Bryan

> Signed-off-by: Richard Zhao <b20223 at freescale.com>
> Signed-off-by: Brad Figg <brad.figg at canonical.com>
> ---
>  sound/soc/imx/imx-3stack-sgtl5000.c |   20 +++++---------------
>  1 files changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/sound/soc/imx/imx-3stack-sgtl5000.c b/sound/soc/imx/imx-3stack-sgtl5000.c
> index a062553..58fae69 100644
> --- a/sound/soc/imx/imx-3stack-sgtl5000.c
> +++ b/sound/soc/imx/imx-3stack-sgtl5000.c
> @@ -314,28 +314,18 @@ static int sgtl5000_set_spk(struct snd_kcontrol *kcontrol,
>  static int spk_amp_event(struct snd_soc_dapm_widget *w,
>  			 struct snd_kcontrol *kcontrol, int event)
>  {
> -	int hp_status;
>  	struct imx_3stack_priv *priv = &machine_priv;
>  	struct platform_device *pdev = priv->pdev;
>  	struct mxc_audio_platform_data *plat = pdev->dev.platform_data;
>  
> -	if ((plat->amp_enable == NULL) || (priv->reg_vdda == NULL))
> +	if (plat->amp_enable == NULL)
>  		return 0;
>  
> -	hp_status = plat->hp_status();
> -	if (SND_SOC_DAPM_EVENT_ON(event)) {
> -		if (hp_status) {
> -			plat->amp_enable(0);
> -			regulator_set_mode(priv->reg_vdda,
> -					   REGULATOR_MODE_NORMAL);
> -		} else {
> -			plat->amp_enable(1);
> -			regulator_set_mode(priv->reg_vdda, REGULATOR_MODE_FAST);
> -		}
> -	} else {
> +	if (SND_SOC_DAPM_EVENT_ON(event))
> +		plat->amp_enable(1);
> +	else
>  		plat->amp_enable(0);
> -		regulator_set_mode(priv->reg_vdda, REGULATOR_MODE_NORMAL);
> -	}
> +
>  	return 0;
>  }
>  





More information about the kernel-team mailing list