Commit 75fb63ae authored by Shawn Lin's avatar Shawn Lin Committed by Heiko Stuebner
Browse files

soc: rockchip: grf: Support multiple grf to be handled



Currently, only the first matched node will be handled. This leads
to jtag switching broken for RK3576, as rk3576-sys-grf is found before
rk3576-ioc-grf. Change the code to scan all the possible node to fix
the problem.

Fixes: e1aaecac ("soc: rockchip: grf: Add rk3576 default GRF values")
Cc: stable@vger.kernel.org
Cc: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: default avatarShawn Lin <shawn.lin@rock-chips.com>
Tested-by: default avatarMarco Schirrmeister <mschirrmeister@gmail.com>
Link: https://patch.msgid.link/1768524932-163929-3-git-send-email-shawn.lin@rock-chips.com


Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent 3cdc30c4
Loading
Loading
Loading
Loading
+27 −28
Original line number Diff line number Diff line
@@ -217,10 +217,9 @@ static int __init rockchip_grf_init(void)
	struct regmap *grf;
	int ret, i;

	np = of_find_matching_node_and_match(NULL, rockchip_grf_dt_match,
					     &match);
	if (!np)
		return -ENODEV;
	for_each_matching_node_and_match(np, rockchip_grf_dt_match, &match) {
		if (!of_device_is_available(np))
			continue;
		if (!match || !match->data) {
			pr_err("%s: missing grf data\n", __func__);
			of_node_put(np);
@@ -230,7 +229,6 @@ static int __init rockchip_grf_init(void)
		grf_info = match->data;

		grf = syscon_node_to_regmap(np);
	of_node_put(np);
		if (IS_ERR(grf)) {
			pr_err("%s: could not get grf syscon\n", __func__);
			return PTR_ERR(grf);
@@ -246,6 +244,7 @@ static int __init rockchip_grf_init(void)
				pr_err("%s: write to %#6x failed with %d\n",
					__func__, val->reg, ret);
		}
	}

	return 0;
}