Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'v6.20-rockchip-drivers1' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/drivers

Two fixes for the default-settings code for the General-Register-Files,
which sets system defaults for some settings like disabling the automatic
jtag/sdmmc switching.

One is a corrected register-offset and the other makes the code actually
look for all matched GRF instances, which it didn't do before.

* tag 'v6.20-rockchip-drivers1' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
soc: rockchip: grf: Support multiple grf to be handled
soc: rockchip: grf: Fix wrong RK3576_IOCGRF_MISC_CON definition

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+24 -25
+24 -25
drivers/soc/rockchip/grf.c
··· 146 146 .num_values = ARRAY_SIZE(rk3576_defaults_sys_grf), 147 147 }; 148 148 149 - #define RK3576_IOCGRF_MISC_CON 0x04F0 149 + #define RK3576_IOCGRF_MISC_CON 0x40F0 150 150 151 151 static const struct rockchip_grf_value rk3576_defaults_ioc_grf[] __initconst = { 152 152 { "jtag switching", RK3576_IOCGRF_MISC_CON, FIELD_PREP_WM16_CONST(BIT(1), 0) }, ··· 217 217 struct regmap *grf; 218 218 int ret, i; 219 219 220 - np = of_find_matching_node_and_match(NULL, rockchip_grf_dt_match, 221 - &match); 222 - if (!np) 223 - return -ENODEV; 224 - if (!match || !match->data) { 225 - pr_err("%s: missing grf data\n", __func__); 226 - of_node_put(np); 227 - return -EINVAL; 228 - } 220 + for_each_matching_node_and_match(np, rockchip_grf_dt_match, &match) { 221 + if (!of_device_is_available(np)) 222 + continue; 223 + if (!match || !match->data) { 224 + pr_err("%s: missing grf data\n", __func__); 225 + of_node_put(np); 226 + return -EINVAL; 227 + } 229 228 230 - grf_info = match->data; 229 + grf_info = match->data; 231 230 232 - grf = syscon_node_to_regmap(np); 233 - of_node_put(np); 234 - if (IS_ERR(grf)) { 235 - pr_err("%s: could not get grf syscon\n", __func__); 236 - return PTR_ERR(grf); 237 - } 231 + grf = syscon_node_to_regmap(np); 232 + if (IS_ERR(grf)) { 233 + pr_err("%s: could not get grf syscon\n", __func__); 234 + return PTR_ERR(grf); 235 + } 238 236 239 - for (i = 0; i < grf_info->num_values; i++) { 240 - const struct rockchip_grf_value *val = &grf_info->values[i]; 237 + for (i = 0; i < grf_info->num_values; i++) { 238 + const struct rockchip_grf_value *val = &grf_info->values[i]; 241 239 242 - pr_debug("%s: adjusting %s in %#6x to %#10x\n", __func__, 243 - val->desc, val->reg, val->val); 244 - ret = regmap_write(grf, val->reg, val->val); 245 - if (ret < 0) 246 - pr_err("%s: write to %#6x failed with %d\n", 247 - __func__, val->reg, ret); 240 + pr_debug("%s: adjusting %s in %#6x to %#10x\n", __func__, 241 + val->desc, val->reg, val->val); 242 + ret = regmap_write(grf, val->reg, val->val); 243 + if (ret < 0) 244 + pr_err("%s: write to %#6x failed with %d\n", 245 + __func__, val->reg, ret); 246 + } 248 247 } 249 248 250 249 return 0;