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>
This commit is contained in:

committed by
Felipe Balbi

parent
762d3a1a9c
commit
51f141a97a
@@ -105,12 +105,26 @@ struct renesas_usbhs_platform_callback {
|
||||
* some register needs USB chip specific parameters.
|
||||
* This struct show it to driver
|
||||
*/
|
||||
|
||||
struct renesas_usbhs_driver_pipe_config {
|
||||
u8 type; /* USB_ENDPOINT_XFER_xxx */
|
||||
u16 bufsize;
|
||||
u8 bufnum;
|
||||
bool double_buf;
|
||||
};
|
||||
#define RENESAS_USBHS_PIPE(_type, _size, _num, _double_buf) { \
|
||||
.type = (_type), \
|
||||
.bufsize = (_size), \
|
||||
.bufnum = (_num), \
|
||||
.double_buf = (_double_buf), \
|
||||
}
|
||||
|
||||
struct renesas_usbhs_driver_param {
|
||||
/*
|
||||
* pipe settings
|
||||
*/
|
||||
u32 *pipe_type; /* array of USB_ENDPOINT_XFER_xxx (from ep0) */
|
||||
int pipe_size; /* pipe_type array size */
|
||||
struct renesas_usbhs_driver_pipe_config *pipe_configs;
|
||||
int pipe_size; /* pipe_configs array size */
|
||||
|
||||
/*
|
||||
* option:
|
||||
|
Reference in New Issue
Block a user