aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/renesas_usbhs
AgeCommit message (Collapse)AuthorFilesLines
2011-08-08usb: renesas_usbhs: fixup usbhsg_for_each_uep 1st posKuninori Morimoto1-1/+1
1st pos of __usbhsg_for_each_uep() was wrong. Expected uep were ep1, ep2, ep3... but each uep were ep0, ep2, ep3 ... This patch modify it. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-08-08usb: renesas_usbhs: fix DMA build by including dma-mapping.hKuninori Morimoto1-0/+1
Include dma-mapping.h to fix build of the renesas_usbhs driver CC drivers/usb/renesas_usbhs/mod_gadget.o drivers/usb/renesas_usbhs/mod_gadget.c: In function 'usbhsg_dma_map': drivers/usb/renesas_usbhs/mod_gadget.c:190: error: implicit declaration of function 'dma_map_single' drivers/usb/renesas_usbhs/mod_gadget.c:192: error: implicit declaration of function 'dma_sync_single_for_device' drivers/usb/renesas_usbhs/mod_gadget.c:196: error: implicit declaration of function 'dma_mapping_error' drivers/usb/renesas_usbhs/mod_gadget.c: In function 'usbhsg_dma_unmap': drivers/usb/renesas_usbhs/mod_gadget.c:217: error: implicit declaration of function 'dma_unmap_single' drivers/usb/renesas_usbhs/mod_gadget.c:219: error: implicit declaration of function 'dma_sync_single_for_cpu' make[5]: *** [drivers/usb/renesas_usbhs/mod_gadget.o] Error 1 make[4]: *** [drivers/usb/renesas_usbhs] Error 2 Reported-by: Magnus Damm <[email protected]> Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-26USB / Renesas: Fix build issue related to struct scatterlistRafael J. Wysocki1-0/+1
Fix build issue caused by undefined struct scatterlist in drivers/usb/renesas_usbhs/fifo.c. Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-07-08usb: renesas_usbhs: support multi driverKuninori Morimoto1-14/+41
Some SuperH/board has multi USBHS on it. This patch supports multi register for renesas_usbhs Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-08usb: renesas_usbhs: inaccessible pipe is not an errorKuninori Morimoto1-1/+4
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-08usb: renesas_usbhs: care buff alignment when dma handlerKuninori Morimoto1-0/+6
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-08usb: renesas_usbhs: compile/config are rescuedKuninori Morimoto1-0/+15
This patch rescues renesas_usbhs compile from commit 193ab2a (usb: gadget: allow multiple gadgets to be built) CONFIG_USB_RENESAS_USBHS compile renesas_usbhs main code which is shared between Host/Gadget. CONFIG_USB_RENESAS_USBHS_UDC add mod_gadget to it. It had lost USB_GADGET_DUALSPEED Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-08usb: renesas_usbhs: fixup comment-outKuninori Morimoto3-10/+53
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-01usb: renesas_usbhs: use dma handlerKuninori Morimoto1-2/+2
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-01usb: renesas_usbhs: put obtained dma channel info to debug messageKuninori Morimoto1-1/+1
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-01usb: gadget: allow multiple gadgets to be builtFelipe Balbi1-16/+0
now that we have the udc class, we can allow multiple gadget controller drivers to be compiled as modules. This will allow for distro-like kernels for embedded devices. With this patch, I managed to build an x86 kernel with support for many of the controllers enabled: CONFIG_USB_FUSB300=m CONFIG_USB_R8A66597=m CONFIG_USB_M66592=m CONFIG_USB_AMD5536UDC=m CONFIG_USB_CI13XXX_PCI=m CONFIG_USB_NET2272=m CONFIG_USB_NET2280=m CONFIG_USB_GOKU=m CONFIG_USB_LANGWELL=m CONFIG_USB_EG20T=m Also an ARM kernel with support for many controllers: CONFIG_USB_FUSB300=m CONFIG_USB_OMAP=m CONFIG_USB_R8A66597=m CONFIG_USB_GADGET_MUSB_HDRC=m CONFIG_USB_M66592=m CONFIG_USB_NET2272=m CONFIG_USB_DUMMY_HCD=m The next step would be to get rid of the direct access to arch/ and mach/ directories on some gadget controllers so that we can build all of them without depending on their respective ARCH_* symbols. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-28usb: gadget: convert all users to the new udc infrastructureSebastian Andrzej Siewior1-5/+15
peripheral drivers are using usb_add_gadget()/usb_del_gadget() to register/unregister to the udc-core. The udc-core will take the first available gadget driver and attach function driver which is calling usb_gadget_register_driver(). This is the same behaviour we have right now. Only dummy_hcd was tested, the others were compiled tested. Cc: Alan Stern <[email protected]> Cc: Anton Tikhomirov <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Darius Augulis <[email protected]> Cc: Eric Miao <[email protected]> Cc: Jingoo Han <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Li Yang <[email protected]> Cc: Michael Hennerich <[email protected]> Acked-by: Mike Frysinger <[email protected]> Cc: Nicolas Ferre <[email protected]> Cc: Pavankumar Kondeti <[email protected]> Cc: Roy Huang <[email protected]> Cc: Russell King <[email protected]> Cc: Toshiharu Okada <[email protected]> Cc: Xiaochen Shen <[email protected]> Cc: Yoshihiro Shimoda <[email protected]> Cc: Yuan-Hsin Chen <[email protected]> Cc: cxie4 <[email protected]> Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-14usb: renesas_usbhs: fixup connection failKuninori Morimoto3-3/+12
Sometimes the connection fail happen on renesas_usbhs. This patch fix it up. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-14Merge 3.0-rc2 into usb-linus as it's needed by some USB patchesGreg Kroah-Hartman1-0/+1
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: add DMAEngine supportKuninori Morimoto7-3/+516
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: tidyup pio handler nameKuninori Morimoto3-13/+13
This patch tidyup PIO packet handler name. This is a preparation for DMAEngine support Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: tifyup packet start timingKuninori Morimoto2-17/+11
packet transfer timing are controlled in mod_gadget on current renesas_usbhs, and this style will be imitated on mod_host. But it need not be managed with host/gadget if it is general transfer. By this patch, the packet transfer timing is managed in fifo.c Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: add pipe/fifo linkKuninori Morimoto4-12/+55
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: add usbhsf_fifoKuninori Morimoto4-24/+77
renesas_usbhs has CFIFO/D0FIFO/D1FIFO. But current renesas_usbhs is using CFIFO (for PIO) only for now. The fifo selection method is needed for DMAEngine support. This is a preparation for DMAEngine support Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: shrink spin lock areaKuninori Morimoto4-291/+177
spin lock was very effective while doing 1 packet send/recv on current renesas_usbhs driver. But this lock is enough only - modify packet/pipe link - modify interrpt mask - modify fifo access This patch shrink spin lock area Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: remove usbhsg_queue_getKuninori Morimoto1-19/+5
usbhsg_queue_get is no longer needed. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: modify data transfer interruptKuninori Morimoto5-294/+204
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: modify data transfer methodKuninori Morimoto3-163/+148
On current driver, main data transfer function was implemented in fifo.c, but the overall controlling was implementing in mod_gadget.c. This style is not useful to support host and DMAEngine in the future. But the interrupt for data transfer cannot separate easily for now, because it is deeply related to mod_gadget. This patch move the overall data transfer method into fifo.c except interrupt. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: modify packet queue control methodKuninori Morimoto5-24/+53
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: divide data transfer functionsKuninori Morimoto6-60/+150
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: fifo became independent from pipe.Kuninori Morimoto7-251/+290
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-07usb: renesas_usbhs: modify pipe direction flagsKuninori Morimoto2-1/+11
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-06-06usb/renesas_usbhs: free uep on removalSebastian Andrzej Siewior1-0/+1
Can't find evidence that this is actually done. Cc: Kuninori Morimoto <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-05-11usb: renesas_usbhs: fixup error processing on probe/removeKuninori Morimoto1-6/+6
The error processing order was wrong. This patch modify it. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-05-11usb: renesas_usbhs: fixup fifo disableKuninori Morimoto1-16/+13
It was necessary to check pipe condition after disable fifo. Current driver checked it in a wrong place. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: add autonomy modeKuninori Morimoto4-7/+95
Current renesas_usbhs was designed to save power when USB is not connected. And it assumed platform uses callback to notify connection/disconnection by external interrupt. But some SuperH / platform board doesn't have such feature. This patch adds autonomy mode which detect USB connection/disconnection by internal interrupt. But power will be always ON when autonomy mode is selected. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: use delayed_work instead of work_structKuninori Morimoto2-5/+7
This delay is used to overjump debounce. And, this patch also move usbhsc_drvcllbck_notify_hotplug to global, because it will be called from other files. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: prevent NULL pointer crashKuninori Morimoto1-15/+19
usbhs_status_get_each_irq/usbhs_irq_callback_update might be called with mod == NULL Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: add power control functionKuninori Morimoto1-13/+29
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: move pdev_to_priv to globalKuninori Morimoto2-7/+8
usbhs_pdev_to_priv function will be used in other files. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: add error reason for usbhs_pipe_mallocKuninori Morimoto1-1/+4
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: remove callback when module removed.Kuninori Morimoto1-0/+4
The callback function which is called from platform must be removed if module removed. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: return error if wrong recip requestKuninori Morimoto1-0/+4
There are some USB Host which doesn't notice disconnection at once. And it might try some request after reconnection with old settings. Current renesas_usbhs will crash in such case. This patch prevent this issue. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: modify spinlock methodKuninori Morimoto1-36/+61
Current renesas_usbhs driver was using spin_trylock to avoid dead lock / nest lock. But acording to CONFIG_DEBUG_SPINLOCK, it is BUG under UP environment. This patch add usbhsg_trylock to avoid this issue. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: don't re-allocation pipe bufferKuninori Morimoto1-3/+17
Because pipe buffer allocation is very picky and difficult, current renesas_usbhs driver is not caring pipe re-allocation. In this situation, driver will create new pipe without caring old pipe if "usbhsg_ep_enable" is called after "usbhsg_ep_disable" on current driver. This mean the limited pipe and buffer will be used as waste. But it is possible to re-use same buffer to same pipe. By this patch, driver will initialize pipe when it detected new connection or new gadget, and doesn't try re-allocation for same pipe in above case. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: modify fifo clear timingKuninori Morimoto1-10/+4
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: Driver is depend on SuperHKuninori Morimoto1-0/+1
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29usb: renesas_usbhs: fixup cast warningKuninori Morimoto1-2/+1
This patch fixup cast warning on 64 bit compiler Signed-off-by: Kuninori Morimoto <[email protected]> Reported-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-13usb: renesas_usbhs: Add Renesas USBHS GadgetKuninori Morimoto4-1/+1375
This patch add usb gadget code to SuperH USBHS. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-13usb: renesas_usbhs: Add Renesas USBHS common codeKuninori Morimoto8-0/+1993
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>