[alsa-devel] [PATCH 01/35] ASoC: wm8350: Convert to params_width()
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/wm8350.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index d9e634c55e81..3dfdcc4197fa 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c @@ -918,16 +918,16 @@ static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream, ~WM8350_AIF_WL_MASK;
/* bit size */ - 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: iface |= 0x1 << 10; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x2 << 10; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x3 << 10; 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/wm8400.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c index 06e913d3fea1..72471bef2e9a 100644 --- a/sound/soc/codecs/wm8400.c +++ b/sound/soc/codecs/wm8400.c @@ -1095,16 +1095,16 @@ static int wm8400_hw_params(struct snd_pcm_substream *substream,
audio1 &= ~WM8400_AIF_WL_MASK; /* bit size */ - 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: audio1 |= WM8400_AIF_WL_20BITS; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: audio1 |= WM8400_AIF_WL_24BITS; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: audio1 |= WM8400_AIF_WL_32BITS; 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/wm8510.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 1c1e328feeb8..e11127f9069e 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c @@ -449,16 +449,16 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream, u16 adn = snd_soc_read(codec, WM8510_ADD) & 0x1f1;
/* bit size */ - 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: iface |= 0x0020; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0040; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x0060; 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/wm8523.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 601ee8178af1..ec1f5740dbd0 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c @@ -163,16 +163,16 @@ static int wm8523_hw_params(struct snd_pcm_substream *substream, aifctrl2 |= lrclk_ratios[i].value;
aifctrl1 &= ~WM8523_WL_MASK; - 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: aifctrl1 |= 0x8; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: aifctrl1 |= 0x10; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: aifctrl1 |= 0x18; 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/wm8580.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 7665ff6aea6d..911605ee25b0 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -511,19 +511,19 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, int i, ratio, osr;
/* bit size */ - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: paifa |= 0x8; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: paifa |= 0x0; paifb |= WM8580_AIF_LENGTH_20; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: paifa |= 0x0; paifb |= WM8580_AIF_LENGTH_24; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: paifa |= 0x0; paifb |= WM8580_AIF_LENGTH_32; 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/wm8711.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index b0fbcb377baf..32187e739b4f 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c @@ -169,13 +169,13 @@ static int wm8711_hw_params(struct snd_pcm_substream *substream, snd_soc_write(codec, WM8711_SRATE, srate);
/* bit size */ - 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: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0008; 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/wm8728.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c index bac7fc28fe71..38ff826f589a 100644 --- a/sound/soc/codecs/wm8728.c +++ b/sound/soc/codecs/wm8728.c @@ -94,13 +94,13 @@ static int wm8728_hw_params(struct snd_pcm_substream *substream,
dac &= ~0x18;
- 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: dac |= 0x10; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: dac |= 0x08; 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/wm8731.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 5ada61611324..eebb3280bfad 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -348,13 +348,13 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream, snd_soc_write(codec, WM8731_SRATE, srate);
/* bit size */ - 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: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0008; 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/wm8737.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c index b27f26cdc049..744a422ecb05 100644 --- a/sound/soc/codecs/wm8737.c +++ b/sound/soc/codecs/wm8737.c @@ -367,16 +367,16 @@ static int wm8737_hw_params(struct snd_pcm_substream *substream,
clocking |= coeff_div[i].usb | (coeff_div[i].sr << WM8737_SR_SHIFT);
- 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: af |= 0x8; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: af |= 0x10; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: af |= 0x18; 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/wm8741.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c index b33542a04607..a237f1627f61 100644 --- a/sound/soc/codecs/wm8741.c +++ b/sound/soc/codecs/wm8741.c @@ -241,26 +241,26 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream, }
/* bit size */ - 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: iface |= 0x0001; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0002; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x0003; break; default: dev_dbg(codec->dev, "wm8741_hw_params: Unsupported bit size param = %d", - params_format(params)); + params_width(params)); return -EINVAL; }
dev_dbg(codec->dev, "wm8741_hw_params: bit size param = %d", - params_format(params)); + params_width(params));
snd_soc_write(codec, WM8741_FORMAT_CONTROL, iface); return 0;
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/wm8750.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index 33990b63d214..67653a2db223 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c @@ -586,16 +586,16 @@ static int wm8750_pcm_hw_params(struct snd_pcm_substream *substream, int coeff = get_coeff(wm8750->sysclk, params_rate(params));
/* bit size */ - 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: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0008; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x000c; 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/wm8753.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 53e57b4049a8..e54e097f4fcb 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c @@ -937,16 +937,16 @@ static int wm8753_pcm_hw_params(struct snd_pcm_substream *substream, u16 srate = snd_soc_read(codec, WM8753_SRATE1) & 0x017f;
/* bit size */ - 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: voice |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: voice |= 0x0008; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: voice |= 0x000c; break; } @@ -1176,16 +1176,16 @@ static int wm8753_i2s_hw_params(struct snd_pcm_substream *substream, coeff_div[coeff].usb);
/* bit size */ - 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: hifi |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: hifi |= 0x0008; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: hifi |= 0x000c; 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/wm8770.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c index c61aeb38efb8..180e7a098726 100644 --- a/sound/soc/codecs/wm8770.c +++ b/sound/soc/codecs/wm8770.c @@ -426,16 +426,16 @@ static int wm8770_hw_params(struct snd_pcm_substream *substream, wm8770 = snd_soc_codec_get_drvdata(codec);
iface = 0; - 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: iface |= 0x10; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x20; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x30; 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/wm8804.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c index d96e5963ee35..0ea01dfcb6e1 100644 --- a/sound/soc/codecs/wm8804.c +++ b/sound/soc/codecs/wm8804.c @@ -270,19 +270,19 @@ static int wm8804_hw_params(struct snd_pcm_substream *substream,
codec = dai->codec;
- switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: blen = 0x0; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: blen = 0x1; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: blen = 0x2; break; default: dev_err(dai->dev, "Unsupported word length: %u\n", - params_format(params)); + 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/wm8900.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index d09fdce57f5a..44a5f1511f0f 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c @@ -640,16 +640,16 @@ static int wm8900_hw_params(struct snd_pcm_substream *substream,
reg = snd_soc_read(codec, WM8900_REG_AUDIO1) & ~0x60;
- 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: reg |= 0x20; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: reg |= 0x40; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: reg |= 0x60; 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/wm8903.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index ec3250daa93e..aa0984864e76 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c @@ -1476,19 +1476,19 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream,
aif1 &= ~WM8903_AIF_WL_MASK; bclk = 2 * fs; - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: bclk *= 16; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: bclk *= 20; aif1 |= 0x4; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: bclk *= 24; aif1 |= 0x8; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: bclk *= 32; aif1 |= 0xc; 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/wm8904.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 17164758abcc..4d2d2b1380d5 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1292,16 +1292,16 @@ static int wm8904_hw_params(struct snd_pcm_substream *substream, wm8904->bclk = snd_soc_params_to_bclk(params); }
- 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: aif1 |= 0x40; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: aif1 |= 0x80; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: aif1 |= 0xc0; 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/wm8940.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index fc6eec9ad66b..52011043e54c 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c @@ -430,19 +430,19 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream, if (ret) goto error_ret;
- switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S8: + switch (params_width(params)) { + case 8: companding = companding | (1 << 5); break; - case SNDRV_PCM_FORMAT_S16_LE: + case 16: break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: iface |= (1 << 5); break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= (2 << 5); break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= (3 << 5); 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/wm8955.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index 2a35108f233d..09d91d9dc4ee 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c @@ -597,17 +597,17 @@ static int wm8955_hw_params(struct snd_pcm_substream *substream, int ret; int wl;
- switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: wl = 0; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: wl = 0x4; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: wl = 0x8; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: wl = 0xc; 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/wm8960.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index e96349b04ba6..4dc4e85116cd 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -567,24 +567,21 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream, struct snd_soc_codec *codec = dai->codec; struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3; - snd_pcm_format_t format = params_format(params); int i;
/* bit size */ - switch (format) { - case SNDRV_PCM_FORMAT_S16_LE: - case SNDRV_PCM_FORMAT_S16_BE: + switch (params_width(params)) { + case 16: break; - case SNDRV_PCM_FORMAT_S20_3LE: - case SNDRV_PCM_FORMAT_S20_3BE: + case 20: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: - case SNDRV_PCM_FORMAT_S24_BE: + case 24: iface |= 0x0008; break; default: - dev_err(codec->dev, "unsupported format %i\n", format); + dev_err(codec->dev, "unsupported width %d\n", + 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/wm8961.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 9c88f04442b3..41d23e920ad5 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c @@ -565,16 +565,16 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream,
reg = snd_soc_read(codec, WM8961_AUDIO_INTERFACE_0); reg &= ~WM8961_WL_MASK; - 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: reg |= 1 << WM8961_WL_SHIFT; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: reg |= 2 << WM8961_WL_SHIFT; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: reg |= 3 << WM8961_WL_SHIFT; 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/wm8962.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index ca2fda9d72be..4be6f2afdbc4 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2586,16 +2586,16 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream, if (wm8962->lrclk % 8000 == 0) adctl3 |= WM8962_SAMPLE_RATE_INT_MODE;
- 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: aif0 |= 0x4; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: aif0 |= 0x8; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: aif0 |= 0xc; 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/wm8971.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index 09b7b4200221..0499cd4cfb71 100644 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c @@ -517,16 +517,16 @@ static int wm8971_pcm_hw_params(struct snd_pcm_substream *substream, int coeff = get_coeff(wm8971->sysclk, params_rate(params));
/* bit size */ - 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: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0008; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x000c; 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/wm8974.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index 0627c56fa44e..682e9eda1019 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c @@ -445,16 +445,16 @@ static int wm8974_pcm_hw_params(struct snd_pcm_substream *substream, u16 adn = snd_soc_read(codec, WM8974_ADD) & 0x1f1;
/* bit size */ - 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: iface |= 0x0020; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0040; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x0060; 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/wm8978.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index 28ef46c91f62..ee2ba574952b 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c @@ -736,16 +736,16 @@ static int wm8978_hw_params(struct snd_pcm_substream *substream, return -EINVAL;
/* bit size */ - 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: iface_ctl |= 0x20; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface_ctl |= 0x40; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface_ctl |= 0x60; break; } @@ -817,8 +817,8 @@ static int wm8978_hw_params(struct snd_pcm_substream *substream, wm8978->sysclk == WM8978_MCLK ? ", consider using PLL" : "");
- dev_dbg(codec->dev, "%s: fmt %d, rate %u, MCLK divisor #%d\n", __func__, - params_format(params), params_rate(params), best); + dev_dbg(codec->dev, "%s: width %d, rate %u, MCLK divisor #%d\n", __func__, + params_width(params), params_rate(params), best);
/* MCLK divisor mask = 0xe0 */ snd_soc_update_bits(codec, WM8978_CLOCKING, 0xe0, best << 5);
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/wm8983.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c index 19d5baa38f5c..ac5defda8824 100644 --- a/sound/soc/codecs/wm8983.c +++ b/sound/soc/codecs/wm8983.c @@ -719,22 +719,22 @@ static int wm8983_hw_params(struct snd_pcm_substream *substream,
wm8983->bclk = ret;
- switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: blen = 0x0; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: blen = 0x1; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: blen = 0x2; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: blen = 0x3; break; default: dev_err(dai->dev, "Unsupported word length %u\n", - params_format(params)); + 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/wm8985.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c index cbbdfbbd0a9f..ee380190399f 100644 --- a/sound/soc/codecs/wm8985.c +++ b/sound/soc/codecs/wm8985.c @@ -698,22 +698,22 @@ static int wm8985_hw_params(struct snd_pcm_substream *substream, if ((int)wm8985->bclk < 0) return wm8985->bclk;
- switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: blen = 0x0; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: blen = 0x1; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: blen = 0x2; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: blen = 0x3; break; default: dev_err(dai->dev, "Unsupported word length %u\n", - params_format(params)); + 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/wm8988.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c index d3fea46d58e8..a5130d965146 100644 --- a/sound/soc/codecs/wm8988.c +++ b/sound/soc/codecs/wm8988.c @@ -687,16 +687,16 @@ static int wm8988_pcm_hw_params(struct snd_pcm_substream *substream, }
/* bit size */ - 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: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: iface |= 0x0008; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: iface |= 0x000c; 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/wm8990.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index b5c1f0f07058..03e43e3f395e 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c @@ -1073,16 +1073,16 @@ static int wm8990_hw_params(struct snd_pcm_substream *substream,
audio1 &= ~WM8990_AIF_WL_MASK; /* bit size */ - 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: audio1 |= WM8990_AIF_WL_20BITS; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: audio1 |= WM8990_AIF_WL_24BITS; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: audio1 |= WM8990_AIF_WL_32BITS; 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/wm8991.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c index b8fd284fc0c0..d0be89731cdb 100644 --- a/sound/soc/codecs/wm8991.c +++ b/sound/soc/codecs/wm8991.c @@ -1081,16 +1081,16 @@ static int wm8991_hw_params(struct snd_pcm_substream *substream,
audio1 &= ~WM8991_AIF_WL_MASK; /* bit size */ - 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: audio1 |= WM8991_AIF_WL_20BITS; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: audio1 |= WM8991_AIF_WL_24BITS; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: audio1 |= WM8991_AIF_WL_32BITS; 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/wm8993.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index f825dc04ebe1..93b14eda355a 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c @@ -1214,19 +1214,19 @@ static int wm8993_hw_params(struct snd_pcm_substream *substream, wm8993->tdm_slots, wm8993->tdm_width); wm8993->bclk *= wm8993->tdm_width * wm8993->tdm_slots; } else { - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: wm8993->bclk *= 16; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: wm8993->bclk *= 20; aif1 |= 0x8; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: wm8993->bclk *= 24; aif1 |= 0x10; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: wm8993->bclk *= 32; aif1 |= 0x18; 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/wm8994.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 39d8df040116..6cc0566dc29a 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -2815,19 +2815,19 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, }
bclk_rate = params_rate(params); - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: bclk_rate *= 16; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: bclk_rate *= 20; aif1 |= 0x20; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: bclk_rate *= 24; aif1 |= 0x40; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: bclk_rate *= 32; aif1 |= 0x60; break; @@ -2966,16 +2966,16 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream, return 0; }
- 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: aif1 |= 0x20; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: aif1 |= 0x40; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: aif1 |= 0x60; 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/wm8995.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 863a2c38bcb5..cae4ac5a5730 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c @@ -1597,21 +1597,21 @@ static int wm8995_hw_params(struct snd_pcm_substream *substream, return bclk_rate;
aif1 = 0; - 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: aif1 |= (0x1 << WM8995_AIF1_WL_SHIFT); break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: aif1 |= (0x2 << WM8995_AIF1_WL_SHIFT); break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: aif1 |= (0x3 << WM8995_AIF1_WL_SHIFT); break; default: dev_err(dai->dev, "Unsupported word length %u\n", - params_format(params)); + 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/wm9081.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index 185eb97769e7..0cdc9e2184ab 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c @@ -1029,19 +1029,19 @@ static int wm9081_hw_params(struct snd_pcm_substream *substream, /* Otherwise work out a BCLK from the sample size */ wm9081->bclk = 2 * wm9081->fs;
- switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: wm9081->bclk *= 16; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: wm9081->bclk *= 20; aif2 |= 0x4; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: wm9081->bclk *= 24; aif2 |= 0x8; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: wm9081->bclk *= 32; aif2 |= 0xc; 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/wm9713.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 2a9c6d11330c..bddee30a4bc7 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c @@ -953,16 +953,16 @@ static int wm9713_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_soc_codec *codec = dai->codec; u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0xfff3;
- 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: reg |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: + case 24: reg |= 0x0008; break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: reg |= 0x000c; break; }
On Thu, Jul 31, 2014 at 12:57:44PM +0100, Mark Brown wrote:
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
All looks good to me.
Acked-by: Charles Keepax ckeepax@opensource.wolfsonmicro.com
Thanks, Charles
participants (2)
-
Charles Keepax
-
Mark Brown