Skip to content

Commit c3fc002

Browse files
morimotobroonie
authored andcommitted
ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime()
rsnd_kctrl_accept_runtime() (1) is used for runtime convert rate (= Synchronous SRC Mode). Now, rsnd driver has 2 kctrls for it (A): "SRC Out Rate Switch" (B): "SRC Out Rate" // it calls (1) (A): can be called anytime (B): can be called only runtime, and will indicate warning if it was used at non-runtime. To use runtime convert rate (= Synchronous SRC Mode), user might uses command in below order. (X): > amixer set "SRC Out Rate" on > aplay xxx.wav & (Y): > amixer set "SRC Out Rate" 48010 // convert rate to 48010Hz (Y): calls B (X): calls both A and B. In this case, when user calls (X), it calls both (A) and (B), but it is not yet start running. So, (B) will indicate warning. This warning was added by commit b5c0886 ("ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime()"), but the message sounds like the operation was not correct. Let's update warning message. The message is very SRC specific, implement it in src.c Signed-off-by: Kuninori Morimoto <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 796106e commit c3fc002

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

sound/soc/renesas/rcar/core.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,20 +1770,6 @@ int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io)
17701770
return 1;
17711771
}
17721772

1773-
int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io)
1774-
{
1775-
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
1776-
struct rsnd_priv *priv = rsnd_io_to_priv(io);
1777-
struct device *dev = rsnd_priv_to_dev(priv);
1778-
1779-
if (!runtime) {
1780-
dev_warn(dev, "Can't update kctrl when idle\n");
1781-
return 0;
1782-
}
1783-
1784-
return 1;
1785-
}
1786-
17871773
struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg)
17881774
{
17891775
cfg->cfg.val = cfg->val;

sound/soc/renesas/rcar/rsnd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,6 @@ struct rsnd_kctrl_cfg_s {
742742
#define rsnd_kctrl_vals(x) ((x).val) /* = (x).cfg.val[0] */
743743

744744
int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io);
745-
int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io);
746745
struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg);
747746
struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg);
748747
int rsnd_kctrl_new(struct rsnd_mod *mod,

sound/soc/renesas/rcar/src.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,22 @@ static irqreturn_t rsnd_src_interrupt(int irq, void *data)
531531
return IRQ_HANDLED;
532532
}
533533

534+
static int rsnd_src_kctrl_accept_runtime(struct rsnd_dai_stream *io)
535+
{
536+
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
537+
538+
if (!runtime) {
539+
struct rsnd_priv *priv = rsnd_io_to_priv(io);
540+
struct device *dev = rsnd_priv_to_dev(priv);
541+
542+
dev_warn(dev, "\"SRC Out Rate\" can use during running\n");
543+
544+
return 0;
545+
}
546+
547+
return 1;
548+
}
549+
534550
static int rsnd_src_probe_(struct rsnd_mod *mod,
535551
struct rsnd_dai_stream *io,
536552
struct rsnd_priv *priv)
@@ -594,7 +610,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod,
594610
rsnd_io_is_play(io) ?
595611
"SRC Out Rate" :
596612
"SRC In Rate",
597-
rsnd_kctrl_accept_runtime,
613+
rsnd_src_kctrl_accept_runtime,
598614
rsnd_src_set_convert_rate,
599615
&src->sync, 192000);
600616

0 commit comments

Comments
 (0)