Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: pd: Add helper macro to get Type C cable speed

Added a helper macro to get the Type C cable speed when provided the
cable VDO.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Utkarsh Patel <utkarsh.h.patel@intel.com>
Link: https://lore.kernel.org/r/20230920023243.2494410-4-utkarsh.h.patel@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Utkarsh Patel and committed by
Greg Kroah-Hartman
f9ee6043 c365b1e1

+1
+1
include/linux/usb/pd_vdo.h
··· 376 376 | ((vbm) & 0x3) << 9 | (sbu) << 8 | (sbut) << 7 | ((cur) & 0x3) << 5 \ 377 377 | (vbt) << 4 | (sopp) << 3 | ((spd) & 0x7)) 378 378 379 + #define VDO_TYPEC_CABLE_SPEED(vdo) ((vdo) & 0x7) 379 380 #define VDO_TYPEC_CABLE_TYPE(vdo) (((vdo) >> 18) & 0x3) 380 381 381 382 /*