aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2015-11-18 00:34:09 -0500
committerFelipe Balbi <balbi@ti.com>2015-12-15 10:12:41 -0500
commit51f141a97a1406bb0b59d490e837a39ccb7c3999 (patch)
tree4766c47c6539a342a1c414b9098411e78c6932a2 /include/linux/usb
parent762d3a1a9cd7438a8453e005ee5b2bab3203d9c3 (diff)
usb: renesas_usbhs: Modify pipe configuration
The current code has info->bufnmb_last to calculate the BUFNMB bits of PIPEBUF register. However, since the bufnmb_last is initialized in the usbhs_pipe_init() only, this driver is possible to set unexpected value to the register if usb_ep_{enable,disable}() are called many times. So, this patch modifies the pipe configuration via struct renesas_usbhs_driver_param to simplify the code. Also this patch changes: - a double buffer configuration - isochronous buffer size from 512 to 1024 Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/renesas_usbhs.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index bfb74723f151..4db191fe8c2c 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -105,12 +105,26 @@ struct renesas_usbhs_platform_callback {
105 * some register needs USB chip specific parameters. 105 * some register needs USB chip specific parameters.
106 * This struct show it to driver 106 * This struct show it to driver
107 */ 107 */
108
109struct renesas_usbhs_driver_pipe_config {
110 u8 type; /* USB_ENDPOINT_XFER_xxx */
111 u16 bufsize;
112 u8 bufnum;
113 bool double_buf;
114};
115#define RENESAS_USBHS_PIPE(_type, _size, _num, _double_buf) { \
116 .type = (_type), \
117 .bufsize = (_size), \
118 .bufnum = (_num), \
119 .double_buf = (_double_buf), \
120 }
121
108struct renesas_usbhs_driver_param { 122struct renesas_usbhs_driver_param {
109 /* 123 /*
110 * pipe settings 124 * pipe settings
111 */ 125 */
112 u32 *pipe_type; /* array of USB_ENDPOINT_XFER_xxx (from ep0) */ 126 struct renesas_usbhs_driver_pipe_config *pipe_configs;
113 int pipe_size; /* pipe_type array size */ 127 int pipe_size; /* pipe_configs array size */
114 128
115 /* 129 /*
116 * option: 130 * option: