aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-07-07 03:23:24 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-08 17:57:12 -0400
commit233f519d273454e3e804e21363d5ef0bd031acfe (patch)
treea8ecdc7ba5d108962e9be01f737e7b2af4ac6374 /drivers/usb
parent45304e8cd9d9df07e9221551678262b390bdaaa4 (diff)
usb: renesas_usbhs: fixup comment-out
This patch add/modify comment-out of renesas_usbhs. On this process, usbhs_pkt_init was moved because it was placed under usbhsf_null_handler which has no relationship it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/renesas_usbhs/common.c23
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c30
-rw-r--r--drivers/usb/renesas_usbhs/mod_gadget.c10
3 files changed, 53 insertions, 10 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 665259aec871..d8239e5efa66 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -21,6 +21,29 @@
21#include <linux/sysfs.h> 21#include <linux/sysfs.h>
22#include "./common.h" 22#include "./common.h"
23 23
24/*
25 * image of renesas_usbhs
26 *
27 * ex) gadget case
28
29 * mod.c
30 * mod_gadget.c
31 * mod_host.c pipe.c fifo.c
32 *
33 * +-------+ +-----------+
34 * | pipe0 |------>| fifo pio |
35 * +------------+ +-------+ +-----------+
36 * | mod_gadget |=====> | pipe1 |--+
37 * +------------+ +-------+ | +-----------+
38 * | pipe2 | | +-| fifo dma0 |
39 * +------------+ +-------+ | | +-----------+
40 * | mod_host | | pipe3 |<-|--+
41 * +------------+ +-------+ | +-----------+
42 * | .... | +--->| fifo dma1 |
43 * | .... | +-----------+
44 */
45
46
24#define USBHSF_RUNTIME_PWCTRL (1 << 0) 47#define USBHSF_RUNTIME_PWCTRL (1 << 0)
25 48
26/* status */ 49/* status */
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 021695de1e9e..237e8b1e7027 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -26,7 +26,16 @@
26#define usbhsf_fifo_is_busy(f) ((f)->pipe) /* see usbhs_pipe_select_fifo */ 26#define usbhsf_fifo_is_busy(f) ((f)->pipe) /* see usbhs_pipe_select_fifo */
27 27
28/* 28/*
29 * packet info function 29 * packet initialize
30 */
31void usbhs_pkt_init(struct usbhs_pkt *pkt)
32{
33 pkt->dma = DMA_ADDR_INVALID;
34 INIT_LIST_HEAD(&pkt->node);
35}
36
37/*
38 * packet control function
30 */ 39 */
31static int usbhsf_null_handle(struct usbhs_pkt *pkt, int *is_done) 40static int usbhsf_null_handle(struct usbhs_pkt *pkt, int *is_done)
32{ 41{
@@ -43,12 +52,6 @@ static struct usbhs_pkt_handle usbhsf_null_handler = {
43 .try_run = usbhsf_null_handle, 52 .try_run = usbhsf_null_handle,
44}; 53};
45 54
46void usbhs_pkt_init(struct usbhs_pkt *pkt)
47{
48 pkt->dma = DMA_ADDR_INVALID;
49 INIT_LIST_HEAD(&pkt->node);
50}
51
52void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, 55void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
53 struct usbhs_pkt_handle *handler, 56 struct usbhs_pkt_handle *handler,
54 void *buf, int len, int zero) 57 void *buf, int len, int zero)
@@ -293,7 +296,7 @@ static int usbhsf_fifo_select(struct usbhs_pipe *pipe,
293} 296}
294 297
295/* 298/*
296 * PIO fifo functions 299 * PIO push handler
297 */ 300 */
298static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done) 301static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
299{ 302{
@@ -395,6 +398,9 @@ struct usbhs_pkt_handle usbhs_fifo_pio_push_handler = {
395 .try_run = usbhsf_pio_try_push, 398 .try_run = usbhsf_pio_try_push,
396}; 399};
397 400
401/*
402 * PIO pop handler
403 */
398static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) 404static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done)
399{ 405{
400 struct usbhs_pipe *pipe = pkt->pipe; 406 struct usbhs_pipe *pipe = pkt->pipe;
@@ -497,7 +503,7 @@ struct usbhs_pkt_handle usbhs_fifo_pio_pop_handler = {
497}; 503};
498 504
499/* 505/*
500 * handler function 506 * DCP ctrol statge handler
501 */ 507 */
502static int usbhsf_ctrl_stage_end(struct usbhs_pkt *pkt, int *is_done) 508static int usbhsf_ctrl_stage_end(struct usbhs_pkt *pkt, int *is_done)
503{ 509{
@@ -614,6 +620,9 @@ static void usbhsf_dma_prepare_tasklet(unsigned long data)
614 dma_async_issue_pending(chan); 620 dma_async_issue_pending(chan);
615} 621}
616 622
623/*
624 * DMA push handler
625 */
617static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done) 626static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done)
618{ 627{
619 struct usbhs_pipe *pipe = pkt->pipe; 628 struct usbhs_pipe *pipe = pkt->pipe;
@@ -686,6 +695,9 @@ struct usbhs_pkt_handle usbhs_fifo_dma_push_handler = {
686 .dma_done = usbhsf_dma_push_done, 695 .dma_done = usbhsf_dma_push_done,
687}; 696};
688 697
698/*
699 * DMA pop handler
700 */
689static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done) 701static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done)
690{ 702{
691 struct usbhs_pipe *pipe = pkt->pipe; 703 struct usbhs_pipe *pipe = pkt->pipe;
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 9a8e2e9141b2..cc3ad634d4f7 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -114,7 +114,7 @@ struct usbhsg_recip_handle {
114#define usbhsg_status_has(gp, b) (gp->status & b) 114#define usbhsg_status_has(gp, b) (gp->status & b)
115 115
116/* 116/*
117 * list push/pop 117 * queue push/pop
118 */ 118 */
119static void usbhsg_queue_push(struct usbhsg_uep *uep, 119static void usbhsg_queue_push(struct usbhsg_uep *uep,
120 struct usbhsg_request *ureq) 120 struct usbhsg_request *ureq)
@@ -160,6 +160,9 @@ static void usbhsg_queue_done(struct usbhs_pkt *pkt)
160 usbhsg_queue_pop(uep, ureq, 0); 160 usbhsg_queue_pop(uep, ureq, 0);
161} 161}
162 162
163/*
164 * dma map/unmap
165 */
163static int usbhsg_dma_map(struct device *dev, 166static int usbhsg_dma_map(struct device *dev,
164 struct usbhs_pkt *pkt, 167 struct usbhs_pkt *pkt,
165 enum dma_data_direction dir) 168 enum dma_data_direction dir)
@@ -473,6 +476,11 @@ static int usbhsg_ep_enable(struct usb_ep *ep,
473 uep->pipe = pipe; 476 uep->pipe = pipe;
474 pipe->mod_private = uep; 477 pipe->mod_private = uep;
475 478
479 /*
480 * usbhs_fifo_dma_push/pop_handler try to
481 * use dmaengine if possible.
482 * It will use pio handler if impossible.
483 */
476 if (usb_endpoint_dir_in(desc)) 484 if (usb_endpoint_dir_in(desc))
477 uep->handler = &usbhs_fifo_dma_push_handler; 485 uep->handler = &usbhs_fifo_dma_push_handler;
478 else 486 else