-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mfd: usbio: gpio read payload reduces 4 bytes #14
base: main
Are you sure you want to change the base?
Conversation
ret = usb_control_msg_send(bridge->udev, bridge->ep0, 0, | ||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, 0, 0, | ||
header, actual, timeout, GFP_KERNEL); | ||
header, actual - 4, timeout, GFP_KERNEL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This N-4 bytes payload length is defined in USBIO bridge protocol revision 1.0. In previous version 0.7, the format is N-bytes. Merge this request will be risky to break systems running older FW version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to have a check to decide which protocol to go?
something like :
old device go:
ret = usb_control_msg_send(bridge->udev, bridge->ep0, 0, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, 0, 0, header, actual, timeout, GFP_KERNEL);
new device go:
ret = usb_control_msg_send(bridge->udev, bridge->ep0, 0, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, 0, 0, header, actual - 4, timeout, GFP_KERNEL);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to have a check to decide which protocol to go?
done
This N-4 bytes payload length is defined in USBIO bridge protocol revision 1.0. In previous version 0.7, the format is N-bytes. Merge this request will be risky to break systems running older FW version.
how about creating a function to check the protocol version based on the HID?
Have you tested this pull request?
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense to do the check once during instance creation, and save the result in a flag? Instead of doing it for each transfer?
Following the vision driver protocol, the payload length for gpio read needs to be reduced by 4 bytes because the value field doesn't need to be sent in the request. Signed-off-by: Jason Chen <jason.z.chen@intel.corp-partner.google.com>
Following the vision driver protocol, the payload length for gpio read needs to be reduced by 4 bytes because the value field doesn't need to be sent in the request.