Commit 789e162a authored by Cheng-Yi Chiang's avatar Cheng-Yi Chiang Committed by Mark Brown

ASoC: rockchip: Fix mono capture

This reverts commit db51707b.
Revert "ASoC: rockchip: i2s: Support mono capture"

Previous discussion in

https://patchwork.kernel.org/patch/10147153/

explains the issue of the patch.
While device is configured as 1-ch, hardware is still
generating a 2-ch stream.
When user space reads the data and assumes it is a 1-ch stream,
the rate will be slower by 2x.

Revert the change so 1-ch is not supported.
User space can selectively take one channel data out of two channel
if 1-ch is preferred.
Currently, both channels record identical data.
Signed-off-by: default avatarCheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20190726044202.26866-1-cychiang@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e51b6980
...@@ -326,7 +326,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -326,7 +326,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
val |= I2S_CHN_4; val |= I2S_CHN_4;
break; break;
case 2: case 2:
case 1:
val |= I2S_CHN_2; val |= I2S_CHN_2;
break; break;
default: default:
...@@ -459,7 +458,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = { ...@@ -459,7 +458,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = {
}, },
.capture = { .capture = {
.stream_name = "Capture", .stream_name = "Capture",
.channels_min = 1, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000, .rates = SNDRV_PCM_RATE_8000_192000,
.formats = (SNDRV_PCM_FMTBIT_S8 | .formats = (SNDRV_PCM_FMTBIT_S8 |
...@@ -659,7 +658,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) ...@@ -659,7 +658,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
} }
if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) { if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
if (val >= 1 && val <= 8) if (val >= 2 && val <= 8)
soc_dai->capture.channels_max = val; soc_dai->capture.channels_max = val;
} }
......
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