Commit e712bfca authored by Maciej S. Szmigiero's avatar Maciej S. Szmigiero Committed by Mark Brown

ASoC: codecs: use SNDRV_PCM_FMTBIT_* for format bitmask

snd_soc_pcm_stream.formats is a bitmask of SNDRV_PCM_FMTBIT_*,
not of SNDRV_PCM_FORMAT_* (which are sequential integers),
however some of ASoC CODEC drivers use these values instead.

Found out by sparse on 0-day kernel tester.
Signed-off-by: default avatarMaciej Szmigiero <mail@maciej.szmigiero.name>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b787f68c
...@@ -1187,16 +1187,16 @@ static struct snd_soc_dai_driver pm860x_dai[] = { ...@@ -1187,16 +1187,16 @@ static struct snd_soc_dai_driver pm860x_dai[] = {
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = PM860X_RATES, .rates = PM860X_RATES,
.formats = SNDRV_PCM_FORMAT_S16_LE | \ .formats = SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FORMAT_S18_3LE, SNDRV_PCM_FMTBIT_S18_3LE,
}, },
.capture = { .capture = {
.stream_name = "PCM Capture", .stream_name = "PCM Capture",
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = PM860X_RATES, .rates = PM860X_RATES,
.formats = SNDRV_PCM_FORMAT_S16_LE | \ .formats = SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FORMAT_S18_3LE, SNDRV_PCM_FMTBIT_S18_3LE,
}, },
.ops = &pm860x_pcm_dai_ops, .ops = &pm860x_pcm_dai_ops,
}, { }, {
...@@ -1208,16 +1208,16 @@ static struct snd_soc_dai_driver pm860x_dai[] = { ...@@ -1208,16 +1208,16 @@ static struct snd_soc_dai_driver pm860x_dai[] = {
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_48000, .rates = SNDRV_PCM_RATE_8000_48000,
.formats = SNDRV_PCM_FORMAT_S16_LE | \ .formats = SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FORMAT_S18_3LE, SNDRV_PCM_FMTBIT_S18_3LE,
}, },
.capture = { .capture = {
.stream_name = "I2S Capture", .stream_name = "I2S Capture",
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_48000, .rates = SNDRV_PCM_RATE_8000_48000,
.formats = SNDRV_PCM_FORMAT_S16_LE | \ .formats = SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FORMAT_S18_3LE, SNDRV_PCM_FMTBIT_S18_3LE,
}, },
.ops = &pm860x_i2s_dai_ops, .ops = &pm860x_i2s_dai_ops,
}, },
......
...@@ -321,7 +321,7 @@ static struct snd_soc_dai_driver stac9766_dai[] = { ...@@ -321,7 +321,7 @@ static struct snd_soc_dai_driver stac9766_dai[] = {
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_32000 | \ .rates = SNDRV_PCM_RATE_32000 | \
SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE,
}, },
/* alsa ops */ /* alsa ops */
.ops = &stac9766_dai_ops_digital, .ops = &stac9766_dai_ops_digital,
......
...@@ -998,8 +998,8 @@ static int wm8900_digital_mute(struct snd_soc_dai *codec_dai, int mute) ...@@ -998,8 +998,8 @@ static int wm8900_digital_mute(struct snd_soc_dai *codec_dai, int mute)
SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
#define WM8900_PCM_FORMATS \ #define WM8900_PCM_FORMATS \
(SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FORMAT_S24_LE) SNDRV_PCM_FMTBIT_S24_LE)
static const struct snd_soc_dai_ops wm8900_dai_ops = { static const struct snd_soc_dai_ops wm8900_dai_ops = {
.hw_params = wm8900_hw_params, .hw_params = wm8900_hw_params,
......
...@@ -1054,8 +1054,8 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, ...@@ -1054,8 +1054,8 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream,
SNDRV_PCM_RATE_48000) SNDRV_PCM_RATE_48000)
#define WM9713_PCM_FORMATS \ #define WM9713_PCM_FORMATS \
(SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FORMAT_S24_LE) SNDRV_PCM_FMTBIT_S24_LE)
static const struct snd_soc_dai_ops wm9713_dai_ops_hifi = { static const struct snd_soc_dai_ops wm9713_dai_ops_hifi = {
.prepare = ac97_hifi_prepare, .prepare = ac97_hifi_prepare,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment