Commit 66287def authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: fixup 6ch settings to 8ch

rsnd need to use 8ch clock settings for 6ch for TDM.
Otherwise, it can't work correctly.
This patch fixup it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 01c83276
...@@ -300,6 +300,18 @@ int rsnd_runtime_channel_after_ctu_with_params(struct rsnd_dai_stream *io, ...@@ -300,6 +300,18 @@ int rsnd_runtime_channel_after_ctu_with_params(struct rsnd_dai_stream *io,
return chan; return chan;
} }
int rsnd_channel_normalization(int chan)
{
if ((chan > 8) || (chan < 0))
return 0;
/* TDM Extend Mode needs 8ch */
if (chan == 6)
chan = 8;
return chan;
}
int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io, int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
...@@ -312,11 +324,7 @@ int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io, ...@@ -312,11 +324,7 @@ int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io,
if (rsnd_runtime_is_multi_ssi(io)) if (rsnd_runtime_is_multi_ssi(io))
chan /= rsnd_rdai_ssi_lane_get(rdai); chan /= rsnd_rdai_ssi_lane_get(rdai);
/* TDM Extend Mode needs 8ch */ return rsnd_channel_normalization(chan);
if (chan == 6)
chan = 8;
return chan;
} }
int rsnd_runtime_is_multi_ssi(struct rsnd_dai_stream *io) int rsnd_runtime_is_multi_ssi(struct rsnd_dai_stream *io)
......
...@@ -446,6 +446,7 @@ void rsnd_parse_connect_common(struct rsnd_dai *rdai, ...@@ -446,6 +446,7 @@ void rsnd_parse_connect_common(struct rsnd_dai *rdai,
struct device_node *playback, struct device_node *playback,
struct device_node *capture); struct device_node *capture);
int rsnd_channel_normalization(int chan);
#define rsnd_runtime_channel_original(io) \ #define rsnd_runtime_channel_original(io) \
rsnd_runtime_channel_original_with_params(io, NULL) rsnd_runtime_channel_original_with_params(io, NULL)
int rsnd_runtime_channel_original_with_params(struct rsnd_dai_stream *io, int rsnd_runtime_channel_original_with_params(struct rsnd_dai_stream *io,
......
...@@ -303,6 +303,8 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, ...@@ -303,6 +303,8 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
if (rsnd_runtime_is_tdm_split(io)) if (rsnd_runtime_is_tdm_split(io))
chan = rsnd_io_converted_chan(io); chan = rsnd_io_converted_chan(io);
chan = rsnd_channel_normalization(chan);
main_rate = rsnd_ssi_clk_query(rdai, rate, chan, &idx); main_rate = rsnd_ssi_clk_query(rdai, rate, chan, &idx);
if (!main_rate) { if (!main_rate) {
dev_err(dev, "unsupported clock rate\n"); dev_err(dev, "unsupported clock rate\n");
......
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