Re: [PATCH 1/6] can: rcar_canfd: rcar_canfd_probe: Add struct rcar_canfd_hw_info to driver data

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

 



Hi Biju,

On Sat, Oct 22, 2022 at 1:02 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> The CAN FD IP found on RZ/G2L SoC has some HW features different to that
> of R-Car. For example, it has multiple resets and multiple IRQs for global
> and channel interrupts. Also, it does not have ECC error flag registers
> and clk post divider present on R-Car. Similarly, R-Car V3U has 8 channels
> whereas other SoCs has only 2 channels.
>
> This patch adds the struct rcar_canfd_hw_info to take care of the
> HW feature differences and driver data present on both IPs. It also
> replaces the driver data chip type with struct rcar_canfd_hw_info by
> moving chip type to it.
>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c

> @@ -591,10 +595,22 @@ static const struct can_bittiming_const rcar_canfd_bittiming_const = {
>         .brp_inc = 1,
>  };
>
> +static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
> +       .chip_id = RENESAS_RCAR_GEN3,
> +};
> +
> +static const struct rcar_canfd_hw_info rzg2l_hw_info = {
> +       .chip_id = RENESAS_RZG2L,
> +};
> +
> +static const struct rcar_canfd_hw_info r8a779a0_hw_info = {
> +       .chip_id = RENESAS_R8A779A0,
> +};
> +
>  /* Helper functions */
>  static inline bool is_v3u(struct rcar_canfd_global *gpriv)
>  {
> -       return gpriv->chip_id == RENESAS_R8A779A0;
> +       return gpriv->info == &r8a779a0_hw_info;

"return gpriv->info->chip_id == RENESAS_R8A779A0;" would match all
the other changes you make. But I see why you did it this way...
((most) users of is_v3u() are not converted to feature flags (yet) ;-)

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

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