diff mbox

[7/7] ASoC: twl4030: Convert to params_width()

Message ID 1406808978-16175-7-git-send-email-broonie@kernel.org
State New
Headers show

Commit Message

Mark Brown July 31, 2014, 12:16 p.m. UTC
From: Mark Brown <broonie@linaro.org>

The CODEC doesn't care how data is laid out in memory.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 sound/soc/codecs/twl4030.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Peter Ujfalusi July 31, 2014, 12:40 p.m. UTC | #1
On 07/31/2014 03:16 PM, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
> 
> The CODEC doesn't care how data is laid out in memory.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Mark Brown <broonie@linaro.org>
> ---
>  sound/soc/codecs/twl4030.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
> index cf404505e7d1..b6b0cb399599 100644
> --- a/sound/soc/codecs/twl4030.c
> +++ b/sound/soc/codecs/twl4030.c
> @@ -1763,16 +1763,16 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream,
>  	old_format = twl4030_read(codec, TWL4030_REG_AUDIO_IF);
>  	format = old_format;
>  	format &= ~TWL4030_DATA_WIDTH;
> -	switch (params_format(params)) {
> -	case SNDRV_PCM_FORMAT_S16_LE:
> +	switch (params_width(params)) {
> +	case 16:
>  		format |= TWL4030_DATA_WIDTH_16S_16W;
>  		break;
> -	case SNDRV_PCM_FORMAT_S32_LE:
> +	case 32:
>  		format |= TWL4030_DATA_WIDTH_32S_24W;
>  		break;
>  	default:
> -		dev_err(codec->dev, "%s: unknown format %d\n", __func__,
> -			params_format(params));
> +		dev_err(codec->dev, "%s: unsupported bits/sample %d\n",
> +			__func__, params_width(params));
>  		return -EINVAL;
>  	}
>  
>
diff mbox

Patch

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index cf404505e7d1..b6b0cb399599 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -1763,16 +1763,16 @@  static int twl4030_hw_params(struct snd_pcm_substream *substream,
 	old_format = twl4030_read(codec, TWL4030_REG_AUDIO_IF);
 	format = old_format;
 	format &= ~TWL4030_DATA_WIDTH;
-	switch (params_format(params)) {
-	case SNDRV_PCM_FORMAT_S16_LE:
+	switch (params_width(params)) {
+	case 16:
 		format |= TWL4030_DATA_WIDTH_16S_16W;
 		break;
-	case SNDRV_PCM_FORMAT_S32_LE:
+	case 32:
 		format |= TWL4030_DATA_WIDTH_32S_24W;
 		break;
 	default:
-		dev_err(codec->dev, "%s: unknown format %d\n", __func__,
-			params_format(params));
+		dev_err(codec->dev, "%s: unsupported bits/sample %d\n",
+			__func__, params_width(params));
 		return -EINVAL;
 	}