| From 6d5caf063ad0b3e1040350212705d24f056d6939 Mon Sep 17 00:00:00 2001 |
| From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Date: Thu, 23 Jan 2014 18:41:17 -0800 |
| Subject: ASoC: rsnd: add rsnd_ssi_is_play() |
| |
| SCU needs SSI direction if Gen2. |
| Add rsnd_ssi_is_play() function for it. |
| |
| Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Signed-off-by: Mark Brown <broonie@linaro.org> |
| (cherry picked from commit 32f27ebf9b625df610c12408ea15bae37be75eaf) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| sound/soc/sh/rcar/rsnd.h | 1 + |
| sound/soc/sh/rcar/ssi.c | 11 +++++++++-- |
| 2 files changed, 10 insertions(+), 2 deletions(-) |
| |
| diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h |
| index 39914558e857..b1874eb71436 100644 |
| --- a/sound/soc/sh/rcar/rsnd.h |
| +++ b/sound/soc/sh/rcar/rsnd.h |
| @@ -321,5 +321,6 @@ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); |
| struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv, |
| int dai_id, int is_play); |
| int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); |
| +int rsnd_ssi_is_play(struct rsnd_mod *mod); |
| |
| #endif |
| diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c |
| index dc72439da58d..bae309c9f0fb 100644 |
| --- a/sound/soc/sh/rcar/ssi.c |
| +++ b/sound/soc/sh/rcar/ssi.c |
| @@ -494,7 +494,7 @@ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv, |
| if (rsnd_ssi_dai_id(ssi) != dai_id) |
| continue; |
| |
| - has_play = !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_PLAY); |
| + has_play = rsnd_ssi_is_play(&ssi->mod); |
| |
| if (is_play == has_play) |
| return &ssi->mod; |
| @@ -518,6 +518,13 @@ int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod) |
| return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_CLK_PIN_SHARE); |
| } |
| |
| +int rsnd_ssi_is_play(struct rsnd_mod *mod) |
| +{ |
| + struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); |
| + |
| + return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_PLAY); |
| +} |
| + |
| static void rsnd_ssi_parent_clk_setup(struct rsnd_priv *priv, struct rsnd_ssi *ssi) |
| { |
| if (!rsnd_ssi_is_pin_sharing(&ssi->mod)) |
| @@ -582,7 +589,7 @@ int rsnd_ssi_probe(struct platform_device *pdev, |
| if (pinfo->dma_id > 0) { |
| ret = rsnd_dma_init( |
| priv, rsnd_mod_to_dma(&ssi->mod), |
| - (rsnd_ssi_mode_flags(ssi) & RSND_SSI_PLAY), |
| + rsnd_ssi_is_play(&ssi->mod), |
| pinfo->dma_id, |
| rsnd_ssi_dma_inquiry, |
| rsnd_ssi_dma_complete); |
| -- |
| 2.1.2 |
| |