All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: cp210x: Corrected USB request type definitions
@ 2012-05-01  4:06 Preston Fick
  2012-05-01  4:06 ` [PATCH 2/3] usb: cp210x: Added in support to get and store part number Preston Fick
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Preston Fick @ 2012-05-01  4:06 UTC (permalink / raw)
  To: gregkh, linux-usb, linux-kernel, linux-serial; +Cc: preston.fick

The original request types in the cp210x driver are labled as "DEVICE_TO_HOST" and
"HOST_TO_DEVICE" but the actual bit definition corresponds to a request to the
interface. This has been corrected, and the actual definition for the device
requests have been added.

Signed-off-by: Preston Fick <preston.fick@silabs.com>
---
 drivers/usb/serial/cp210x.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index ec30f95..e67ccf3 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -188,8 +188,10 @@ static struct usb_serial_driver * const serial_drivers[] = {
 };
 
 /* Config request types */
-#define REQTYPE_HOST_TO_DEVICE	0x41
-#define REQTYPE_DEVICE_TO_HOST	0xc1
+#define REQTYPE_HOST_TO_INTERFACE	0x41
+#define REQTYPE_INTERFACE_TO_HOST	0xc1
+#define REQTYPE_HOST_TO_DEVICE	0x40
+#define REQTYPE_DEVICE_TO_HOST	0xc0
 
 /* Config request codes */
 #define CP210X_IFC_ENABLE	0x00
@@ -286,7 +288,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
 
 	/* Issue the request, attempting to read 'size' bytes */
 	result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
-				request, REQTYPE_DEVICE_TO_HOST, 0x0000,
+				request, REQTYPE_INTERFACE_TO_HOST, 0x0000,
 				port_priv->bInterfaceNumber, buf, size,
 				USB_CTRL_GET_TIMEOUT);
 
@@ -340,13 +342,13 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
 	if (size > 2) {
 		result = usb_control_msg(serial->dev,
 				usb_sndctrlpipe(serial->dev, 0),
-				request, REQTYPE_HOST_TO_DEVICE, 0x0000,
+				request, REQTYPE_HOST_TO_INTERFACE, 0x0000,
 				port_priv->bInterfaceNumber, buf, size,
 				USB_CTRL_SET_TIMEOUT);
 	} else {
 		result = usb_control_msg(serial->dev,
 				usb_sndctrlpipe(serial->dev, 0),
-				request, REQTYPE_HOST_TO_DEVICE, data[0],
+				request, REQTYPE_HOST_TO_INTERFACE, data[0],
 				port_priv->bInterfaceNumber, NULL, 0,
 				USB_CTRL_SET_TIMEOUT);
 	}
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-05-08 13:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-01  4:06 [PATCH 1/3] usb: cp210x: Corrected USB request type definitions Preston Fick
2012-05-01  4:06 ` [PATCH 2/3] usb: cp210x: Added in support to get and store part number Preston Fick
2012-05-01 16:16   ` Sergei Shtylyov
2012-05-02 20:04     ` Greg KH
2012-05-02 20:04       ` Greg KH
2012-05-01  4:06 ` [PATCH 3/3] usb: cp210x: Add ioctl for GPIO support Preston Fick
2012-05-02 20:03   ` Greg KH
2012-05-02 20:49     ` Alan Cox
2012-05-02 21:52       ` Greg KH
2012-05-02 22:10         ` Alan Cox
2012-05-02 22:27           ` Greg KH
2012-05-02 22:59             ` Alan Cox
2012-05-03  8:58 ` [PATCH 1/3] usb: cp210x: Corrected USB request type definitions Bjørn Mork
2012-05-08 13:56   ` Preston Fick
2012-05-08 13:56     ` Preston Fick

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.