ASoC: rsnd: control kctrl items acceptance anytime/runtime

Current SRC/DVC/CTU adds kctrl for each device,
and SRC can adjust its sampling rate during playback,
thus, this feature should be enabled only *during* playback.
This patch controls it more clearly

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto
2017-06-07 00:11:48 +00:00
committed by Mark Brown
parent 8cce431aa2
commit f0b04d8b44
5 changed files with 40 additions and 6 deletions

View File

@@ -598,6 +598,7 @@ struct rsnd_kctrl_cfg {
unsigned int size;
u32 *val;
const char * const *texts;
int (*accept)(struct rsnd_dai_stream *io);
void (*update)(struct rsnd_dai_stream *io, struct rsnd_mod *mod);
struct rsnd_dai_stream *io;
struct snd_card *card;
@@ -615,12 +616,15 @@ struct rsnd_kctrl_cfg_s {
u32 val;
};
int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io);
int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io);
struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg);
struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg);
int rsnd_kctrl_new(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct snd_soc_pcm_runtime *rtd,
const unsigned char *name,
int (*accept)(struct rsnd_dai_stream *io),
void (*update)(struct rsnd_dai_stream *io,
struct rsnd_mod *mod),
struct rsnd_kctrl_cfg *cfg,
@@ -628,16 +632,16 @@ int rsnd_kctrl_new(struct rsnd_mod *mod,
int size,
u32 max);
#define rsnd_kctrl_new_m(mod, io, rtd, name, update, cfg, size, max) \
rsnd_kctrl_new(mod, io, rtd, name, update, rsnd_kctrl_init_m(cfg), \
#define rsnd_kctrl_new_m(mod, io, rtd, name, accept, update, cfg, size, max) \
rsnd_kctrl_new(mod, io, rtd, name, accept, update, rsnd_kctrl_init_m(cfg), \
NULL, size, max)
#define rsnd_kctrl_new_s(mod, io, rtd, name, update, cfg, max) \
rsnd_kctrl_new(mod, io, rtd, name, update, rsnd_kctrl_init_s(cfg), \
#define rsnd_kctrl_new_s(mod, io, rtd, name, accept, update, cfg, max) \
rsnd_kctrl_new(mod, io, rtd, name, accept, update, rsnd_kctrl_init_s(cfg), \
NULL, 1, max)
#define rsnd_kctrl_new_e(mod, io, rtd, name, update, cfg, texts) \
rsnd_kctrl_new(mod, io, rtd, name, update, rsnd_kctrl_init_s(cfg), \
#define rsnd_kctrl_new_e(mod, io, rtd, name, accept, update, cfg, texts) \
rsnd_kctrl_new(mod, io, rtd, name, accept, update, rsnd_kctrl_init_s(cfg), \
texts, 1, ARRAY_SIZE(texts))
/*