summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8962.c
diff options
context:
space:
mode:
authorMark Brown2012-02-08 20:02:24 +0100
committerMark Brown2012-02-08 20:49:54 +0100
commit4c6c0b5eee572a24345fdd1fac6aa670cc937a3a (patch)
treefbbd56ac26eaf431d6d961d79221f217f3171b97 /sound/soc/codecs/wm8962.c
parentASoC: Convert kirkwood-openrd to use snd_soc_register_card() (diff)
downloadkernel-qcow2-linux-4c6c0b5eee572a24345fdd1fac6aa670cc937a3a.tar.gz
kernel-qcow2-linux-4c6c0b5eee572a24345fdd1fac6aa670cc937a3a.tar.xz
kernel-qcow2-linux-4c6c0b5eee572a24345fdd1fac6aa670cc937a3a.zip
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: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8962.c')
-rw-r--r--sound/soc/codecs/wm8962.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 25b6baed3a29..5e3795d7cdb8 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2634,6 +2634,9 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream,
int adctl3 = 0;
wm8962->bclk = snd_soc_params_to_bclk(params);
+ if (params_channels(params) == 1)
+ wm8962->bclk *= 2;
+
wm8962->lrclk = params_rate(params);
for (i = 0; i < ARRAY_SIZE(sr_vals); i++) {
@@ -3008,14 +3011,14 @@ static struct snd_soc_dai_driver wm8962_dai = {
.name = "wm8962",
.playback = {
.stream_name = "Playback",
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = WM8962_RATES,
.formats = WM8962_FORMATS,
},
.capture = {
.stream_name = "Capture",
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = WM8962_RATES,
.formats = WM8962_FORMATS,