]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: rsnd: src: Add SRC reset support for RZ/G3E
authorJohn Madieu <john.madieu.xa@bp.renesas.com>
Mon, 25 May 2026 11:02:28 +0000 (11:02 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 1 Jun 2026 14:30:25 +0000 (15:30 +0100)
The RZ/G3E SoC exposes a shared SCU reset controller used by all SRC
modules. Acquire it once and pass it through per-instance's
rsnd_mod_init() so it is wired into the rsnd_mod->rstc plumbing.

devm_reset_control_get_optional_shared() returns NULL when no reset
is described in DT, leaving existing R-Car generations unaffected.

Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20260525110230.4014435-17-john.madieu.xa@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/renesas/rcar/src.c

index 88ea9aad5caef2dcc8ad9f65c00340756e09bea3..cad15fcc37f2214e58c6604011562fce395403fa 100644 (file)
@@ -720,6 +720,7 @@ int rsnd_src_probe(struct rsnd_priv *priv)
 {
        struct device_node *node;
        struct device *dev = rsnd_priv_to_dev(priv);
+       struct reset_control *rstc;
        struct rsnd_src_ctrl *src_ctrl;
        struct rsnd_src *src;
        struct clk *clk;
@@ -772,6 +773,16 @@ int rsnd_src_probe(struct rsnd_priv *priv)
                goto rsnd_src_probe_done;
        }
 
+       /*
+        * Shared SCU reset for every SRC module; acquire once.
+        * R-Car platforms typically don't have SRC reset controls.
+        */
+       rstc = devm_reset_control_get_optional_shared(dev, "scu");
+       if (IS_ERR(rstc)) {
+               ret = PTR_ERR(rstc);
+               goto rsnd_src_probe_done;
+       }
+
        i = 0;
        for_each_child_of_node_scoped(node, np) {
                if (!of_device_is_available(np))
@@ -798,7 +809,7 @@ int rsnd_src_probe(struct rsnd_priv *priv)
                }
 
                ret = rsnd_mod_init(priv, rsnd_mod_get(src),
-                                   &rsnd_src_ops, clk, NULL, RSND_MOD_SRC, i);
+                                   &rsnd_src_ops, clk, rstc, RSND_MOD_SRC, i);
                if (ret)
                        goto rsnd_src_probe_done;