aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/renesas_usbhs/common.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-12usb: renesas_usbhs: add OTG ID signal sensingSergei Shtylyov1-0/+17
On the Renesas R8A7791 SoC based boards there's MAX3355 USB OTG chip and mini-AB USB connector corresponding to USB port 0 driven either by EHCI/OHCI or Renesas USBHS gadget controller. And we'd like the host/gadget drivers to work based on the cable type connected. An 'extcon' driver for MAX3355 has been written, so we only need to bind to it via device tree which I'm doing in this patch. (Perhaps, it would also make sense to use OTG HNP when the USBHS host mode is active and a B-cable is connected but I don't have access to host-capable USBHS, so wouldn't be able to test it.) Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-01-12usb: renesas_usbhs: fix platform init error messageSergei Shtylyov1-1/+1
There is a typo ("prove" instead of "probe") in the error message printed when the platform initialization fails. Replace that word with more fitting "init". Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-01-12usb: renesas_usbhs: kill dead code in usbhs_probe()Sergei Shtylyov1-5/+1
usbhsc_drvcllbck_notify_hotplug() always returns 0, so it's rather pointless to store and check its result for being < 0. Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-05usb: renesas_usbhs: gadget: fix the behavior of pullupTakeshi Kihara1-2/+4
This patch fixes an issue that this driver always enable the D+ pullup after it detected the VBUS connection even though this usb controller can control the D+ pullup timing by software. So, this driver should enable the D+ pullup after a gadget driver called usb_gadget_connect(). Signed-off-by: Takeshi Kihara <[email protected]> Signed-off-by: Kazuya Mizuguchi <[email protected]> Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-03usb: renesas_usbhs: common: remove duplicate check on resourceVarka Bhadram1-2/+2
Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-03usb: renesas_usbhs: delete unnecessary 'out of memory' messagesPeter Chen1-3/+1
The memory subsystem has already had similar message for it. Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-09-05usb: renesas_usbhs: Add device tree support for R-Car H2 and M2Yoshihiro Shimoda1-0/+44
This driver supports other SoCs, but they need boards/Soc depend code. So, this patch adds device tree support for R-Car H2 and M2 initially. Signed-off-by: Yoshihiro Shimoda <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-07-16usb: renesas_usbhs: add R-Car Gen. 2 init and power controlUlrich Hecht1-5/+61
In preparation for DT conversion to reduce reliance on platform device callbacks. Signed-off-by: Ulrich Hecht <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-27usb: renesas_usbhs: use platform_{get,set}_drvdata()Libo Chen1-1/+1
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31usb: renesas: use dev_get_platdata()Jingoo Han1-2/+2
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-22usb: Convert to devm_ioremap_resource()Thierry Reding1-5/+4
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Thierry Reding <[email protected]> Acked-by: Alan Stern <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-21usb: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Alexander Shishkin <[email protected]> Acked-by: Felipe Balbi <[email protected]> Cc: Li Yang <[email protected]> Cc: Alan Stern <[email protected]> Cc: Wan ZongShun <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Kukjin Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-21usb: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Alexander Shishkin <[email protected]> Acked-by: Felipe Balbi <[email protected]> Cc: Li Yang <[email protected]> Cc: Alan Stern <[email protected]> Cc: Wan ZongShun <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Kukjin Kim <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-10-16usb: renesas_usbhs: gadget: add usb_gadget_ops :: pullup support[email protected]1-0/+5
This patch adds usbhs_sys_function_pullup() to control D+ line for USB function, and enabled pullup support on mod_gadget. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2012-09-11usb: renesas_usbhs: convert to devm_xxx()Kuninori Morimoto1-11/+4
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-08-10usb: renesas_usbhs: fixup resume method for autonomy modeKuninori Morimoto1-3/+3
If renesas_usbhs is probed as autonomy mode, phy reset should be called after power resumed, and manual cold-plug should be called with slight delay. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-05renesas_usbhs: cleanup quoted includesPaul Bolle1-1/+1
A few quoted includes start with a superfluous "./". Clean up those quoted includes. Signed-off-by: Paul Bolle <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2012-01-24usb: renesas_usbhs: add IRQ resource decoding for IRQF_SHAREDShimoda, Yoshihiro1-5/+6
In case of the SH7757, the irq number of USB module and SUDMAC are the same. So, we have to set the IRQF_SHARED in such a case. Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-13Merge branch 'for-next/gadget' of ↵Greg Kroah-Hartman1-18/+21
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next * 'for-next/gadget' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (50 commits) usb: renesas_usbhs: show error reason on usbhsh_urb_enqueu() usb: renesas_usbhs: add force packet remove method usb: renesas_usbhs: care usb_hcd_giveback_urb() status usb: renesas_usbhs: add usbhsh_is_running() usb: renesas_usbhs: disable attch irq after device attached usb: renesas_usbhs: care pipe sequence usb: renesas_usbhs: add usbhs_pipe_attach() method usb: renesas_usbhs: add usbhsh_endpoint_detach_all() for error case usb: renesas_usbhs: modify device attach method usb: renesas_usbhs: pop packet when urb dequeued usb: renesas_usbhs: add lost error value when enqueue usb: gadget: mv_udc: replace some debug info usb: gadget: mv_udc: refine suspend/resume function usb: gadget: mv_udc: refine the clock relative code usb: gadget: mv_udc: disable ISR when stopped usb: gadget: mv_udc: add otg relative code usb: gadget: Use kcalloc instead of kzalloc to allocate array usb: renesas_usbhs: remove the_controller_link usb: renesas_usbhs: add test-mode support usb: renesas_usbhs: call usbhsg_queue_pop() when pipe disable. ...
2011-12-12usb: renesas_usbhs: add test-mode supportKuninori Morimoto1-0/+5
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-12usb: gadget: renesas_usbhs: modify function name of usbhs_set_device_xx()Kuninori Morimoto1-1/+1
it was device configuration setting function, not only speed. This patch modify function name usbhs_set_device_speed() -> usbhs_set_device_config() Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-12usb: gadget: renesas_usbhs: unified callback functionKuninori Morimoto1-1/+1
renesas_usbhs needs callback for notify hotplug. but it were 2 methods which are almost same. This patch unified these into one. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-12usb: gadget: renesas_usbhs: add platform power control functionKuninori Morimoto1-0/+7
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-12usb: gadget: renesas_usbhs: tidyup the unit of detection_delayKuninori Morimoto1-1/+2
detection_delay was assumed as msec Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-12usb: gadget: renesas_usbhs: tidyup usbhs_sys_clock_ctrl() was local functionKuninori Morimoto1-1/+1
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-12usb: gadget: renesas_usbhs: remove usbhs_sys_usb_ctrl()Kuninori Morimoto1-9/+4
usbhs_sys_usb_ctrl() can collect into usbhs_sys_host/function_ctrl(). Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-12-12usb: gadget: renesas_usbhs: remove usbhs_sys_hispeed_ctrl()Kuninori Morimoto1-9/+4
usbhs_sys_hispeed_ctrl() can collect into usbhs_sys_host/function_ctrl(). Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-11-28usb: convert drivers/usb/* to use module_platform_driver()Axel Lin1-12/+1
This patch converts the drivers in drivers/usb/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Felipe Balbi <[email protected]> Cc: Li Yang <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Sarah Sharp <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Alan Stern <[email protected]> Signed-off-by: Axel Lin <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-11-14usb: gadget: renesas_usbhs: fixup section mismatch warningKuninori Morimoto1-1/+1
Fix up the following section mismatch warnings: WARNING: drivers/usb/renesas_usbhs/renesas_usbhs.o(.text+0xf5d): Section mismatch in reference from the function usbhs_mod_probe() to the function .devinit.text:usbhs_mod_host_probe() The function usbhs_mod_probe() references the function __devinit usbhs_mod_host_probe(). This is often because usbhs_mod_probe lacks a __devinit annotation or the annotation of usbhs_mod_host_probe is wrong. WARNING: drivers/usb/renesas_usbhs/renesas_usbhs.o(.text+0xfd7): Section mismatch in reference from the function usbhs_mod_probe() to the function .devexit.text:usbhs_mod_host_remove() The function usbhs_mod_probe() references a function in an exit section. Often the function usbhs_mod_host_remove() has valid usage outside the exit section and the fix is to remove the __devexit annotation of usbhs_mod_host_remove. WARNING: drivers/usb/renesas_usbhs/renesas_usbhs.o(.text+0x1005): Section mismatch in reference from the function usbhs_mod_remove() to the function .devexit.text:usbhs_mod_host_remove() The function usbhs_mod_remove() references a function in an exit section. Often the function usbhs_mod_host_remove() has valid usage outside the exit section and the fix is to remove the __devexit annotation of usbhs_mod_host_remove. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: bugfix: don't modify platform dataKuninori Morimoto1-10/+14
renesas_usbhs has default callback functions and settings. And it tried overwrite to platform private data if platform doesn't have them. So, if renesas_usbhs was compiled as module, it will be hung-up on 2nd insmod. This patch fixup it. Special thanks to Bastian Reported-by: Bastian Hecht <[email protected]> Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: add usbhs_set_device_speed() support for hostKuninori Morimoto1-0/+42
mod_host needs device speed setup function Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: make sure SOF packet sending-out controlKuninori Morimoto1-0/+7
It is enabled to set SOF packet output bit when USBRST bit was set. And USBRST bit should be set 0 when SOF packet was output. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: support otg pin controlKuninori Morimoto1-0/+4
some renesas_usbhs device is supporting OTG external device interface. In that device, it is necessary to control PWEN/EXTLP on DVSTCTR. This patch support it. But renesas_usbhs driver doesn't have OTG support for now. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: move usbhs_usbreq_get/set_val() to common.cKuninori Morimoto1-0/+26
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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: add usbhs_bus_get_speed()Kuninori Morimoto1-0/+16
current mod_gadget had got usb speed on usbhsg_irq_dev_state() which is status change interrupt callback function. And the usb speed data was included in its parameter. But this style works for mod_gadget, but doesn't work for mod_host which isn't interrupted when device status was changed. This patch add usbhs_bus_get_speed() to solve this issue. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: add bus control functionsKuninori Morimoto1-1/+34
this patch add DVSTCTR control function for HOST support Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: change usbhsc_bus_ctrl() to usbsc_set_buswait()Kuninori Morimoto1-10/+5
renesas_usbhs will have register DVSTCTR control function for HOST support. This patch changes usbhsc_bus_ctrl() to usbsc_set_buswait(), to remove DVSTCTR access from it, Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-10-13usb: gadget: renesas_usbhs: add suspend/resume supportKuninori Morimoto1-5/+64
Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2011-07-08usb: renesas_usbhs: fixup comment-outKuninori Morimoto1-0/+23
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-06-07usb: renesas_usbhs: add DMAEngine supportKuninori Morimoto1-0/+2
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: add usbhsf_fifoKuninori Morimoto1-1/+8
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-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-04-29usb: renesas_usbhs: add autonomy modeKuninori Morimoto1-7/+29
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 Morimoto1-4/+5
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: 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 Morimoto1-7/+7
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: 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-13usb: renesas_usbhs: Add Renesas USBHS common codeKuninori Morimoto1-0/+394
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]>