diff options
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.c | 10 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index bc4521c54261..80fc4add6af2 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c | |||
@@ -550,12 +550,15 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, | |||
550 | 550 | ||
551 | /* DIR */ | 551 | /* DIR */ |
552 | if (usb_endpoint_dir_in(desc)) | 552 | if (usb_endpoint_dir_in(desc)) |
553 | usbhsp_flags_set(pipe, IS_DIR_IN); | 553 | usbhsp_flags_set(pipe, IS_DIR_HOST); |
554 | 554 | ||
555 | if ((is_host && usb_endpoint_dir_out(desc)) || | 555 | if ((is_host && usb_endpoint_dir_out(desc)) || |
556 | (!is_host && usb_endpoint_dir_in(desc))) | 556 | (!is_host && usb_endpoint_dir_in(desc))) |
557 | dir |= DIR_OUT; | 557 | dir |= DIR_OUT; |
558 | 558 | ||
559 | if (!dir) | ||
560 | usbhsp_flags_set(pipe, IS_DIR_IN); | ||
561 | |||
559 | /* SHTNAK */ | 562 | /* SHTNAK */ |
560 | if (usbhsp_type_is(pipe, USB_ENDPOINT_XFER_BULK) && | 563 | if (usbhsp_type_is(pipe, USB_ENDPOINT_XFER_BULK) && |
561 | !dir) | 564 | !dir) |
@@ -678,6 +681,11 @@ int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe) | |||
678 | return usbhsp_flags_has(pipe, IS_DIR_IN); | 681 | return usbhsp_flags_has(pipe, IS_DIR_IN); |
679 | } | 682 | } |
680 | 683 | ||
684 | int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe) | ||
685 | { | ||
686 | return usbhsp_flags_has(pipe, IS_DIR_HOST); | ||
687 | } | ||
688 | |||
681 | void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe) | 689 | void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe) |
682 | { | 690 | { |
683 | usbhsp_pipectrl_set(pipe, SQCLR, SQCLR); | 691 | usbhsp_pipectrl_set(pipe, SQCLR, SQCLR); |
diff --git a/drivers/usb/renesas_usbhs/pipe.h b/drivers/usb/renesas_usbhs/pipe.h index 1cca9b7fb266..c906eb646d24 100644 --- a/drivers/usb/renesas_usbhs/pipe.h +++ b/drivers/usb/renesas_usbhs/pipe.h | |||
@@ -30,6 +30,7 @@ struct usbhs_pipe { | |||
30 | u32 flags; | 30 | u32 flags; |
31 | #define USBHS_PIPE_FLAGS_IS_USED (1 << 0) | 31 | #define USBHS_PIPE_FLAGS_IS_USED (1 << 0) |
32 | #define USBHS_PIPE_FLAGS_IS_DIR_IN (1 << 1) | 32 | #define USBHS_PIPE_FLAGS_IS_DIR_IN (1 << 1) |
33 | #define USBHS_PIPE_FLAGS_IS_DIR_HOST (1 << 2) | ||
33 | 34 | ||
34 | void *mod_private; | 35 | void *mod_private; |
35 | }; | 36 | }; |
@@ -89,6 +90,7 @@ struct usbhs_pipe | |||
89 | const struct usb_endpoint_descriptor *desc); | 90 | const struct usb_endpoint_descriptor *desc); |
90 | 91 | ||
91 | int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe); | 92 | int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe); |
93 | int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe); | ||
92 | void usbhs_pipe_init(struct usbhs_priv *priv); | 94 | void usbhs_pipe_init(struct usbhs_priv *priv); |
93 | int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe); | 95 | int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe); |
94 | void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe); | 96 | void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe); |