summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorKatsuhiro Suzuki <suzuki.katsuhiro@socionext.com>2018-02-23 15:17:01 +0300
committerMark Brown <broonie@kernel.org>2018-02-26 13:19:02 +0300
commit398fa30bf138fd4b928dc11422abfe5486aaa8fe (patch)
tree360e601fbdd5614beb46dbd9748bcb27cd24779d /sound
parent24745dca8e7e17c20b6cf2bfb94a9acd09dce1b9 (diff)
downloadlinux-398fa30bf138fd4b928dc11422abfe5486aaa8fe.tar.xz
ASoC: uniphier: fix broken sound if use SRC in replay
This patch fixes settings for ports with SRC. These ports need to set the fixed audio rate and clock. If not, the SRC outputs broken sound. Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/uniphier/aio-core.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/soc/uniphier/aio-core.c b/sound/soc/uniphier/aio-core.c
index 1e5f053d9f6b..1711361fc0c2 100644
--- a/sound/soc/uniphier/aio-core.c
+++ b/sound/soc/uniphier/aio-core.c
@@ -501,7 +501,7 @@ int aio_port_set_clk(struct uniphier_aio_sub *sub)
OPORTMXCTR2_MSSEL_MASTER |
OPORTMXCTR2_EXTLSIFSSEL_36 |
OPORTMXCTR2_DACCKSEL_1_2;
- } else {
+ } else if (sub->swm->type == PORT_TYPE_SPDIF) {
if (sub->aio->pll_out >= ARRAY_SIZE(v_pll)) {
dev_err(dev, "PLL(%d) is invalid\n",
sub->aio->pll_out);
@@ -521,6 +521,11 @@ int aio_port_set_clk(struct uniphier_aio_sub *sub)
v |= OPORTMXCTR2_EXTLSIFSSEL_24;
break;
}
+ } else {
+ v = OPORTMXCTR2_ACLKSEL_A1 |
+ OPORTMXCTR2_MSSEL_MASTER |
+ OPORTMXCTR2_EXTLSIFSSEL_36 |
+ OPORTMXCTR2_DACCKSEL_1_2;
}
regmap_write(r, OPORTMXCTR2(sub->swm->oport.map), v);
} else {
@@ -550,11 +555,19 @@ int aio_port_set_param(struct uniphier_aio_sub *sub, int pass_through,
const struct snd_pcm_hw_params *params)
{
struct regmap *r = sub->aio->chip->regmap;
+ unsigned int rate;
u32 v;
int ret;
if (!pass_through) {
- ret = aio_port_set_rate(sub, params_rate(params));
+ if (sub->swm->type == PORT_TYPE_EVE ||
+ sub->swm->type == PORT_TYPE_CONV) {
+ rate = 48000;
+ } else {
+ rate = params_rate(params);
+ }
+
+ ret = aio_port_set_rate(sub, rate);
if (ret)
return ret;