Skip to contentSkip to conversation

usb: pd: fix the offset for SVID specific commands

DISCUSSION Guenter Roeck 1 participant 1 message Dec 18, 2017 USB

lore
Share & tools
lore

Guenter Roeck

author Reviewed-by
#0 lore raw
Quoted 14 lines · Heikki Krogerus

The SVID specific commands in the Command field of the Structured VDM Header start from 16, not 10. Changing the value used in VDO_CMD_VENDOR() macro from 10 to 0x10.

---
 include/linux/usb/pd_vdo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/usb/pd_vdo.h +0 -0
index d92259f8de0a..2b64d23ace5c 100644

include/linux/usb/pd_vdo.h line 69

Quoted 6 lines
include/linux/usb/pd_vdo.h +1 -1
@@ -65,7 +65,7 @@
 #define CMD_EXIT_MODE		5
 #define CMD_ATTENTION		6
 
-#define VDO_CMD_VENDOR(x)    (((10 + (x)) & 0x1f))
+#define VDO_CMD_VENDOR(x)    (((0x10 + (x)) & 0x1f))
 

Good catch. Bad part is that this originates from
https://chromium.googlesource.com/chromiumos/platform/ec,
which uses 10 as starting point. Nothing we can do about that.

Anyway,

Quoted 5 lines
include/linux/usb/pd_vdo.h +0 -0
 /* ChromeOS specific commands */
 #define VDO_CMD_VERSION		VDO_CMD_VENDOR(0)
Signature · 1 line
2.15.1

---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html