[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdV=EW4YbEBiXH2p0SeC5Kw-YmYWuQwsudpGgM63pgqcfw@mail.gmail.com>
Date: Tue, 23 Dec 2025 14:45:15 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>
Cc: Vinod Koul <vkoul@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Magnus Damm <magnus.damm@...il.com>, Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>, Johan Hovold <johan@...nel.org>,
Biju Das <biju.das.jz@...renesas.com>, dmaengine@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH v2 2/6] dmaengine: sh: rz_dmac: make register_dma_req() chip-specific
Hi Cosmin,
On Mon, 1 Dec 2025 at 13:52, Cosmin Tanislav
<cosmin-gabriel.tanislav.xa@...esas.com> wrote:
> The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs use a
> completely different ICU unit compared to RZ/V2H, which requires a
> separate implementation.
>
> To prepare for adding support for these SoCs, add a chip-specific
> structure and put a pointer to the rzv2h_icu_register_dma_req() function
> in the .register_dma_req field of the chip-specific structure to allow
> for other implementations. Do the same for the default request value,
> RZV2H_ICU_DMAC_REQ_NO_DEFAULT.
>
> While at it, factor out the logic that calls .register_dma_req() or
> rz_dmac_set_dmars_register() into a separate function to remove some
> code duplication. Since the default values are different between the
> two, use -1 for designating that the default value should be used.
>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>
Thanks for your patch!
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
You can find a few non-functional nits below...
> --- a/drivers/dma/sh/rz-dmac.c
> +++ b/drivers/dma/sh/rz-dmac.c
> @@ -95,9 +95,16 @@ struct rz_dmac_icu {
> u8 dmac_index;
> };
>
> +struct rz_dmac_info {
> + void (*register_dma_req)(struct platform_device *icu_dev, u8 dmac_index,
> + u8 dmac_channel, u16 req_no);
icu_register_dma_req, to make clear this is ICU-specific?
> + u16 dma_req_no_default;
default_dma_req_no, to avoid confusion between literal "no" and an
abbreviation of "number"?
> +};
> +
> @@ -1067,9 +1068,18 @@ static void rz_dmac_remove(struct platform_device *pdev)
> pm_runtime_disable(&pdev->dev);
> }
>
> +static const struct rz_dmac_info rz_dmac_v2h_info = {
> + .register_dma_req = rzv2h_icu_register_dma_req,
> + .dma_req_no_default = RZV2H_ICU_DMAC_REQ_NO_DEFAULT,
Since this is the only remaining user of RZV2H_ICU_DMAC_REQ_NO_DEFAULT,
and this structure does specify hardware, perhaps just hardcode 0x3ff?
> +};
> +
> +static const struct rz_dmac_info rz_dmac_common_info = {
rz_dmac_classic_info, as this is not really common to all variants?
I am open for a different name ;-)
> + .dma_req_no_default = 0,
> +};
> +
> static const struct of_device_id of_rz_dmac_match[] = {
> - { .compatible = "renesas,r9a09g057-dmac", },
> - { .compatible = "renesas,rz-dmac", },
> + { .compatible = "renesas,r9a09g057-dmac", .data = &rz_dmac_v2h_info },
> + { .compatible = "renesas,rz-dmac", .data = &rz_dmac_common_info },
> { /* Sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, of_rz_dmac_match);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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
Powered by blists - more mailing lists