diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-07-28 18:58:29 -0700 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-06 17:56:13 +0100 |
commit | 4b4dab82340d969521f4f86108441cb597c8595d (patch) | |
tree | 25729bfd18f16bb735f53fe4deeee33577f6a71e /sound/soc/sh/rcar/ssi.c | |
parent | 70263cb474853c116f80713d468f3c17d805921c (diff) | |
download | kernel_goldelico_gta04-4b4dab82340d969521f4f86108441cb597c8595d.zip kernel_goldelico_gta04-4b4dab82340d969521f4f86108441cb597c8595d.tar.gz kernel_goldelico_gta04-4b4dab82340d969521f4f86108441cb597c8595d.tar.bz2 |
ASoC: rsnd: remove platform dai and add dai_id on platform setting
Current rsnd driver is using struct rsnd_dai_platform_info
so that indicate sound DAI information (playback/capture SSI ID).
But, SSI settings were also required separately.
Thus, platform settings was very un-understandable.
This patch adds dai_id to SSI
settings, and removed rsnd_dai_platform_info.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh/rcar/ssi.c')
-rw-r--r-- | sound/soc/sh/rcar/ssi.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 061ac7e..c48a6c7 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -87,6 +87,7 @@ struct rsnd_ssiu { #define rsnd_ssi_clk_from_parent(ssi) ((ssi)->parent) #define rsnd_rdai_is_clk_master(rdai) ((rdai)->clk_master) #define rsnd_ssi_mode_flags(p) ((p)->info->flags) +#define rsnd_ssi_dai_id(ssi) ((ssi)->info->dai_id) #define rsnd_ssi_to_ssiu(ssi)\ (((struct rsnd_ssiu *)((ssi) - rsnd_mod_id(&(ssi)->mod))) - 1) @@ -502,6 +503,27 @@ static struct rsnd_mod_ops rsnd_ssi_non_ops = { /* * ssi mod function */ +struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv, + int dai_id, int is_play) +{ + struct rsnd_ssi *ssi; + int i, has_play; + + is_play = !!is_play; + + for_each_rsnd_ssi(ssi, priv, i) { + if (rsnd_ssi_dai_id(ssi) != dai_id) + continue; + + has_play = !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_PLAY); + + if (is_play == has_play) + return &ssi->mod; + } + + return NULL; +} + struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id) { BUG_ON(id < 0 || id >= rsnd_ssi_nr(priv)); |