All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()
       [not found]           ` <HKXPR06MB10169A37666CDC1D7EBFF215D4DF0@HKXPR06MB1016.apcprd06.prod.outlook.com>
@ 2016-02-09  7:04             ` Kuninori Morimoto
  2016-02-09 10:10               ` Nguyen Viet Dung
  2016-02-09 18:20               ` Applied "ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2016-02-09  7:04 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linux-ALSA, NAOYA SHIIBA, Cao Minh Hiep, Yoshihiro Shimoda,
	Ryusuke Sakato, Liam Girdwood, TOSHIAKI KOMATSU, Yusuke Goda,
	Simon, osd2, 稲吉:人ソ,
	三浦さん,
	Nguyen Viet Dung

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

b4c83b171 ("ASoC: rsnd: add Multi channel support") added
Multi channel support, and current rsnd_ssi_is_multi_slave()'s check
method is !SSI equals SSIM1/2/3. But, SSI parent also hit to this macro.
Because of this reason, some stream which needs SSI parent clock
can't work correctly. This patch uses rsnd_ssi_multi_slaves() to
solve this issue. This issue was reported by Dung.

Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
>> Dung-san

Can you please check/test this patch ?

 sound/soc/sh/rcar/ssi.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 7ee89da..72e8420 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -96,7 +96,8 @@ struct rsnd_ssi {
 #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
 #define rsnd_ssi_mode_flags(p) ((p)->flags)
 #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io))
-#define rsnd_ssi_is_multi_slave(ssi, io) ((mod) != rsnd_io_to_mod_ssi(io))
+#define rsnd_ssi_is_multi_slave(mod, io) \
+	(rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod)))
 
 int rsnd_ssi_use_busif(struct rsnd_dai_stream *io)
 {
@@ -175,9 +176,6 @@ static int rsnd_ssi_irq_disable(struct rsnd_mod *ssi_mod)
 u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
 {
 	struct rsnd_mod *mod;
-	struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
-	struct rsnd_priv *priv = rsnd_io_to_priv(io);
-	struct device *dev = rsnd_priv_to_dev(priv);
 	enum rsnd_mod_type types[] = {
 		RSND_MOD_SSIM1,
 		RSND_MOD_SSIM2,
@@ -185,16 +183,6 @@ u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
 	};
 	int i, mask;
 
-	switch (runtime->channels) {
-	case 2: /* Multi channel is not needed for Stereo */
-		return 0;
-	case 6:
-		break;
-	default:
-		dev_err(dev, "unsupported channel\n");
-		return 0;
-	}
-
 	mask = 0;
 	for (i = 0; i < ARRAY_SIZE(types); i++) {
 		mod = rsnd_io_to_mod(io, types[i]);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()
  2016-02-09  7:04             ` [PATCH] ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves() Kuninori Morimoto
@ 2016-02-09 10:10               ` Nguyen Viet Dung
  2016-02-09 18:20               ` Applied "ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Nguyen Viet Dung @ 2016-02-09 10:10 UTC (permalink / raw)
  To: Kuninori Morimoto, Mark Brown
  Cc: Linux-ALSA, NAOYA SHIIBA, Cao Minh Hiep, Yoshihiro Shimoda,
	Ryusuke Sakato, Liam Girdwood, TOSHIAKI KOMATSU, Yusuke Goda,
	Simon, osd2, 稲吉:人ソ,
	三浦さん

Hi,

I have checked the problem(can't record) with this patch on Salvator-X 
board.
result is OK(can record correctly).

Best regards,
Nguyen Viet Dung

On 2016年02月09日 16:04, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> b4c83b171 ("ASoC: rsnd: add Multi channel support") added
> Multi channel support, and current rsnd_ssi_is_multi_slave()'s check
> method is !SSI equals SSIM1/2/3. But, SSI parent also hit to this macro.
> Because of this reason, some stream which needs SSI parent clock
> can't work correctly. This patch uses rsnd_ssi_multi_slaves() to
> solve this issue. This issue was reported by Dung.
>
> Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>>> Dung-san
> Can you please check/test this patch ?
>
>   sound/soc/sh/rcar/ssi.c | 16 ++--------------
>   1 file changed, 2 insertions(+), 14 deletions(-)
>
> diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
> index 7ee89da..72e8420 100644
> --- a/sound/soc/sh/rcar/ssi.c
> +++ b/sound/soc/sh/rcar/ssi.c
> @@ -96,7 +96,8 @@ struct rsnd_ssi {
>   #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
>   #define rsnd_ssi_mode_flags(p) ((p)->flags)
>   #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io))
> -#define rsnd_ssi_is_multi_slave(ssi, io) ((mod) != rsnd_io_to_mod_ssi(io))
> +#define rsnd_ssi_is_multi_slave(mod, io) \
> +	(rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod)))
>   
>   int rsnd_ssi_use_busif(struct rsnd_dai_stream *io)
>   {
> @@ -175,9 +176,6 @@ static int rsnd_ssi_irq_disable(struct rsnd_mod *ssi_mod)
>   u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
>   {
>   	struct rsnd_mod *mod;
> -	struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
> -	struct rsnd_priv *priv = rsnd_io_to_priv(io);
> -	struct device *dev = rsnd_priv_to_dev(priv);
>   	enum rsnd_mod_type types[] = {
>   		RSND_MOD_SSIM1,
>   		RSND_MOD_SSIM2,
> @@ -185,16 +183,6 @@ u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
>   	};
>   	int i, mask;
>   
> -	switch (runtime->channels) {
> -	case 2: /* Multi channel is not needed for Stereo */
> -		return 0;
> -	case 6:
> -		break;
> -	default:
> -		dev_err(dev, "unsupported channel\n");
> -		return 0;
> -	}
> -
>   	mask = 0;
>   	for (i = 0; i < ARRAY_SIZE(types); i++) {
>   		mod = rsnd_io_to_mod(io, types[i]);

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()" to the asoc tree
  2016-02-09  7:04             ` [PATCH] ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves() Kuninori Morimoto
  2016-02-09 10:10               ` Nguyen Viet Dung
@ 2016-02-09 18:20               ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2016-02-09 18:20 UTC (permalink / raw)
  To: Nguyen Viet Dung, Kuninori Morimoto, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From c308abe45e2a7bc58e22d9b6d04dccf76a1b2012 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Tue, 9 Feb 2016 07:04:09 +0000
Subject: [PATCH] ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses
 rsnd_ssi_multi_slaves()

b4c83b171 ("ASoC: rsnd: add Multi channel support") added
Multi channel support, and current rsnd_ssi_is_multi_slave()'s check
method is !SSI equals SSIM1/2/3. But, SSI parent also hit to this macro.
Because of this reason, some stream which needs SSI parent clock
can't work correctly. This patch uses rsnd_ssi_multi_slaves() to
solve this issue. This issue was reported by Dung.

Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/ssi.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 803e9ae65915..592505a4bc13 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -94,7 +94,8 @@ struct rsnd_ssi {
 #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
 #define rsnd_ssi_mode_flags(p) ((p)->flags)
 #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io))
-#define rsnd_ssi_is_multi_slave(ssi, io) ((mod) != rsnd_io_to_mod_ssi(io))
+#define rsnd_ssi_is_multi_slave(mod, io) \
+	(rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod)))
 
 int rsnd_ssi_use_busif(struct rsnd_dai_stream *io)
 {
@@ -167,9 +168,6 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,
 u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
 {
 	struct rsnd_mod *mod;
-	struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
-	struct rsnd_priv *priv = rsnd_io_to_priv(io);
-	struct device *dev = rsnd_priv_to_dev(priv);
 	enum rsnd_mod_type types[] = {
 		RSND_MOD_SSIM1,
 		RSND_MOD_SSIM2,
@@ -177,16 +175,6 @@ u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
 	};
 	int i, mask;
 
-	switch (runtime->channels) {
-	case 2: /* Multi channel is not needed for Stereo */
-		return 0;
-	case 6:
-		break;
-	default:
-		dev_err(dev, "unsupported channel\n");
-		return 0;
-	}
-
 	mask = 0;
 	for (i = 0; i < ARRAY_SIZE(types); i++) {
 		mod = rsnd_io_to_mod(io, types[i]);
-- 
2.7.0.rc3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-09 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <SG2PR06MB0919FB1461BF5A960DE5C49ED8C30@SG2PR06MB0919.apcprd06.prod.outlook.com>
     [not found] ` <56AB2BCC.1080704@jinso.co.jp>
     [not found]   ` <SG2PR06MB09199836989660B42BCEB45FD8DB0@SG2PR06MB0919.apcprd06.prod.outlook.com>
     [not found]     ` <SIXPR06MB1021ABCBB9FC9E3CEEE182BCD4DE0@SIXPR06MB1021.apcprd06.prod.outlook.com>
     [not found]       ` <SG2PR06MB0919CB54BA90164F6F7F982ED8DE0@SG2PR06MB0919.apcprd06.prod.outlook.com>
     [not found]         ` <56B0785D.2000604@jinso.co.jp>
     [not found]           ` <HKXPR06MB10169A37666CDC1D7EBFF215D4DF0@HKXPR06MB1016.apcprd06.prod.outlook.com>
2016-02-09  7:04             ` [PATCH] ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves() Kuninori Morimoto
2016-02-09 10:10               ` Nguyen Viet Dung
2016-02-09 18:20               ` Applied "ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.