[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241114-hysterical-toucan-of-storm-722706-mkl@pengutronix.de>
Date: Thu, 14 Nov 2024 10:24:35 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Sean Nyekjaer <sean@...nix.com>
Cc: Vincent Mailhol <mailhol.vincent@...adoo.fr>,
linux-can@...r.kernel.org, linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>
Subject: Re: [PATCH can-next v3 2/2] can: tcan4x5x: add option for selecting
nWKRQ voltage
On 14.11.2024 10:04:31, Sean Nyekjaer wrote:
> Hi Vincent,
>
> On Thu, Nov 14, 2024 at 05:59:54PM +0100, Vincent Mailhol wrote:
> > Hi Sean,
> >
> > I found the v3. I was a bit confused because it was hidden before the v2 in
> > my mailbox: the active thread in v2 bump it to the top, thus "shadowing" the
> > v3.
> >
> > On 12/11/2024 at 23:39, Sean Nyekjaer wrote:
> > > nWKRQ supports an output voltage of either the internal reference voltage
> > > (3.6V) or the reference voltage of the digital interface 0 - 6V (VIO).
> > > Add the devicetree option ti,nwkrq-voltage-vio to set it to VIO.
> > > Unset nWKRQ is kept at internal reference voltage.
> > >
> > > Signed-off-by: Sean Nyekjaer <sean@...nix.com>
> >
> > Notwithstanding of bellow nitpick:
> >
> > Reviewed-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>
> >
> > > ---
> > > drivers/net/can/m_can/tcan4x5x-core.c | 20 ++++++++++++++++++++
> > > drivers/net/can/m_can/tcan4x5x.h | 2 ++
> > > 2 files changed, 22 insertions(+)
> > >
> > > diff --git a/drivers/net/can/m_can/tcan4x5x-core.c b/drivers/net/can/m_can/tcan4x5x-core.c
> > > index 2f73bf3abad889c222f15c39a3d43de1a1cf5fbb..12a375c653cbd255b5dc85faf2f76de397a644ec 100644
> > > --- a/drivers/net/can/m_can/tcan4x5x-core.c
> > > +++ b/drivers/net/can/m_can/tcan4x5x-core.c
> > > @@ -92,6 +92,8 @@
> > > #define TCAN4X5X_MODE_STANDBY BIT(6)
> > > #define TCAN4X5X_MODE_NORMAL BIT(7)
> > > +#define TCAN4X5X_NWKRQ_VOLTAGE_VIO BIT(19)
> > > +
> > > #define TCAN4X5X_DISABLE_WAKE_MSK (BIT(31) | BIT(30))
> > > #define TCAN4X5X_DISABLE_INH_MSK BIT(9)
> > > @@ -267,6 +269,13 @@ static int tcan4x5x_init(struct m_can_classdev *cdev)
> > > if (ret)
> > > return ret;
> > > + if (tcan4x5x->nwkrq_voltage_vio) {
> > > + ret = regmap_set_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG,
> > > + TCAN4X5X_NWKRQ_VOLTAGE_VIO);
> > > + if (ret)
> > > + return ret;
> > > + }
> > > +
> > > return ret;> }
> > > @@ -318,6 +327,15 @@ static const struct tcan4x5x_version_info
> > > return &tcan4x5x_versions[TCAN4X5X];
> > > }
> > > +static void tcan4x5x_get_dt_data(struct m_can_classdev *cdev)
> > > +{
> > > + struct tcan4x5x_priv *tcan4x5x = cdev_to_priv(cdev);
> > > + struct device_node *np = cdev->dev->of_node;
> > > +
> > > + if (of_property_read_bool(np, "ti,nwkrq-voltage-vio"))
> > > + tcan4x5x->nwkrq_voltage_vio = true;
> >
> > Nitpick: you can directly assign the value. No need for the if.
> >
> > tcan4x5x->nwkrq_voltage_vio =
> > of_property_read_bool(cdev->dev->of_node,
> > "ti,nwkrq-voltage-vio");
> >
> > My personal preference is to not declare the np variable because it used
> > only once but instead directly use cdev->dev->of_node. See this as a
> > suggestion. If you prefer to keep as it is, OK for me :)
>
> It looks a lot cleaner :)
> Just send v4, with some commit messange changens from Marc.
> I will update and sent v5
No need to send a v6 with the updated R-b, b4 will collect them. After
we get an ack by one of the DT maintainers I'll apply the patches.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists