mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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: [EXTERNAL]Re: [PATCH net-next v4 2/2] net: pse-pd: Add Si3474 PSE controller driver
Date: Thu, 10 Jul 2025 20:05:57 +0200	[thread overview]
Message-ID: <20250710200557.41e5876a@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <53c71efc-e29b-482a-bd6a-7a66a2d2d415@adtran.com>

Le Thu, 10 Jul 2025 15:32:11 +0000,
Piotr Kubik <piotr.kubik@adtran.com> a écrit :

> On 7/7/25 15:17, Kory Maincent wrote:
> > ...
> > 
> >   
> >> +
> >> +static int si3474_pi_enable(struct pse_controller_dev *pcdev, int id)
> >> +{
> >> +	struct si3474_priv *priv = to_si3474_priv(pcdev);
> >> +	struct i2c_client *client;
> >> +	u8 chan0, chan1;
> >> +	u8 val = 0;
> >> +	s32 ret;
> >> +
> >> +	if (id >= SI3474_MAX_CHANS)
> >> +		return -ERANGE;
> >> +
> >> +	si3474_get_channels(priv, id, &chan0, &chan1);
> >> +	client = si3474_get_chan_client(priv, chan0);
> >> +
> >> +	/* Release PI from shutdown */
> >> +	ret = i2c_smbus_read_byte_data(client, PORT_MODE_REG);
> >> +	if (ret < 0)
> >> +		return ret;
> >> +
> >> +	val = (u8)ret;
> >> +	val |= CHAN_MASK(chan0);
> >> +	val |= CHAN_MASK(chan1);
> >> +
> >> +	ret = i2c_smbus_write_byte_data(client, PORT_MODE_REG, val);
> >> +	if (ret)
> >> +		return ret;
> >> +
> >> +	/* DETECT_CLASS_ENABLE must be set when using AUTO mode,
> >> +	 * otherwise PI does not power up - datasheet section 2.10.2
> >> +	 */  
> > 
> > What happen in a PD disconnection case? According to the datasheet it simply
> > raise a disconnection interrupt and disconnect the power with a
> > DISCONNECT_PCUT_FAULT fault. But it is not clear if it goes back to the
> > detection + classification process. If it is not the case you will face the
> > same issue I did and will need to deal with the interrupt and the
> > disconnection management.
> > 
> > Could you try to enable a port, plug a PD then disconnect it and plug
> > another PD which belong to another power class. Finally read the class
> > detected to verify that the class detected have changed.  
> 
> Yes, I did this test, also with disabling/enabling PI in between PD
> disconnects/connects. Each time class was detected correctly (class4 vs 3 in
> my case). I checked also class results when no PD was connected or PI was
> disabled, all OK.

Ok great! It behaves differently than the TPS23881, so there is no need to deal
with the disconnection management. That wasn't clear at first sight.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

      reply	other threads:[~2025-07-10 18:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 14:55 [PATCH net-next v4 0/2] " Piotr Kubik
2025-06-30 14:57 ` [PATCH net-next v4 1/2] dt-bindings: net: pse-pd: Add bindings for Si3474 PSE controller Piotr Kubik
2025-06-30 14:57 ` [PATCH net-next v4 2/2] net: pse-pd: Add Si3474 PSE controller driver Piotr Kubik
2025-07-03  9:13   ` Paolo Abeni
2025-07-07 13:17   ` Kory Maincent
2025-07-10 15:32     ` [EXTERNAL]Re: " Piotr Kubik
2025-07-10 18:05       ` Kory Maincent [this message]

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=20250710200557.41e5876a@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

all inboxes | Powered by JetHome®