[PATCH v4 1/8] soc: renesas: rz-sysc: Add syscon/regmap support
Geert Uytterhoeven
geert at linux-m68k.org
Fri Aug 8 02:29:06 PDT 2025
Hi Claudiu,
On Fri, 8 Aug 2025 at 08:18, Claudiu <claudiu.beznea at tuxon.dev> wrote:
> From: John Madieu <john.madieu.xa at bp.renesas.com>
>
> The RZ/G3E system controller has various registers that control or report
> some properties specific to individual IPs. The regmap is registered as a
> syscon device to allow these IP drivers to access the registers through the
> regmap API.
>
> As other RZ SoCs might have custom read/write callbacks or max-offsets,
> register a custom regmap configuration.
>
> Signed-off-by: John Madieu <john.madieu.xa at bp.renesas.com>
> [claudiu.beznea:
> - do not check the match->data validity in rz_sysc_probe() as it is
> always valid
> - dinamically allocate regmap_cfg]
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj at bp.renesas.com>
> ---
>
> Changes in v4:
> - adjusted the patch description by dropping "add" from
> "add register a custom regmap configuration"
> - updated the list of changes from Claudiu Beznea
> - dynamically allocate the regmap_config as proposed at [2]
> - this patch is needed for proper function of USB (as proposed in this
> series) that being the reason it is introduced here, as well
>
> [2] https://lore.kernel.org/all/CAMuHMdVyf3Xtpw=LWHrnD2CVQX4xYm=FBHvY_dx9OesHDz5zNg@mail.gmail.com/
Thanks for the update!
> --- a/drivers/soc/renesas/rz-sysc.c
> +++ b/drivers/soc/renesas/rz-sysc.c
=
> @@ -117,7 +125,26 @@ static int rz_sysc_probe(struct platform_device *pdev)
> return PTR_ERR(sysc->base);
>
> sysc->dev = dev;
> - return rz_sysc_soc_init(sysc, match);
> + ret = rz_sysc_soc_init(sysc, match);
> + if (ret)
> + return ret;
> +
> + regmap_cfg = devm_kzalloc(dev, sizeof(*regmap_cfg), GFP_KERNEL);
> + if (!regmap_cfg)
> + return -ENOMEM;
Is there any specific reason you decided to allocate regmap_cfg
separately, instead of embedding it into struct rz_sysc?
The rest LGTM.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
More information about the linux-phy
mailing list