Re: [PATCH net-next v5 13/17] net: pse-pd: Use regulator framework within PSE framework

From: Andrew Lunn
Date: Mon Mar 04 2024 - 08:54:15 EST


On Mon, Mar 04, 2024 at 02:39:08PM +0100, Oleksij Rempel wrote:
> On Mon, Mar 04, 2024 at 02:32:50PM +0100, Andrew Lunn wrote:
> > > > > + psec = dev_find_pse_control(&phy->mdio.dev);
> > > > > + if (IS_ERR(psec)) {
> > > > > + rc = PTR_ERR(psec);
> > > > > + goto unregister_phy;
> > > > > + }
> > > > > +
> > > >
> > > > I do not think it is a good idea to make PSE controller depend on
> > > > phy->mdio.dev. The only reason why we have fwnode_find_pse_control()
> > > > here was the missing port abstraction.
> > >
> > > I totally agree that having port abstraction would be more convenient.
> > > Maxime Chevallier is currently working on this and will post it after his
> > > multi-phy series get merged.
> > > Meanwhile, we still need a device pointer for getting the regulator. The
> > > phy->mdio.dev is the only one I can think of as a regulator consumer.
> > > Another idea?
> >
> > Sorry, i've not been keeping up...
> >
> > Doesn't the device tree binding determine this? Where is the consumer
> > in the tree?
>
> The real consumer is outside of the system.

The device on the other end of the cable?

> Withing the system, it would be the RJ45 port, but we have no
> abstraction for ports so far.

A Linux regulator is generally used in a producer/consumer pair. If
there is no consumer device, why have a producer? What is going to use
the consumer API?

When we have a port representor, do we expect it to have active
elements? Something which will consume this regulator?

Andrew