ARM: shmobile: lager: USBHS callback elimination
Subsystems (5)
v2 cover ARM: shmobile: lager: USBHS callback elimination
Changes in v2:
- move phy handle to struct usbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board code
Ulrich Hecht (2):
usb: renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacks
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.h
Signature · 1 line
1.8.4.5
PATCH v2 1/2 usb: renesas_usbhs: add R-Car Gen. 2 init and power control
In preparation for DT conversion to reduce reliance on platform device callbacks.
--- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++++++++++++++++--- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 ++++++++++++++++++++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 +++ 6 files changed, 150 insertions(+), 6 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.h
drivers/usb/renesas_usbhs/Makefile +1 -1
@@ -4,7 +4,7 @@ obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs.o -renesas_usbhs-y := common.o mod.o pipe.o fifo.o +renesas_usbhs-y := common.o mod.o pipe.o fifo.o rcar2.o ifneq ($(CONFIG_USB_RENESAS_USBHS_HCD),) renesas_usbhs-y += mod_host.o
drivers/usb/renesas_usbhs/common.c +61 -5
112 lines not on this page · raw message
drivers/usb/renesas_usbhs/common.h +2 -0
@@ -268,6 +268,8 @@ struct usbhs_priv {* fifo control */ struct usbhs_fifo_info fifo_info; + +struct usb_phy *phy; };/*
drivers/usb/renesas_usbhs/rcar2.c new file +76 -0
76 lines not on this page · raw message
drivers/usb/renesas_usbhs/rcar2.h new file +4 -0
@@ -0,0 +1,4 @@ +#include "common.h" + +extern const struct renesas_usbhs_platform_callback + usbhs_rcar2_ops;
include/linux/usb/renesas_usbhs.h +6 -0
@@ -153,6 +153,9 @@ struct renesas_usbhs_driver_param {*/ int pio_dma_border;/* default is 64byte */ +u32 type; +u32 enable_gpio; +/* * option: */
@@ -160,6 +163,9 @@ struct renesas_usbhs_driver_param { u32 has_sudmac:1; /* for SUDMAC */ }; +#define USBHS_TYPE_R8A7790 1 +#define USBHS_TYPE_R8A7791 2 +/* * option: *
Signature · 1 line
1.8.4.5
PATCH v2 2/2 ARM: shmobile: lager: remove USBHS callbacks
In reply to Ulrich HechtLet the driver handle initialization and power control.
--- arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- 1 file changed, 13 insertions(+), 113 deletions(-)
arch/arm/mach-shmobile/board-lager.c +13 -113
@@ -420,117 +420,17 @@ static const struct resource usbhs_resources[] __initconst = { DEFINE_RES_IRQ(gic_spi(107)), }; -struct usbhs_private { -struct renesas_usbhs_platform_info info; -struct usb_phy *phy; -}; - -#define usbhs_get_priv (pdev) \ - container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info) - -static int usbhs_power_ctrl (struct platform_device *pdev, -void __iomem *base,int enable) -{ -struct usbhs_private *priv =usbhs_get_priv (pdev); - -if (!priv->phy) -return -ENODEV ; - -if (enable) { -int retval =usb_phy_init (priv->phy); - -if (!retval) - retval =usb_phy_set_suspend (priv->phy,0 ); -return retval; - } - -usb_phy_set_suspend (priv->phy,1 ); -usb_phy_shutdown (priv->phy); -return 0 ; -} - -static int usbhs_hardware_init (struct platform_device *pdev) -{ -struct usbhs_private *priv =usbhs_get_priv (pdev); -struct usb_phy *phy; -int ret; - -/* USB0 Function - use PWEN as GPIO input to detect DIP Switch SW5 -* setting to avoid VBUS short circuit due to wrong cable. -* PWEN should be pulled up high if USB Function is selected by SW5 -*/ -gpio_request_one (RCAR_GP_PIN (5 ,18 ),GPIOF_IN ,NULL );/* USB0_PWEN */ -if (!gpio_get_value (RCAR_GP_PIN (5 ,18 ))) { -pr_warn ("Error: USB Function not selected - check SW5 + SW6\n" ); - ret = -ENOTSUPP ; - goto error; - } - - phy =usb_get_phy_dev (&pdev->dev,0 ); -if (IS_ERR (phy)) { - ret =PTR_ERR (phy); - goto error; - } - - priv->phy = phy; -return 0 ; - error: -gpio_free (RCAR_GP_PIN (5 ,18 )); -return ret; -} - -static int usbhs_hardware_exit (struct platform_device *pdev) -{ -struct usbhs_private *priv =usbhs_get_priv (pdev); - -if (!priv->phy) -return 0 ; - -usb_put_phy (priv->phy); - priv->phy =NULL ; - -gpio_free (RCAR_GP_PIN (5 ,18 )); -return 0 ; -} - -static int usbhs_get_id (struct platform_device *pdev) -{ -return USBHS_GADGET ; -} - -static u32 lager_usbhs_pipe_type[] = { -USB_ENDPOINT_XFER_CONTROL , -USB_ENDPOINT_XFER_ISOC , -USB_ENDPOINT_XFER_ISOC , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_INT , -USB_ENDPOINT_XFER_INT , -USB_ENDPOINT_XFER_INT , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -USB_ENDPOINT_XFER_BULK , -}; - -static struct usbhs_private usbhs_priv__initdata = { - .info = { - .platform_callback = { - .power_ctrl = usbhs_power_ctrl, - .hardware_init = usbhs_hardware_init, - .hardware_exit = usbhs_hardware_exit, - .get_id = usbhs_get_id, - }, - .driver_param = { - .buswait_bwait =4 , - .pipe_type = lager_usbhs_pipe_type, - .pipe_size =ARRAY_SIZE (lager_usbhs_pipe_type), - }, - } +static struct renesas_usbhs_platform_info usbhs_info__initdata = { + .driver_param = { + .buswait_bwait =4 , + .type =USBHS_TYPE_R8A7790 , +/* USB0 Function - use PWEN as GPIO input to detect DIP +* Switch SW5 setting to avoid VBUS short circuit due to +* wrong cable. PWEN should be pulled up high if USB +* Function is selected by SW5. +*/ + .enable_gpio =RCAR_GP_PIN (5 ,18 ), + }, };static void __init lager_register_usbhs (void )
@@ -540,8 +440,8 @@ static void __init lager_register_usbhs(void)"renesas_usbhs" ,-1 , usbhs_resources,ARRAY_SIZE (usbhs_resources), - &usbhs_priv.info, - sizeof(usbhs_priv.info)); + &usbhs_info, + sizeof(usbhs_info)); }/* USBHS PHY */
Signature · 1 line
1.8.4.5
v2 cover ARM: shmobile: lager: USBHS callback elimination
In reply to Ulrich HechtHi
Quoted 9 lines
Changes in v2:
- move phy handle to structusbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board codeUlrich Hecht (2):
usb:renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacks
Quoted 10 lines
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.h
For all patches
v2 cover ARM: shmobile: lager: USBHS callback elimination
In reply to Ulrich HechtHi Ulrich,
Quoted 9 lines · Ulrich Hecht
Changes in v2:
- move phy handle to structusbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board codeUlrich Hecht (2):
usb:renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacks
Quoted 11 lines
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.h
I tested these patches on Lager legacy, and these patches worked correctly.
Best regards,
Yoshihiro Shimoda
v2 cover ARM: shmobile: lager: USBHS callback elimination
[Cc Felipe Balbi]
Quoted 26 lines · Kuninori Morimoto
Hi
Quoted 9 lines
Changes in v2:
- move phy handle to structusbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board codeUlrich Hecht (2):
usb:renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacksQuoted 10 lines
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.hFor all patches
[snip]
Quoted 3 lines
I tested these patches on Lager legacy, and these patches worked correctly.
Tested-by Yoshihiro Shimoda <[email protected]>
Hi,
it seems that the 2nd patch should go through my renesas tree but it depends on the first patch which should be taken by Felipe Balbi (Cced).
Felipe, is there any chance that you could take this for v3.16? I am quite happy to make a branch for you to pull for renesas_usbhs if this would make your life easier.
v2 cover ARM: shmobile: lager: USBHS callback elimination
Quoted 38 lines · Simon Horman
[Cc Felipe Balbi]
Quoted 26 lines · Kuninori Morimoto
Hi
Quoted 9 lines
Changes in v2:
- move phy handle to structusbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board codeUlrich Hecht (2):
usb:renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacksQuoted 10 lines
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.hFor all patches
[snip]
Quoted 3 lines
I tested these patches on Lager legacy, and these patches worked correctly.
Tested-by Yoshihiro Shimoda <[email protected]>Hi,
Quoted 7 lines
it seems that the 2nd patch should go through my renesas tree but it depends on the first patch which should be taken by Felipe Balbi (Cced).
Felipe, is there any chance that you could take this for v3.16? I am quite happy to make a branch for you to pull for
renesas_usbhsif this would make your life easier.
you need to take both patches or just patch 1 ?
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140711/77a83077/attachment.sig>
v2 cover ARM: shmobile: lager: USBHS callback elimination
Quoted 43 lines · Felipe Balbi
Quoted 42 lines · Simon Horman
[Cc Felipe Balbi]
Quoted 26 lines · Kuninori Morimoto
Hi
Quoted 9 lines
Changes in v2:
- move phy handle to structusbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board codeUlrich Hecht (2):
usb:renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacksQuoted 10 lines
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.hFor all patches
[snip]
Quoted 3 lines
I tested these patches on Lager legacy, and these patches worked correctly.
Tested-by Yoshihiro Shimoda <[email protected]>Hi,
it seems that the 2nd patch should go through my renesas tree but it depends on the first patch which should be taken by Felipe Balbi (Cced).
Quoted 5 lines
Quoted 3 lines
Felipe, is there any chance that you could take this for v3.16? I am quite happy to make a branch for you to pull for
renesas_usbhsif this would make your life easier.you need to take both patches or just patch 1 ?
Please just take patch 1.
Thanks
v2 cover ARM: shmobile: lager: USBHS callback elimination
Quoted 44 lines · Simon Horman
Quoted 43 lines · Felipe Balbi
Quoted 42 lines · Simon Horman
[Cc Felipe Balbi]
Quoted 26 lines · Kuninori Morimoto
Hi
Quoted 9 lines
Changes in v2:
- move phy handle to structusbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board codeUlrich Hecht (2):
usb:renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacksQuoted 10 lines
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.hFor all patches
[snip]
Quoted 3 lines
I tested these patches on Lager legacy, and these patches worked correctly.
Tested-by Yoshihiro Shimoda <[email protected]>Hi,
it seems that the 2nd patch should go through my renesas tree but it depends on the first patch which should be taken by Felipe Balbi (Cced).
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Felipe, is there any chance that you could take this for v3.16? I am quite happy to make a branch for you to pull for
renesas_usbhsif this would make your life easier.you need to take both patches or just patch 1 ?
Please just take patch 1.
will do.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140711/d012ef40/attachment.sig>
v2 cover ARM: shmobile: lager: USBHS callback elimination
Quoted 49 lines · Felipe Balbi
Quoted 48 lines · Simon Horman
Quoted 47 lines · Felipe Balbi
Quoted 45 lines · Simon Horman
[Cc Felipe Balbi]
Quoted 26 lines · Kuninori Morimoto
Hi
Quoted 9 lines
Changes in v2:
- move phy handle to structusbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board codeUlrich Hecht (2):
usb:renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacksQuoted 10 lines
arch/arm/mach-shmobile/board-lager.c | 126 ++++------------------------------- drivers/usb/renesas_usbhs/Makefile | 2 +- drivers/usb/renesas_usbhs/common.c | 66 ++++++++++++++++-- drivers/usb/renesas_usbhs/common.h | 2 + drivers/usb/renesas_usbhs/rcar2.c | 76 +++++++++++++++++++++ drivers/usb/renesas_usbhs/rcar2.h | 4 ++ include/linux/usb/renesas_usbhs.h | 6 ++ 7 files changed, 163 insertions(+), 119 deletions(-) create mode 100644 drivers/usb/renesas_usbhs/rcar2.c create mode 100644 drivers/usb/renesas_usbhs/rcar2.hFor all patches
[snip]
Quoted 3 lines
I tested these patches on Lager legacy, and these patches worked correctly.
Tested-by Yoshihiro Shimoda <[email protected]>Hi,
it seems that the 2nd patch should go through my renesas tree but it depends on the first patch which should be taken by Felipe Balbi (Cced).
Felipe, is there any chance that you could take this for v3.16? I am quite happy to make a branch for you to pull for
renesas_usbhsif this would make your life easier.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
you need to take both patches or just patch 1 ?
Please just take patch 1.
will do.
Thanks.
Ulrich, please repost patch #2 once patch #1 hits an rc release.