summaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs/pipe.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: renesas_usbhs: add usbhs_pipe_is_stall()Kuninori Morimoto2011-12-121-0/+7
| | | | | | | This is preparation for chapter 9 test Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: usbhs_dcp_control_transfer_done() cares mod_hostKuninori Morimoto2011-10-131-1/+5
| | | | | | | CCPL setting is needed on only mod_gadget. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: modify pipe sequence settingsKuninori Morimoto2011-10-131-3/+6
| | | | | | | | renesas_usbhs can manually set DATA0/DATA1. This patch is prepare for mod_host support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: move done callback to struct usbhs_pktKuninori Morimoto2011-10-131-9/+0Star
| | | | | | | | | transfer done function was registered in struct struct usbhs_pipe_info. It was good for mod_gadget, but not good for mod_host. This function move it to struct usbhs_pkt. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: add usbhs_pipe_name()Kuninori Morimoto2011-10-131-1/+6
| | | | | | | pipe name is usefull function for mod_xxx Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: add device select support in ↵Kuninori Morimoto2011-10-131-2/+14
| | | | | | | | | usbhs_pipe_config_update() device select method will be used on mod_host Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: add struct usbhs_priv to packet done functionKuninori Morimoto2011-10-131-1/+2
| | | | | | | | | There was no method to get struct usbhs_priv when packet transfer done function was called. This patch allow that callback function receive it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: add usbhs_dcp_dir_for_host()Kuninori Morimoto2011-10-131-0/+6
| | | | | | | | | renesas_usbhs device needs special bit settings if it was mod_host and dcp pipe. This patch support it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: remove unneeded parameter from usbhs_mod_is_host()Kuninori Morimoto2011-10-131-2/+1Star
| | | | | | | | it was possible to get usbhs_mod from usbhs_priv. this patch remove unneeded parameter. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: move usbhs_usbreq_get/set_val() to common.cKuninori Morimoto2011-10-131-24/+0Star
| | | | | | | | | usbhs_usbreq_get/set_val() functions were in pipe.c file, but it is irrelevant to pipe. this patch move it to common.c Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: move usbhsp_type() to usbhs_pipe_type()Kuninori Morimoto2011-10-131-18/+17Star
| | | | | | | | Pipe type check macro will be used in other files. This patch move local macro to global macro. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: each pipe hold maxpacket sizeKuninori Morimoto2011-10-131-21/+8Star
| | | | | | | | | | | | | Current renesas_usbhs pipe accessed DCPMAXP/PIPEMAXP register to get own maxpacket size every time. But maxpacket size isn't changed after pipe start, and register access is too slow. This patch adds new maxp variable to keep own maxpacket. And un-used function are removed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: renesas_usbhs: remove desc from usbhs_pipe_mallocKuninori Morimoto2011-10-131-35/+34Star
| | | | | | | | | | | Current usbhs_pipe_malloc() used usb_endpoint_descriptor to get necessary information. It was very good for mod_gadget which allocate pipe in runtime, but is not good for mod_host which allocate pipe in initial timing. This patch remove usb_endpoint_descriptor from usbhs_pipe_malloc() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: use usb_endpoint_maxp()kuninori.morimoto.gx@renesas.com2011-08-231-1/+1
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: fixup connection failKuninori Morimoto2011-06-141-2/+7
| | | | | | | | Sometimes the connection fail happen on renesas_usbhs. This patch fix it up. Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: add DMAEngine supportKuninori Morimoto2011-06-071-1/+3
| | | | | | | | | | | | | | | | | | | | USB DMA was installed on "normal DMAC" when SH7724 or older SuperH, but the "USB-DMAC" was prepared on recent SuperH. These 2 DMAC have a little bit different behavior. This patch add DMAEngine code for "normal DMAC", but it is still using PIO fifo. The DMA fifo will be formally supported in the future. You can enable DMA fifo by local fixup usbhs_fifo_pio_push_handler -> usbhs_fifo_dma_push_handler usbhs_fifo_pio_pop_handler -> usbhs_fifo_dma_pop_handler on usbhsg_ep_enable. This DMAEngine was tested by g_file_storage on SH7724 Ecovec board Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: add pipe/fifo linkKuninori Morimoto2011-06-071-0/+13
| | | | | | | | | | | | renesas_usbhs has CFIFO which is for PIO transfer, and D0FIFO/D1FIFO which are for DMA transfer. The pipe selects one of these fifo when it send/recv data. But fifo must not be selected to different pipe in same time. This patch add pipe/fifo link for each other, and fifo is not selected by another pipe until it is unselected. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: modify data transfer interruptKuninori Morimoto2011-06-071-4/+8
| | | | | | | | | | | On current driver, overall data transfer method was implemented in fifo.c, but its interrupt which is member of packet queue control was still in mod_gadget.c. This patch move it into fifo.c. By this patch, the packet/fifo control is independent from mod_gadget. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: modify packet queue control methodKuninori Morimoto2011-06-071-0/+4
| | | | | | | | | | | Current renesas_usbhs driver is controlling packet queue on mod_gadget.c. But it has relationship with pipe/fifo, not host/gadget. So, controlling USB packet queue in pipe.c/fifo.c is more convenient than in mod_gadget.c. This patch modify it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: divide data transfer functionsKuninori Morimoto2011-06-071-2/+6
| | | | | | | | | | | | DMAEngine will be supported to this driver in the future. Then, both PIO and DMA data transfer method should be supported. But, the transfer function can returns the result immediately in PIO version, but it can't in DMA version. This patch divides data transfer functions into top/bottom half in preparation for DMAEngine support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: fifo became independent from pipe.Kuninori Morimoto2011-06-071-223/+29Star
| | | | | | | | | | | Current renesas_usbhs has PIO data transfer mode which controls CFIFO. And it was implemented in pipe.c. But, fifo control method needs more flexible implementation to support DMAEngine. This patch create fifo.c, and it became independent from pipe.c. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: modify pipe direction flagsKuninori Morimoto2011-06-071-1/+9
| | | | | | | | | | | | | Current driver had pipe direction flag which came from usb_endpoint_dir_in(). It means "input direction" for HOST, and "out direction" for Gadget. But driver needs "input direction for pipe". This patch adds IS_DIR_HOST flags and care both "input direction for HOST" and "input direction for pipe" Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: fixup fifo disableKuninori Morimoto2011-05-121-16/+13Star
| | | | | | | | It was necessary to check pipe condition after disable fifo. Current driver checked it in a wrong place. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: add error reason for usbhs_pipe_mallocKuninori Morimoto2011-04-301-1/+4
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: modify fifo clear timingKuninori Morimoto2011-04-301-10/+4Star
| | | | | | | | | | Pipe buffer should be cleaned before using it, but should NOT be cleaned in pipe "prepare" function. Because the pipe might be working in such timing. This patch fixup this issue. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: renesas_usbhs: Add Renesas USBHS common codeKuninori Morimoto2011-04-141-0/+880
Renesas SuperH has USBHS IP which can switch Host / Function. This driver is designed so that Host / Function may dynamically change. This patch add usb/renesas_usbhs and common code for SuperH USBHS. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>