summaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
Commit message (Collapse)AuthorAgeFilesLines
* usb: renesas_usbhs: gadget: fix giveback status code in usbhsg_pipe_disable()Yoshihiro Shimoda2016-03-041-1/+1
| | | | | | | | | A udc driver should set the giveback status to -ESHUTDOWN in usb_ep_disable(). Otherwise, a gadget driver (e.g. g_serial) might request next data wrongly and it is possible to cause kernel panic. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
* usb: renesas_usbhs: Don't check CSSTS bit if peripheral modeYoshihiro Shimoda2016-03-041-4/+2
| | | | | | | | | | Since Some SoCs (e.g. R-Car Gen2) don't have the CSSTS bit in the pipectrl registers ({DCP,PIPEn}CTR) because such SoCs have peripheral mode only. So, this driver should not check the CSSTS bit if peripheral mode is running. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
* usb: renesas_usbhs: add R-Car Gen3 power controlYoshihiro Shimoda2016-03-044-5/+68
| | | | | | | | | | Since the usb2 phy driver for gen3 (phy-rcar-gen3-usb2) cannot access LPSTS and UGCTRL2 registers in the HSUSB module, this driver have to initialize the registers. So, this patch adds such handling code into rcar3.c. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
* usb: renesas_usbhs: Use ARCH_RENESASSimon Horman2016-02-201-1/+1
| | | | | | | | | | | Make use of ARCH_RENESAS in place of ARCH_SHMOBILE. This is part of an ongoing process to migrate from ARCH_SHMOBILE to ARCH_RENESAS the motivation for which being that RENESAS seems to be a more appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: renesas_usbhs: constify usbhs_pkt_handle structuresJulia Lawall2016-01-243-21/+21
| | | | | | | | | | | The usbhs_pkt_handle structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: renesas_usbhs: add fallback compatibility stringsSimon Horman2015-12-161-0/+9
| | | | | | | | | | Add fallback compatibility strings for R-Car Gen2 and Gen3. This is in keeping with the fallback scheme being adopted wherever appropriate for drivers for Renesas SoCs. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: Modify ep.caps.type_xxx and usb_ep_maxpacket_limit()Yoshihiro Shimoda2015-12-151-7/+12
| | | | | | | | | | | | | | | | This patch modifies the ep.caps.type_{iso,bulk,int} setting and the second argument of usb_ep_maxpacket_limit() using the dparam.pipe_configs. In the previous code, all the type_{iso,bulk,int} were set to true. However, to avoid waste time for finding suitable pipe in usb_ep_enable(), this driver should set correct type. Also the second argument of usb_ep_maxpacket_limit() was set to 512 even if the pipe is isochronous or interrupt. So, this driver could not bind a gadget driver like the g_audio driver. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: Modify pipe configurationYoshihiro Shimoda2015-12-154-127/+66
| | | | | | | | | | | | | | | The current code has info->bufnmb_last to calculate the BUFNMB bits of PIPEBUF register. However, since the bufnmb_last is initialized in the usbhs_pipe_init() only, this driver is possible to set unexpected value to the register if usb_ep_{enable,disable}() are called many times. So, this patch modifies the pipe configuration via struct renesas_usbhs_driver_param to simplify the code. Also this patch changes: - a double buffer configuration - isochronous buffer size from 512 to 1024 Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: gadget: Fix NULL pointer dereference in usbhsg_ep_dequeue()Yoshihiro Shimoda2015-11-191-2/+9
| | | | | | | | | | | This patch fixes an issue that NULL pointer dereference happens when a gadget driver calls usb_ep_dequeue() for ep0 after disconnected a usb cable. This is because that usbhsg_try_stop() will call usbhsg_ep_disable(&dcp->ep) when a usb cable is disconnected and the pipe of dcp (ep0) is set to NULL. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'pinctrl-v4.4-1' of ↵Linus Torvalds2015-11-021-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "This is the big bulk of pin control changes for the v4.4 kernel development cycle. Development pace is high in pin control again this merge window. 28 contributors, 83 patches. It hits a few sites outside the pin control subsystem: - Device tree bindings in Documentation (as usual) - MAINTAINERS - drivers/base/* for the "init" state handling by Doug Anderson. This has been ACKed by Greg. - drivers/usb/renesas_usbhs/rcar2.c, for a dependent Renesas change in the USB subsystem. This has been ACKed by both Greg and Felipe. - arch/arm/boot/dts/sama5d2.dtsi - this should ideally have gone through the ARM SoC tree but ended up here. This time I am using Geert Uytterhoeven as submaintainer for SH PFC since the are three-four people working in parallel with new Renesas ASICs. Summary of changes: Infrastructure: - Doug Anderson wrote a patch adding an "init" state different from the "default" state for pin control state handling in the core framework. This is applied before the driver's probe() call if defined and takes precedence over "default". If both are defined, "init" will be applied *before* probe() and "default" will be applied *after* probe(). Significant subdriver improvements: - SH PFC is switched to getting GPIO ranges from the device tree ranges property on DT platforms. - Got rid of CONFIG_ARCH_SHMOBILE_LEGACY, we are all modernized. - Got rid of SH PFC hardcoded IRQ numbers. - Allwinner sunxi external interrupt through the "r" controller. - Moved the Cygnus driver to use DT-provided GPIO ranges. New drivers: - Atmel PIO4 pin controller for the SAMA4D2 family New subdrivers: - Rockchip RK3036 subdriver - Renesas SH PFC R8A7795 subdriver - Allwinner sunxi A83T PIO subdriver - Freescale i.MX7d iomux lpsr subdriver - Marvell Berlin BG4CT subdriver - SiRF Atlas 7 step B SoC subdriver - Intel Broxton SoC subdriver Apart from this, the usual slew if syntactic and semantic fixes" * tag 'pinctrl-v4.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (81 commits) pinctrl: pinconf: remove needless loop pinctrl: uniphier: guard uniphier directory with CONFIG_PINCTRL_UNIPHIER pinctrl: zynq: fix UTF-8 errors pinctrl: zynq: Initialize early pinctrl: at91: add missing of_node_put pinctrl: tegra-xusb: Correct lane mux options pinctrl: intel: Add Intel Broxton pin controller support pinctrl: intel: Allow requesting pins which are in ACPI mode as GPIOs pinctrl: intel: Add support for multiple GPIO chips sharing the interrupt drivers/pinctrl: Add the concept of an "init" state pinctrl: uniphier: set input-enable before pin-muxing pinctrl: cygnus: Add new compatible string for gpio controller driver pinctrl: cygnus: Remove GPIO to Pinctrl pin mapping from driver pinctrl: cygnus: Optional DT property to support pin mappings pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block pinctrl: sh-pfc: Remove obsolete r8a7778 platform_device_id entry pinctrl: sh-pfc: Remove obsolete r8a7779 platform_device_id entry pinctrl: sh-pfc: Stop including <linux/platform_data/gpio-rcar.h> usb: renesas_usbhs: Remove unneeded #include <linux/platform_data/gpio-rcar.h> ...
| * usb: renesas_usbhs: Remove unneeded #include <linux/platform_data/gpio-rcar.h>Geert Uytterhoeven2015-10-201-1/+0
| | | | | | | | | | | | | | | | | | This header file will be removed soon. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Felipe Balbi <balbi@ti.com>
* | usb: renesas_usbhs: Add support for R-Car H3Yoshihiro Shimoda2015-09-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds a compatible string to support for R-Car H3. Since the HS-USB controller of R-Car H3 is almost the same specification with R-Car Gen2 (these have 16 pipes and usb-dmac), this patch sets the "type" of renesas_usbhs_driver_param to USBHS_TYPE_RCAR_GEN2. Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: renesas_usbhs: fix build warning if 64-bit architectureYoshihiro Shimoda2015-09-301-1/+1
|/ | | | | | | | | | | This patch fixes the following warning if 64-bit architecture environment: ./drivers/usb/renesas_usbhs/common.c:496:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] dparam->type = of_id ? (u32)of_id->data : 0; Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas: gadget: add ep capabilities supportRobert Baldyga2015-08-041-0/+6
| | | | | | | Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUSPhil Edworthy2015-07-291-0/+62
| | | | | | | | | These changes allow a PHY driver to trigger a VBUS interrupt and to provide the value of VBUS. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: Replace deprecated API of extconChanwoo Choi2015-07-291-1/+1
| | | | | | | | | | | | | | | | | This patch removes the deprecated API of extcon and then use the new extcon API with the unique id to indicate the each external connector (USB-HOST). - extcon_get_cable_state(*edev, char *) -> extcon_get_cable_state_(*edev, id) Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Felipe Balbi <balbi@ti.com> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: Peter Chen <peter.chen@freescale.com> Cc: Varka Bhadram <varkab@cdac.in> Cc: Takeshi Kihara <takeshi.kihara.df@renesas.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'usb-for-v4.2' of ↵Greg Kroah-Hartman2015-06-024-51/+64
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v4.2 merge window - dwc2 adds hibernation support - preparation for sunxi glue to musb driver - new ULPI bus - new ULPI PHY driver for TUSB1210 - musb patches to support multiple DMA engines on same binary - support for R-Car E2 on renesas_usbhs Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: renesas_usbhs: Add support for R-Car E2Yoshihiro Shimoda2015-05-261-0/+4
| | | | | | | | | | | | | | | | This patch adds a compatible string to support for R-Car E2. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>" in patch 2 Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: renesas_usbhs: Change USBHS_TYPE_R8A779x to USBHS_TYPE_RCAR_GEN2Yoshihiro Shimoda2015-05-261-11/+4
| | | | | | | | | | | | | | | | | | Since the HSUSB controllers of R-Car Gen2 are the same specification (they have 16 pipes and usb-dmac), this patch changes USBHS_TYPE_R8A7790 and USBHS_TYPE_R8A7791 to USBHS_TYPE_RCAR_GEN2. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: renesas_usbhs: avoid uninitialized variable useArnd Bergmann2015-05-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the renesas_usbhs driver is enabled in ARM multi_v7_defconfig, we now get a new warning: renesas_usbhs/mod.c: In function 'usbhs_interrupt': renesas_usbhs/mod.c:246:7: warning: 'intenb1' may be used uninitialized in this function [-Wmaybe-uninitialized] gcc correctly points to a problem here, for the case that the device is in host mode, we use the intenb1 variable without having assigned it first. The state->intsts1 has a similar problem, but gcc cannot know that. This avoids the problem by initializing both sides of the comparison to zero when we don't read them from the respective registers. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 88a25e02f3 ("usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register") Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 registerNobuhiro Iwamatsu2015-05-141-27/+34
| | | | | | | | | | | | | | | | | | INTSTS1 and INTENB1 register of renesas_usbhs can access only Host mode. This adds process of accessing INTSTS1 and INTENB1 only when renesas_usbhs is Host mode. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: renesas_usbhs: Revise the binding document about the dma-namesYoshihiro Shimoda2015-04-281-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the DT should describe the hardware (not the driver limitation), This patch revises the binding document about the dma-names to change simple numbering as "ch%d" instead of "tx<n>" and "rx<n>". Also this patch fixes the actual code of renesas_usbhs driver to handle the new dma-names. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: renesas_usbhs: tidyup usbhs_for_each_dfifo macroKuninori Morimoto2015-04-271-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current usbhs_for_each_dfifo macro will read out-of-array's memory after last loop operation. It was not good C language operation, and the binary which was compiled by (at least) gcc 4.8.1 is broken. This patch is based on 925403f425a4a9c503f2fc295652647b1eb10d82 (usb: renesas_usbhs: tidyup original usbhsx_for_each_xxx macro) Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: renesas_usbhs: Don't disable the pipe if Control write status stageYoshihiro Shimoda2015-05-311-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes an issue that sometimes this controller is not able to complete the Control write status stage. This driver should enable DCPCTR.CCPL and PID_BUF to complete the status stage. However, if this driver detects the ctrl_stage interruption first before the control write data is received, this driver will clear the PID_BUF wrongly in the usbhsf_pio_try_pop(). To avoid this issue, this patch doesn't clear the PID_BUF in the usbhsf_pio_try_pop(). (Since also the privious code doesn't disable the PID_BUF after a control transfer was finished, this patch doesn't have any side efforts.) Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | usb: renesas_usbhs: Fix fifo unclear in usbhsf_prepare_popKazuya Mizuguchi2015-05-311-0/+5
|/ | | | | | | | | | | This patch fixes an issue for control write. When usbhsf_prepare_pop() is called after this driver called a gadget setup function, this controller doesn't receive the control write data. So, this patch adds a code to clear the fifo for control write in usbhsf_prepare_pop(). Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* renesas_usbhs: mod_host: use USB_DT_HUBSergei Shtylyov2015-04-031-1/+1
| | | | | | | | Fix using the bare number to set the 'bDescriptorType' field of the Hub Descriptor while the value is #define'd in <linux/usb/ch11.h>. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: renesas_usbhs: fix spinlock suspected in a gadget complete functionYoshihiro Shimoda2015-03-191-3/+19
| | | | | | | | | | | | | | According to the gadget.h, a "complete" function will always be called with interrupts disabled. However, sometimes usbhsg_queue_pop() function is called with interrupts enabled. So, this function should be held by usbhs_lock() to disable interruption. Also, this driver has to call spin_unlock() to avoid spinlock recursion by this driver before calling usb_gadget_giveback_request(). Otherwise, there is possible to cause a spinlock suspected in a gadget complete function. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: add support for USB-DMACYoshihiro Shimoda2015-03-136-6/+226
| | | | | | | | | | | | | | | | Some Renesas SoCs have the USB-DMAC. It is able to terminate transfers when a short packet is received, even if less bytes than the transfer counter size have been received. Also, it is able to send a short packet even if the packet size is not multiples of 8bytes. Since the previous code has used the interruption of USBHS controller when receiving packets even if this driver has used a dmac, a lot of interruptions has happened. This patch will reduce such interruptions. This patch allows to use the USB-DMAC on R-Car H2 and M2. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: fix the sequence in xfer_work()Yoshihiro Shimoda2015-03-131-2/+2
| | | | | | | | This patch fixes the setup sequence in xfer_work(). Otherwise, sometimes a usb transaction will get stuck. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: add the channel number in dma-namesYoshihiro Shimoda2015-03-131-7/+13
| | | | | | | | | To connect the channel of USB-DMAC to USBHS DnFIFO number, this patch adds this channel/FIFO number in dma-names. Otherwise, this driver needs to add analysis code for device tree. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas: fix extcon dependencyArnd Bergmann2015-02-231-0/+1
| | | | | | | | | | | | | | | The renesas usbhs driver calls extcon_get_edev_by_phandle(), which is defined in drivers/extcon/extcon-class.c, and that can be a loadable module. If the extcon-class support is disabled, usbhs will work correctly for all devices that do not need extcon. However, if extcon-class is a loadable module, and usbhs is built-in, the kernel fails to link. In order to solve that, we need a Kconfig dependency that allows extcon to be disabled but does not allow usbhs built-in if extcon is a module. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: fix NULL pointer dereference in dma_release_channel()Yoshihiro Shimoda2015-01-301-0/+4
| | | | | | | | | | | | | | | | | | This patch fixes an issue that the following commit causes NULL pointer dereference in dma_release_channel(). "usb: renesas_usbhs: add support for requesting DT DMA" (commit id abd2dbf6bb1b5f3a03a8c76b1a8879da1dd30caa) The usbhsf_dma_init_dt() should set fifo->{t,r}x_chan to NULL if dma_request_slave_channel_reason() returns IS_ERR value. Otherwise, usbhsf_dma_quit() will call dma_release_channel(), and then NULL pointer dereference happens. Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Simon Horman <horms+renesas@verge.net.au> Reported-by: Simon Horman <horms@verge.net.au> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: gadget: set value for common is_selfpoweredPeter Chen2015-01-291-0/+2
| | | | | | | Set value for common is_selfpowered. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: add support for requesting DT DMAYoshihiro Shimoda2015-01-271-1/+10
| | | | | | | | This patch adds dma_request_slave_channel_reason() calling to request dma slave channels for multiplatform environment. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: add usbhsf_dma_init_pdev() functionYoshihiro Shimoda2015-01-271-3/+9
| | | | | | | | To add support for requesting DT DMA in the future, this patch adds usbhsf_dma_init_pdev() function. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: mod_host: use HUB_CHAR_*Sergei Shtylyov2015-01-271-1/+2
| | | | | | | | Fix using the bare number to set the 'wHubCharacteristics' field of the Hub Descriptor while the values are #define'd in <linux/usb/ch11.h>. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: add OTG ID signal sensingSergei Shtylyov2015-01-122-0/+20
| | | | | | | | | | | | | | | 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 <sergei.shtylyov@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: fix platform init error messageSergei Shtylyov2015-01-121-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 <sergei.shtylyov@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: kill dead code in usbhs_probe()Sergei Shtylyov2015-01-121-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 <sergei.shtylyov@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: expand USB-DMAC channels for R-Car Gen2Yoshihiro Shimoda2014-11-123-1/+7
| | | | | | | | | This patch expands USB-DMAC channels for R-Car Gen2 SoCs. The SoCs have 4 channels. If d{2,3}_{t,x}x_id are not set, this driver never uses the expanded USB-DMAC channels. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: add a new macro for extending DnFIFOsYoshihiro Shimoda2014-11-121-2/+7
| | | | | | | | To extend DnFIFOs in the future, this patch adds a new macro because some SoCs don't the "port" address for DnFIFOs. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: standardize d{0,1}fifo controlYoshihiro Shimoda2014-11-122-38/+37
| | | | | | | | To expand DnFIFOs in the future, this patch standardizes the d{0,1}fifo control using new macros. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: change d{0,1}fifo to dfifo arrayYoshihiro Shimoda2014-11-122-4/+4
| | | | | | | | To extend DnFIFOs in the future, this patch changes d{0,1}fifo of usbhs_fifo_info to dfifo array. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: fix usbhs_pipe_clear() for DCP PIPEYoshihiro Shimoda2014-11-055-4/+27
| | | | | | | | | | | Since the DCPCTR doesn't have the ACLRM bit, the usbus_pipe_clear() should not call the usbhsp_pipectrl_set() with ACLRM. So, this patch fixes this issue to add the usbhs_fifo_clear_dcp() in fifo.c because the controller needs the CFIFO to clear the the DCP PIPE. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: fix the timing of dcp_control_transfer_doneYoshihiro Shimoda2014-11-052-16/+3
| | | | | | | | | | | | | | | | | | | | | | According to the datasheet, this driver should clear the INTSTS0.CTRT bit before this controller detects the next stage transition. Otherwise, the driver may not be able to clear the bit after the controller went to the next stage transition. After that, the driver will not be able to clear the INTSTS0.VALID, and a usb control transfer will not finish finally. If we use the testusb tool, it is easy to reproduce this issue: # testusb -a -t 10 Since the previous code handled a data stage and a status stage in the usbhsf_pio_try_push(), it may not clear the INTSTS0.CTRT at the right timing. So, this patch change the timing of usbhs_dcp_control_transfer_done() to the usbhsg_irq_ctrl_stage(). Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: gadget: fix the behavior of pullupTakeshi Kihara2014-11-052-3/+33
| | | | | | | | | | | | 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 <takeshi.kihara.df@renesas.com> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()Kazuya Mizuguchi2014-11-051-0/+3
| | | | | | | | | | | | | | | This patch fixes an issue that the NULL pointer dereference happens when we uses g_audio driver. Since the g_audio driver will call usb_ep_disable() in afunc_set_alt() before it calls usb_ep_enable(), the uep->pipe of renesas usbhs driver will be NULL. So, this patch adds a condition to avoid the oops. Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Fixes: 2f98382dc (usb: renesas_usbhs: Add Renesas USBHS Gadget) Cc: <stable@vger.kernel.org> # v3.0+ Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: common: remove duplicate check on resourceVarka Bhadram2014-11-031-2/+2
| | | | | | | Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: remove unnecessary 'driver' argumentFelipe Balbi2014-11-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | now that no UDC driver relies on the extra 'driver' argument to ->udc_stop(), we can safely remove it. This commit is based on previous work by Robert Baldyga <r.baldyga@samsung.com> which can be found at [1]; however that patch turned out to have a high probability of regressing many UDC drivers because of a blind search & replace s/driver/$udc->driver/ which caused the 'driver' argument to stop_activity() to be a valid non-NULL pointer when it should be NULL, thus causing UDCs to mistakenly call gadget driver's ->disconnect() callback. [1] http://markmail.org/message/x5zneg4xea4zntab Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: renesas_usbhs: delete unnecessary 'out of memory' messagesPeter Chen2014-11-031-3/+1
| | | | | | | The memory subsystem has already had similar message for it. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud