RE: [PATCH v2 3/3] arm64: dts: renesas: r9a09g047e57-smarc: Enable CAN Transceiver

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

 



Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: 14 April 2025 16:43
> Subject: Re: [PATCH v2 3/3] arm64: dts: renesas: r9a09g047e57-smarc: Enable CAN Transceiver
> 
> Hi Biju,
> 
> On Thu, 20 Mar 2025 at 17:41, Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > Enable TCAN1046V-Q1 CAN Transceiver populated on RZ/G3E SMARC EVK by
> > modelling it as two instances of tcan1042.
> >
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> > ---
> > v1->v2:
> >  * Replaced GPIO hog with CAN Transceiver.
> 
> Thanks for the update!
> 
> > --- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > +++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > @@ -8,6 +8,8 @@
> >  /dts-v1/;
> >
> >  /* Switch selection settings */
> > +#define SW_GPIO8_CAN0_STB      0
> > +#define SW_GPIO9_CAN1_STB      0
> >  #define SW_LCD_EN              0
> >  #define SW_PDM_EN              0
> >  #define SW_SD0_DEV_SEL         0
> > @@ -42,16 +44,36 @@ &canfd {
> >  #if (!SW_PDM_EN)
> >         channel1 {
> >                 status = "okay";
> > +#if (!SW_LCD_EN) && (SW_GPIO9_CAN1_STB)
> > +               phys = <&can_transceiver1>; #endif
> >         };
> >  #endif
> 
> Do you need these two levels of #ifdefs?  If CAN-FD doesn't work without the transceivers, wouldn't
> you just need a single #ifdef with the logical AND of all conditions above around the channel1
> subnode?

By default, the switch is set to GPIO8_PMOD, so, CAN_STB pulled low and the transceiver driver
is not used.

If any system(for eg: low power design) want to make use of STB, then change the SW
and macro and then make use of transceiver driver.

> 
> Am I missing something?
> 
> >
> >  #if (!SW_LCD_EN)
> >         channel4 {
> >                 status = "okay";
> > +#if (SW_GPIO8_CAN0_STB)
> > +               phys = <&can_transceiver0>; #endif
> 
> Same for the second channel.
> 
> 
> >         };
> >  #endif
> >  };
> >
> > +#if (!SW_LCD_EN) && (SW_GPIO8_CAN0_STB)
> 
> Related, doesn't this need !SW_PDM_EN, too?

SW_PDM_EN is only used for MUX between CAN1 Rx/Tx and PDM. It is not related
to CAN0 Rx/Tx.

Cheers,
Biju




[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