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
@@ -1414,7 +1414,8 @@ static void usbhsh_pipe_init_for_host(struct usbhs_priv *priv)
|
||||
{
|
||||
struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv);
|
||||
struct usbhs_pipe *pipe;
|
||||
u32 *pipe_type = usbhs_get_dparam(priv, pipe_type);
|
||||
struct renesas_usbhs_driver_pipe_config *pipe_configs =
|
||||
usbhs_get_dparam(priv, pipe_configs);
|
||||
int pipe_size = usbhs_get_dparam(priv, pipe_size);
|
||||
int old_type, dir_in, i;
|
||||
|
||||
@@ -1442,15 +1443,15 @@ static void usbhsh_pipe_init_for_host(struct usbhs_priv *priv)
|
||||
* USB_ENDPOINT_XFER_BULK -> dir in
|
||||
* ...
|
||||
*/
|
||||
dir_in = (pipe_type[i] == old_type);
|
||||
old_type = pipe_type[i];
|
||||
dir_in = (pipe_configs[i].type == old_type);
|
||||
old_type = pipe_configs[i].type;
|
||||
|
||||
if (USB_ENDPOINT_XFER_CONTROL == pipe_type[i]) {
|
||||
if (USB_ENDPOINT_XFER_CONTROL == pipe_configs[i].type) {
|
||||
pipe = usbhs_dcp_malloc(priv);
|
||||
usbhsh_hpriv_to_dcp(hpriv) = pipe;
|
||||
} else {
|
||||
pipe = usbhs_pipe_malloc(priv,
|
||||
pipe_type[i],
|
||||
pipe_configs[i].type,
|
||||
dir_in);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user