Commit 4c6c0b5e authored by Mark Brown's avatar Mark Brown

ASoC: wm8962: Support mono playback and record

Make sure we generate enough BCLKs for I2S style modes by always having
a minimum of two channels worth of clocks for the BCLK.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6d6761aa
...@@ -2634,6 +2634,9 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream, ...@@ -2634,6 +2634,9 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream,
int adctl3 = 0; int adctl3 = 0;
wm8962->bclk = snd_soc_params_to_bclk(params); wm8962->bclk = snd_soc_params_to_bclk(params);
if (params_channels(params) == 1)
wm8962->bclk *= 2;
wm8962->lrclk = params_rate(params); wm8962->lrclk = params_rate(params);
for (i = 0; i < ARRAY_SIZE(sr_vals); i++) { for (i = 0; i < ARRAY_SIZE(sr_vals); i++) {
...@@ -3008,14 +3011,14 @@ static struct snd_soc_dai_driver wm8962_dai = { ...@@ -3008,14 +3011,14 @@ static struct snd_soc_dai_driver wm8962_dai = {
.name = "wm8962", .name = "wm8962",
.playback = { .playback = {
.stream_name = "Playback", .stream_name = "Playback",
.channels_min = 2, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM8962_RATES, .rates = WM8962_RATES,
.formats = WM8962_FORMATS, .formats = WM8962_FORMATS,
}, },
.capture = { .capture = {
.stream_name = "Capture", .stream_name = "Capture",
.channels_min = 2, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = WM8962_RATES, .rates = WM8962_RATES,
.formats = WM8962_FORMATS, .formats = WM8962_FORMATS,
......
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