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/tas5086.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c index be7194b43b7a..249ef5c4c762 100644 --- a/sound/soc/codecs/tas5086.c +++ b/sound/soc/codecs/tas5086.c @@ -425,14 +425,14 @@ static int tas5086_hw_params(struct snd_pcm_substream *substream, }
/* ... then add the offset for the sample bit depth. */ - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: val += 0; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: val += 1; break; - case SNDRV_PCM_FORMAT_S24_3LE: + case 24: val += 2; break; default:
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/tlv320aic26.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index 43069de3d56a..620ab9ea1ef0 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c @@ -71,8 +71,8 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
dev_dbg(&aic26->spi->dev, "aic26_hw_params(substream=%p, params=%p)\n", substream, params); - dev_dbg(&aic26->spi->dev, "rate=%i format=%i\n", params_rate(params), - params_format(params)); + dev_dbg(&aic26->spi->dev, "rate=%i width=%d\n", params_rate(params), + params_width(params));
switch (params_rate(params)) { case 8000: fsref = 48000; divisor = AIC26_DIV_6; break; @@ -89,11 +89,11 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, }
/* select data word length */ - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S8: wlen = AIC26_WLEN_16; break; - case SNDRV_PCM_FORMAT_S16_BE: wlen = AIC26_WLEN_16; break; - case SNDRV_PCM_FORMAT_S24_BE: wlen = AIC26_WLEN_24; break; - case SNDRV_PCM_FORMAT_S32_BE: wlen = AIC26_WLEN_32; break; + switch (params_width(params)) { + case 8: wlen = AIC26_WLEN_16; break; + case 16: wlen = AIC26_WLEN_16; break; + case 24: wlen = AIC26_WLEN_24; break; + case 32: wlen = AIC26_WLEN_32; break; default: dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL; }
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/tlv320aic31xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 095f4556ab1b..0f64c7890eed 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -760,8 +760,8 @@ static int aic31xx_hw_params(struct snd_pcm_substream *substream, struct snd_soc_codec *codec = dai->codec; u8 data = 0;
- dev_dbg(codec->dev, "## %s: format %d width %d rate %d\n", - __func__, params_format(params), params_width(params), + dev_dbg(codec->dev, "## %s: width %d rate %d\n", + __func__, params_width(params), params_rate(params));
switch (params_width(params)) { @@ -780,8 +780,8 @@ static int aic31xx_hw_params(struct snd_pcm_substream *substream, AIC31XX_IFACE1_DATALEN_SHIFT); break; default: - dev_err(codec->dev, "%s: Unsupported format %d\n", - __func__, params_format(params)); + dev_err(codec->dev, "%s: Unsupported width %d\n", + __func__, params_width(params)); return -EINVAL; }
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/tlv320aic32x4.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index 89e41d2f7586..6ea662db2410 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c @@ -450,16 +450,16 @@ static int aic32x4_hw_params(struct snd_pcm_substream *substream,
data = snd_soc_read(codec, AIC32X4_IFACE1); data = data & ~(3 << 4); - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: data |= (AIC32X4_WORD_LEN_20BITS << AIC32X4_DOSRMSB_SHIFT); break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: data |= (AIC32X4_WORD_LEN_24BITS << AIC32X4_DOSRMSB_SHIFT); break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: data |= (AIC32X4_WORD_LEN_32BITS << AIC32X4_DOSRMSB_SHIFT); break; }
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/tlv320aic3x.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 3224ab6c81e6..64f179ee9834 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -873,17 +873,16 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
/* select data word length */ data = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLB) & (~(0x3 << 4)); - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: data |= (0x01 << 4); break; - case SNDRV_PCM_FORMAT_S24_3LE: - case SNDRV_PCM_FORMAT_S24_LE: + case 24: data |= (0x02 << 4); break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: data |= (0x03 << 4); break; }
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/tlv320dac33.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index ff006cc95520..e21ed934bdbf 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -832,18 +832,18 @@ static int dac33_hw_params(struct snd_pcm_substream *substream, return -EINVAL; }
- switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: dac33->fifo_size = DAC33_FIFO_SIZE_16BIT; dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 32); break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: dac33->fifo_size = DAC33_FIFO_SIZE_24BIT; dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 64); break; default: - dev_err(codec->dev, "unsupported format %d\n", - params_format(params)); + dev_err(codec->dev, "unsupported width %d\n", + params_width(params)); return -EINVAL; }
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/tlv320dac33.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index ff006cc95520..e21ed934bdbf 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -832,18 +832,18 @@ static int dac33_hw_params(struct snd_pcm_substream *substream, return -EINVAL; }
- switch (params_format(params)) {
- case SNDRV_PCM_FORMAT_S16_LE:
- switch (params_width(params)) {
- case 16: dac33->fifo_size = DAC33_FIFO_SIZE_16BIT; dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 32); break;
- case SNDRV_PCM_FORMAT_S32_LE:
- case 32: dac33->fifo_size = DAC33_FIFO_SIZE_24BIT; dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 64); break; default:
dev_err(codec->dev, "unsupported format %d\n",
params_format(params));
dev_err(codec->dev, "unsupported width %d\n",
return -EINVAL; }params_width(params));
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(-)
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; }
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",
return -EINVAL; }__func__, params_width(params));
linaro-kernel@lists.linaro.org