From: Kory Maincent <kory.maincent@bootlin.com>
To: Piotr Kubik <piotr.kubik@adtran.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v6 2/2] net: pse-pd: Add Si3474 PSE controller driver
Date: Tue, 12 Aug 2025 15:03:17 +0200 [thread overview]
Message-ID: <20250812150317.76b51f01@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <bafdf870-dbc4-4641-b8c0-515375943acc@adtran.com>
Le Tue, 12 Aug 2025 11:12:22 +0000,
Piotr Kubik <piotr.kubik@adtran.com> a écrit :
> From: Piotr Kubik <piotr.kubik@adtran.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@adtran.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
next prev parent reply other threads:[~2025-08-12 13:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 11:11 [PATCH net-next v6 0/2] Add Si3474 PSE controller driver Piotr Kubik
2025-08-12 11:12 ` [PATCH net-next v6 1/2] dt-bindings: net: pse-pd: Add bindings for Si3474 PSE controller Piotr Kubik
2025-08-12 11:12 ` [PATCH net-next v6 2/2] net: pse-pd: Add Si3474 PSE controller driver Piotr Kubik
2025-08-12 13:03 ` Kory Maincent [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-08-04 15:07 [PATCH net-next v6 0/2] " Piotr Kubik
2025-08-04 15:08 ` [PATCH net-next v6 2/2] net: pse-pd: " Piotr Kubik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250812150317.76b51f01@kmaincent-XPS-13-7390 \
--to=kory.maincent@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=piotr.kubik@adtran.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).