diff mbox

rcar: src: skip disabled-SRC nodes

Message ID 2350728.BUGJNqvVzR@wasted.cogentembedded.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Sergei Shtylyov May 11, 2016, 10:36 p.m. UTC
The current device tree representation of the R-Car Sample Rate Converters
(SRC) assumes that they are numbered consecutively, starting from 0. Alas,
this  is not  the case with the R8A7794 SoC where SRC0 isn't present.  In
order to keep the existing  device trees working, I'm suggesting to use a
disabled node for SRC0.  Teach the SRC probe  to just skip disabled nodes.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against the 'for-next' branch of Mark Brown's 'sound.git' repo.

sound/soc/sh/rcar/src.c |    4 ++++
 sound/soc/sh/rcar/src.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Kuninori Morimoto May 12, 2016, 12:41 a.m. UTC | #1
Hi

> The current device tree representation of the R-Car Sample Rate Converters
> (SRC) assumes that they are numbered consecutively, starting from 0. Alas,
> this  is not  the case with the R8A7794 SoC where SRC0 isn't present.  In
> order to keep the existing  device trees working, I'm suggesting to use a
> disabled node for SRC0.  Teach the SRC probe  to just skip disabled nodes.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---

Maybe best solution is caring DT's @ number (src@0, src@1, ...) somehow
but, it makes rsnd_src_probe() and other src related function complex code.
This can keep simple code. 

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Sergei Shtylyov May 12, 2016, 7:30 p.m. UTC | #2
Hello.

    I'm now seeing I have unintended dash between words in the subject. Should 
I resend?

On 05/12/2016 03:41 AM, Kuninori Morimoto wrote:

>> The current device tree representation of the R-Car Sample Rate Converters
>> (SRC) assumes that they are numbered consecutively, starting from 0. Alas,
>> this  is not  the case with the R8A7794 SoC where SRC0 isn't present.  In
>> order to keep the existing  device trees working, I'm suggesting to use a
>> disabled node for SRC0.  Teach the SRC probe  to just skip disabled nodes.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> ---
>
> Maybe best solution is caring DT's @ number (src@0, src@1, ...) somehow

    Thought about it too... as well as adding an optional "reg" property.

> but, it makes rsnd_src_probe() and other src related function complex code.
> This can keep simple code.
>
> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

    Thank you.

MBR, Sergei
diff mbox

Patch

Index: sound/sound/soc/sh/rcar/src.c
===================================================================
--- sound.orig/sound/soc/sh/rcar/src.c
+++ sound/sound/soc/sh/rcar/src.c
@@ -572,6 +572,9 @@  int rsnd_src_probe(struct rsnd_priv *pri
 
 	i = 0;
 	for_each_child_of_node(node, np) {
+		if (!of_device_is_available(np))
+			goto skip;
+
 		src = rsnd_src_get(priv, i);
 
 		snprintf(name, RSND_SRC_NAME_SIZE, "%s.%d",
@@ -595,6 +598,7 @@  int rsnd_src_probe(struct rsnd_priv *pri
 		if (ret)
 			goto rsnd_src_probe_done;
 
+skip:
 		i++;
 	}