Re: [PATCH v5 4/4] i3c: master: Add basic driver for the Renesas I3C controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

On Thu, 24 Jul 2025 at 11:41, Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> Add a basic driver for the I3C controller found in Renesas RZ/G3S and
> G3E SoCs. Support I3C pure busses (tested with two targets) and mixed
> busses (two I3C devices plus various I2C targets). DAA and communication
> with temperature sensors worked reliably at various speeds.
>
> Missing features such as IBI, HotJoin, and target mode will be added
> incrementally.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> Tested-by: Tommaso Merciai <tommaso.merciai.xr@xxxxxxxxxxxxxx>
> Reviewed-by: Frank Li <Frank.Li@xxxxxxx>

Thanks for your patch!

Just a few stylistic comments for now...

> --- /dev/null
> +++ b/drivers/i3c/master/renesas-i3c.c

> +#define REFCKCTL               0x70
> +#define  REFCKCTL_IREFCKS(x)   FIELD_PREP(GENMASK(2, 0), x)

Interesting... Usually the FIELD_*() macros are used like this:

    #define REFCKCTL_IREFCKS    GENMASK(2, 0)

    x = readl(base + REFCKCTL);
    a = FIELD_GET(REFCKCTL_IREFCKS, x);

    y = FIELD_PREP(REFCKCTL_IREFCKS, b);
    writel(y, base + REFCKCTL);

That way you do not have to duplicate "GENMASK(2, 0)" in the read and
write marshalling macros.  But I do agree this driver does not seem
to have register fields that are both read and written ;-)

> +static inline u32 renesas_readl(void __iomem *base, u32 reg)
> +{
> +       return readl(base + reg);
> +}
> +
> +static inline void renesas_writel(void __iomem *base, u32 reg, u32 val)
> +{
> +       writel(val, base + reg);
> +}

Why not use readl() and writel() directly?
To make it easier to add debug prints during initial development?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux