Re: [PATCH v2 0/3] usb: typec: Separate sysfs directory for all USB PD objects

From: Heikki Krogerus
Date: Wed Apr 13 2022 - 03:19:38 EST


Hi Greg,

On Tue, Apr 12, 2022 at 04:38:33PM +0200, Greg Kroah-Hartman wrote:
> On Tue, Apr 12, 2022 at 04:00:20PM +0300, Heikki Krogerus wrote:
> > Hi,
> >
> > In this version the USB Power Delivery support is now completely
> > separated into its own little subsystem. The USB Power Delivery
> > objects are not devices, but they are also no longer tied to any
> > device by default. This change makes it possible to share the USB PD
> > objects between multiple devices on top of being able to select the
> > objects that we want the device to use.
> >
> > The USB Power Delivery objects are now placed under
> > /sys/kernel/usb_power_delivery directory. As an example:
> >
> > /sys/kernel/usb_power_delivery/pd0
>
> No, sorry, this is a device, it does NOT belong in /sys/kernel/
>
> And this really should be a real device, as I mentioned before, not a
> kobject.

Okay. I had to do this proposal to be sure (nobody answered my
question in v1). Sorry.

I'll make these into devices. USB Power Delivery shall be the device
class for them.

> > So now that pd0 can be linked to a device, or devices, that want (or
> > can) use it to negotiate the USB PD contract with. An example where
> > two devices share the PD:
> >
> > /sys/class/typec/port0/usb_power_delivery -> ../../../../../../../kernel/usb_power_delivery/pd0
> > /sys/class/typec/port1/usb_power_delivery -> ../../../../../../../kernel/usb_power_delivery/pd0
>
> Point to the pd device, not the kobject.
>
> > I did not change the directory hierarchy at all, because I'm assuming
> > that it is not a problem anymore:
> >
> > pd0/<message>/<object>/<field>
>
> Let's get back to devices first, worry about crazy depth second.

Thanks,

--
heikki