mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-11 15:14:03 +08:00
usb: pd: Add definition for DFP and UFP1 VDOs
The latest version of the USB Power Delivery Specification R3.0 added UFP and DFP product types for the Discover Identity message. Both types can be used for example for checking the USB capability of the partner, which means the USB modes (USB 2.0, USB 3.0 and USB4) that the partner device supports. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20191230142611.24921-10-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7823905de0
commit
d48ece0bce
@ -139,6 +139,38 @@
|
||||
#define VDO_PRODUCT(pid, bcd) (((pid) & 0xffff) << 16 | ((bcd) & 0xffff))
|
||||
#define PD_PRODUCT_PID(vdo) (((vdo) >> 16) & 0xffff)
|
||||
|
||||
/*
|
||||
* UFP VDO1
|
||||
* --------
|
||||
* <31:29> :: UFP VDO version
|
||||
* <28> :: Reserved
|
||||
* <27:24> :: Device capability
|
||||
* <23:6> :: Reserved
|
||||
* <5:3> :: Alternate modes
|
||||
* <2:0> :: USB highest speed
|
||||
*/
|
||||
#define PD_VDO1_UFP_DEVCAP(vdo) (((vdo) & GENMASK(27, 24)) >> 24)
|
||||
|
||||
#define DEV_USB2_CAPABLE BIT(0)
|
||||
#define DEV_USB2_BILLBOARD BIT(1)
|
||||
#define DEV_USB3_CAPABLE BIT(2)
|
||||
#define DEV_USB4_CAPABLE BIT(3)
|
||||
|
||||
/*
|
||||
* DFP VDO
|
||||
* --------
|
||||
* <31:29> :: DFP VDO version
|
||||
* <28:27> :: Reserved
|
||||
* <26:24> :: Host capability
|
||||
* <23:5> :: Reserved
|
||||
* <4:0> :: Port number
|
||||
*/
|
||||
#define PD_VDO_DFP_HOSTCAP(vdo) (((vdo) & GENMASK(26, 24)) >> 24)
|
||||
|
||||
#define HOST_USB2_CAPABLE BIT(0)
|
||||
#define HOST_USB3_CAPABLE BIT(1)
|
||||
#define HOST_USB4_CAPABLE BIT(2)
|
||||
|
||||
/*
|
||||
* Cable VDO
|
||||
* ---------
|
||||
|
Loading…
Reference in New Issue
Block a user