Skip to content

Commit

Permalink
usb: pd: Add helper macro to get Type C cable speed
Browse files Browse the repository at this point in the history
Added a helper macro to get the Type C cable speed when provided the
cable VDO.

Reviewed-by: Heikki Krogerus <[email protected]>
Signed-off-by: Utkarsh Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
uhpatel authored and gregkh committed Oct 2, 2023
1 parent c365b1e commit f9ee604
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/usb/pd_vdo.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
| ((vbm) & 0x3) << 9 | (sbu) << 8 | (sbut) << 7 | ((cur) & 0x3) << 5 \
| (vbt) << 4 | (sopp) << 3 | ((spd) & 0x7))

#define VDO_TYPEC_CABLE_SPEED(vdo) ((vdo) & 0x7)
#define VDO_TYPEC_CABLE_TYPE(vdo) (((vdo) >> 18) & 0x3)

/*
Expand Down

0 comments on commit f9ee604

Please sign in to comment.