Hi, Oliver Neukum <oneukum@xxxxxxxx> writes: > [ text/plain ] > Adding the descriptors of chapter 9.2 of the Power Delivery spec. > > Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx> > --- > include/uapi/linux/usb/ch9.h | 94 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 94 insertions(+) > > diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h > index 252ac16..c9f2bc2 100644 > --- a/include/uapi/linux/usb/ch9.h > +++ b/include/uapi/linux/usb/ch9.h > @@ -913,6 +913,100 @@ struct usb_ssp_cap_descriptor { > } __attribute__((packed)); > > /* > + * USB Power Delivery Capability Descriptor: > + * Defines capabilities for PD > + */ > +#define USB_PD_POWER_DELIVERY_CAPABILITY (0x06) /* Defines the various PD Capabilities of this device */ > +#define USB_PD_BATTERY_INFO_CAPABILITY (0x07) /* Provides information on each battery supported by the device */ > +#define USB_PD_PD_CONSUMER_PORT_CAPABILITY (0x08) /* The Consumer characteristics of a Port on the device */ > +#define USB_PD_PD_PROVIDER_PORT_CAPABILITY (0x09) /* The provider characteristics of a Port on the device */ any chance you can avoid the extra long lines ? > +struct usb_pd_cap_descriptor { > + __u8 bLength; > + __u8 bDescriptorType; > + __u8 bDevCapabilityType; /* set to USB_PD_POWER_DELIVERY_CAPABILITY */ > + __u8 bReserved; > + __le32 bmAttributes; > +#define uSB_PD_CAP_BATTERY_CHARGING ( 1 << 1 ) /* supports Battery Charging specification */ > +#define uSB_PD_CAP_USB_PD ( 1 << 2 ) /* supports USB Power Delivery specification */ > +#define uSB_PD_CAP_PROVIDER ( 1 << 3 ) /* can provide power */ > +#define uSB_PD_CAP_CONSUMER ( 1 << 4 ) /* can consume power */ > +#define uSB_PD_CAP_CHARGING_POLICY ( 1 << 5 ) /* supports CHARGING_POLICY feature */ > +#define uSB_PD_CAP_TYPE_C_CURRENT ( 1 << 6 ) /* supports power capabilities defined in the USB Type-C Specification */ > + > +#define uSB_PD_CAP_PWR_AC ( 1 << 8 ) > +#define uSB_PD_CAP_PWR_BAT ( 1 << 9 ) > +#define uSB_PD_CAP_PWR_USE_V_BUS ( 1 << 14 ) why the extra spaces inside () ? -- balbi
Attachment:
signature.asc
Description: PGP signature