diff mbox series

[4/5] ASoC: rsnd: R-Car Gen1/Gen2 exception

Message ID 87wmpga4ds.wl-kuninori.morimoto.gx@renesas.com
State Accepted
Commit 5be0e7f7f275aa5f05d8708db021cef0fed749d1
Headers show
Series ASoC: rsnd: reg cleanup | expand

Commit Message

Kuninori Morimoto April 2, 2024, 2:24 a.m. UTC
Renesas Sound driver is using rsnd_is_genX() macro to handling
difference. We can use "grep rsnd_is_gen" to find-out difference for
each SoC today.

In general, driver uses flag to handling SoC difference. But in Renesas
Sound case, the differences are very specific, if you try to make it
general, the code will become be very complicated.

Some of them can use flag to handling, but we can find-out all diffence
by using "grep rsnd_is_gen" today. It is not so good, but not so bad so
far. So we will keep current style for a while.

This patch cares Gen1/Gen2 exception by using negative handling to makes no
more update for this part when we support Gen5 or later.

	- if (rsnd_is_gen3() || rsnd_is_gen4() || rsnd_is_gen5() || ...)
	+ if (!rsnd_is_gen1() && !rsnd_is_gen2())

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 0b1aa23c1189..6bc7027ed4db 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1512,7 +1512,7 @@  static int rsnd_dai_probe(struct rsnd_priv *priv)
 				continue;
 			for_each_endpoint_of_node(ports, dai_np) {
 				__rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i);
-				if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) {
+				if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) {
 					rdai = rsnd_rdai_get(priv, dai_i);
 
 					rsnd_parse_connect_graph(priv, &rdai->playback, dai_np);
@@ -1531,7 +1531,7 @@  static int rsnd_dai_probe(struct rsnd_priv *priv)
 
 			for_each_child_of_node(node, dai_np) {
 				__rsnd_dai_probe(priv, dai_np, np, dai_i, dai_i);
-				if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) {
+				if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) {
 					rdai = rsnd_rdai_get(priv, dai_i);
 
 					rsnd_parse_connect_simple(priv, &rdai->playback, dai_np);