[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250812150317.76b51f01@kmaincent-XPS-13-7390>
Date: Tue, 12 Aug 2025 15:03:17 +0200
From: Kory Maincent <kory.maincent@...tlin.com>
To: Piotr Kubik <piotr.kubik@...ran.com>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>, Andrew Lunn
<andrew+netdev@...n.ch>, "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>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v6 2/2] net: pse-pd: Add Si3474 PSE controller
driver
Le Tue, 12 Aug 2025 11:12:22 +0000,
Piotr Kubik <piotr.kubik@...ran.com> a écrit :
> From: Piotr Kubik <piotr.kubik@...ran.com>
>
> Add a driver for the Skyworks Si3474 I2C Power Sourcing Equipment
> controller.
>
> Driver supports basic features of Si3474 IC:
> - get port status,
> - get port power,
> - get port voltage,
> - enable/disable port power.
>
> Only 4p configurations are supported at this moment.
>
> Signed-off-by: Piotr Kubik <piotr.kubik@...ran.com>
...
> +static int si3474_get_of_channels(struct si3474_priv *priv)
> +{
> + struct pse_pi *pi;
> + u32 chan_id;
> + u8 pi_no;
> + s32 ret;
> +
> + for (pi_no = 0; pi_no < SI3474_MAX_CHANS; pi_no++) {
> + pi = &priv->pcdev.pi[pi_no];
> + u8 pairset_no;
> +
> + for (pairset_no = 0; pairset_no < 2; pairset_no++) {
> + if (!pi->pairset[pairset_no].np)
> + continue;
> +
> + ret =
> of_property_read_u32(pi->pairset[pairset_no].np,
> + "reg", &chan_id);
> + if (ret) {
> + dev_err(&priv->client[0]->dev,
> + "Failed to read channel reg
> property\n");
> + return ret;
> + }
> + if (chan_id > SI3474_MAX_CHANS) {
> + dev_err(&priv->client[0]->dev,
> + "Incorrect channel number: %d\n",
> chan_id);
> + return -EINVAL;
> + }
> +
> + priv->pi[pi_no].chan[pairset_no] = chan_id;
> + /* Mark as 4-pair if second pairset is present */
> + priv->pi[pi_no].is_4p = (pairset_no == 1);
I think we should return and report an error if a PI is configured as a 2 pairs
PoE as long as it is not supported by the driver. This could avoid any future
mistakes from users.
Except from that it seems ok for me.
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Powered by blists - more mailing lists