ASoC: rsnd: add rsnd_src_get_in/out_rate()
SRC will convert rate, and then, CMD and SSI want to know its rate (= SRC.in / SRC.out) for each purpose. Current driver is supporting only Playback, but SRC+Capture support needs more flexibility. This patch adds rsnd_src_get_in/out_rate() for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
ab2049f9de
commit
cbf1494fbc
@@ -116,12 +116,26 @@ static u32 rsnd_src_convert_rate(struct rsnd_dai_stream *io,
|
||||
return convert_rate;
|
||||
}
|
||||
|
||||
unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
|
||||
struct rsnd_dai_stream *io,
|
||||
struct snd_pcm_runtime *runtime)
|
||||
unsigned int rsnd_src_get_rate(struct rsnd_priv *priv,
|
||||
struct rsnd_dai_stream *io,
|
||||
int is_in)
|
||||
{
|
||||
struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
|
||||
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
|
||||
unsigned int rate = 0;
|
||||
int is_play = rsnd_io_is_play(io);
|
||||
|
||||
/*
|
||||
*
|
||||
* Playback
|
||||
* runtime_rate -> [SRC] -> convert_rate
|
||||
*
|
||||
* Capture
|
||||
* convert_rate -> [SRC] -> runtime_rate
|
||||
*/
|
||||
|
||||
if (is_play == is_in)
|
||||
return runtime->rate;
|
||||
|
||||
/*
|
||||
* return convert rate if SRC is used,
|
||||
|
||||
Reference in New Issue
Block a user