]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: es1-ap-usb: fix svc control pipe flags
authorMatt Porter <mporter@linaro.org>
Mon, 22 Sep 2014 19:51:48 +0000 (15:51 -0400)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 22 Sep 2014 20:23:05 +0000 (13:23 -0700)
The control message flags currently indicate USB_DIR_IN, which
doesn't allow the data phase carrying the SVC message to be
send to the device. Change this to USB_DIR_OUT so our SVC
message buffer reaches the device.

Also, the recipient is USB_RECIP_OTHER but almost all real devices
that handle vendor setup requests seem to set this as
USB_RECIP_INTERFACE. As a result, functionfs-based gadgets don't handle
vendor setup requests with a recipient of OTHER. Change this to
USB_RECIP_INTERFACE to work with the functionfs-based emulator and
this should be no issue for the firmware to implement to match.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/es1-ap-usb.c

index 1a47da6fb9331eaf7c1d3e697e58426e9765a309..47c4524d6f5ece4df5a5386bb8e10301cc664040 100644 (file)
@@ -149,7 +149,7 @@ static int send_svc_msg(struct svc_msg *svc_msg, struct greybus_host_device *hd)
                                 usb_sndctrlpipe(es1->usb_dev,
                                                 es1->control_endpoint),
                                 0x01,  /* vendor request AP message */
-                                USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER,
+                                USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
                                 0x00, 0x00,
                                 (char *)svc_msg,
                                 sizeof(*svc_msg),