* [PATCH V2 0/5] USB: host: Remove non-DT support for Exynos EHCI and OHCI
@ 2013-10-10 7:40 Jingoo Han
2013-10-10 7:40 ` [PATCH V2 1/5] ARM: SAMSUNG: Remove unused s5p_device_ehci Jingoo Han
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Jingoo Han @ 2013-10-10 7:40 UTC (permalink / raw)
To: 'Greg Kroah-Hartman'
Cc: linux-usb, linux-samsung-soc, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat',
'Jingoo Han'
This patchset removes non-DT support for Exynos EHCI and OHCI
from arch and driver directories, because the non-DT for EXYNOS SoCs
is not supported from v3.11. Also, missing usb_put_hcd() is added to
prevent memory leak.
In order to keep the consistency, ehci-s5p.c is changed to
ehci-exynos.c. So, the names of Exynos EHCI and OHCI drivers are
as below:
- ehci-exynos.c
- ohci-exynos.c
In order to prevent build error issues or merge conflict,
this patchset includes the following patches that were
previously submitted.
- [PATCH] ARM: SAMSUNG: Remove unused s5p_device_ehci
(http://www.spinics.net/lists/linux-samsung-soc/msg23397.html)
- [PATCH] USB: ohci-exynos: Add missing usb_put_hcd() to prevent memory leak
(http://www.spinics.net/lists/linux-usb/msg95282.html)
These patches were tested on Exynos5250.
Changes from v1:
* Changed the order of patches in order to avoid unnecessary code churn
Jingoo Han (5)
ARM: SAMSUNG: Remove unused s5p_device_ehci
USB: ehci-s5p: Remove non-DT support
USB: ohci-exynos: Remove non-DT support
USB: ohci-exynos: Add missing usb_put_hcd()
USB: host: Rename ehci-s5p to ehci-exynos
---
arch/arm/plat-samsung/Kconfig | 5 -
arch/arm/plat-samsung/devs.c | 34 -----
arch/arm/plat-samsung/include/plat/devs.h | 1 -
drivers/usb/host/Kconfig | 5 +-
drivers/usb/host/Makefile | 2 +-
drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} | 164 ++++++++++--------------
drivers/usb/host/ohci-exynos.c | 17 +--
include/linux/platform_data/usb-ehci-s5p.h | 21 ---
include/linux/platform_data/usb-ohci-exynos.h | 21 ---
9 files changed, 76 insertions(+), 194 deletions(-)
rename drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} (55%)
delete mode 100644 include/linux/platform_data/usb-ehci-s5p.h
delete mode 100644 include/linux/platform_data/usb-ohci-exynos.h
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH V2 1/5] ARM: SAMSUNG: Remove unused s5p_device_ehci
2013-10-10 7:40 [PATCH V2 0/5] USB: host: Remove non-DT support for Exynos EHCI and OHCI Jingoo Han
@ 2013-10-10 7:40 ` Jingoo Han
2013-10-10 7:41 ` [PATCH V2 2/5] USB: ehci-s5p: Remove non-DT support Jingoo Han
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-10-10 7:40 UTC (permalink / raw)
To: 'Greg Kroah-Hartman'
Cc: linux-usb, linux-samsung-soc, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat',
'Jingoo Han'
Since commit ca91435 "ARM: EXYNOS: Remove unused board files",
s5p_device_ehci is not used anymore. Thus, s5p_device_ehci can
be removed. Also, unnecessary S5P_DEV_USB_EHCI option is removed.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
arch/arm/plat-samsung/Kconfig | 5 -----
arch/arm/plat-samsung/devs.c | 34 -----------------------------
arch/arm/plat-samsung/include/plat/devs.h | 1 -
3 files changed, 40 deletions(-)
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 7dfba93..99bfbb3 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -382,11 +382,6 @@ config S5P_DEV_TV
help
Compile in platform device definition for TV interface
-config S5P_DEV_USB_EHCI
- bool
- help
- Compile in platform device definition for USB EHCI
-
config S3C24XX_PWM
bool "PWM device support"
select PWM
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 8ce0ac0..25f40c9 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -49,7 +49,6 @@
#include <plat/devs.h>
#include <plat/adc.h>
#include <linux/platform_data/ata-samsung_cf.h>
-#include <linux/platform_data/usb-ehci-s5p.h>
#include <plat/fb.h>
#include <plat/fb-s3c2410.h>
#include <plat/hdmi.h>
@@ -1359,39 +1358,6 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
}
#endif /* CONFIG_PLAT_S3C24XX */
-/* USB EHCI Host Controller */
-
-#ifdef CONFIG_S5P_DEV_USB_EHCI
-static struct resource s5p_ehci_resource[] = {
- [0] = DEFINE_RES_MEM(S5P_PA_EHCI, SZ_256),
- [1] = DEFINE_RES_IRQ(IRQ_USB_HOST),
-};
-
-struct platform_device s5p_device_ehci = {
- .name = "s5p-ehci",
- .id = -1,
- .num_resources = ARRAY_SIZE(s5p_ehci_resource),
- .resource = s5p_ehci_resource,
- .dev = {
- .dma_mask = &samsung_device_dma_mask,
- .coherent_dma_mask = DMA_BIT_MASK(32),
- }
-};
-
-void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
-{
- struct s5p_ehci_platdata *npd;
-
- npd = s3c_set_platdata(pd, sizeof(struct s5p_ehci_platdata),
- &s5p_device_ehci);
-
- if (!npd->phy_init)
- npd->phy_init = s5p_usb_phy_init;
- if (!npd->phy_exit)
- npd->phy_exit = s5p_usb_phy_exit;
-}
-#endif /* CONFIG_S5P_DEV_USB_EHCI */
-
/* USB HSOTG */
#ifdef CONFIG_S3C_DEV_USB_HSOTG
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 0dc4ac4..eece188 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -75,7 +75,6 @@ extern struct platform_device s3c_device_usb_hsotg;
extern struct platform_device s3c_device_usb_hsudc;
extern struct platform_device s3c_device_wdt;
-extern struct platform_device s5p_device_ehci;
extern struct platform_device s5p_device_fimc0;
extern struct platform_device s5p_device_fimc1;
extern struct platform_device s5p_device_fimc2;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH V2 2/5] USB: ehci-s5p: Remove non-DT support
2013-10-10 7:40 [PATCH V2 0/5] USB: host: Remove non-DT support for Exynos EHCI and OHCI Jingoo Han
2013-10-10 7:40 ` [PATCH V2 1/5] ARM: SAMSUNG: Remove unused s5p_device_ehci Jingoo Han
@ 2013-10-10 7:41 ` Jingoo Han
[not found] ` <000101cec58b$ee8bd2f0$cba378d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-10-10 7:41 UTC (permalink / raw)
To: 'Greg Kroah-Hartman'
Cc: linux-usb, linux-samsung-soc, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat',
'Jingoo Han'
The non-DT for EXYNOS SoCs is not supported from v3.11.
Thus, there is no need to support non-DT for Exynos EHCI driver.
The 'include/linux/platform_data/usb-ehci-s5p.h' file has been
used for non-DT support. Thus, the 'usb-ehci-s5p.h' file can
be removed.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/usb/host/ehci-s5p.c | 32 ++++------------------------
include/linux/platform_data/usb-ehci-s5p.h | 21 ------------------
2 files changed, 4 insertions(+), 49 deletions(-)
delete mode 100644 include/linux/platform_data/usb-ehci-s5p.h
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 7c3de95..45e1ad3 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -20,7 +20,6 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
-#include <linux/platform_data/usb-ehci-s5p.h>
#include <linux/usb/phy.h>
#include <linux/usb/samsung_usb_phy.h>
#include <linux/usb.h>
@@ -47,11 +46,8 @@ struct s5p_ehci_hcd {
struct clk *clk;
struct usb_phy *phy;
struct usb_otg *otg;
- struct s5p_ehci_platdata *pdata;
};
-static struct s5p_ehci_platdata empty_platdata;
-
#define to_s5p_ehci(hcd) (struct s5p_ehci_hcd *)(hcd_to_ehci(hcd)->priv)
static void s5p_setup_vbus_gpio(struct platform_device *pdev)
@@ -75,7 +71,6 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev)
static int s5p_ehci_probe(struct platform_device *pdev)
{
- struct s5p_ehci_platdata *pdata = dev_get_platdata(&pdev->dev);
struct s5p_ehci_hcd *s5p_ehci;
struct usb_hcd *hcd;
struct ehci_hcd *ehci;
@@ -105,21 +100,14 @@ static int s5p_ehci_probe(struct platform_device *pdev)
s5p_ehci = to_s5p_ehci(hcd);
if (of_device_is_compatible(pdev->dev.of_node,
- "samsung,exynos5440-ehci")) {
- s5p_ehci->pdata = &empty_platdata;
+ "samsung,exynos5440-ehci"))
goto skip_phy;
- }
phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
if (IS_ERR(phy)) {
- /* Fallback to pdata */
- if (!pdata) {
- usb_put_hcd(hcd);
- dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
- return -EPROBE_DEFER;
- } else {
- s5p_ehci->pdata = pdata;
- }
+ usb_put_hcd(hcd);
+ dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
+ return -EPROBE_DEFER;
} else {
s5p_ehci->phy = phy;
s5p_ehci->otg = phy->otg;
@@ -167,8 +155,6 @@ skip_phy:
if (s5p_ehci->phy)
usb_phy_init(s5p_ehci->phy);
- else if (s5p_ehci->pdata->phy_init)
- s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs;
@@ -189,8 +175,6 @@ skip_phy:
fail_add_hcd:
if (s5p_ehci->phy)
usb_phy_shutdown(s5p_ehci->phy);
- else if (s5p_ehci->pdata->phy_exit)
- s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
fail_io:
clk_disable_unprepare(s5p_ehci->clk);
fail_clk:
@@ -210,8 +194,6 @@ static int s5p_ehci_remove(struct platform_device *pdev)
if (s5p_ehci->phy)
usb_phy_shutdown(s5p_ehci->phy);
- else if (s5p_ehci->pdata->phy_exit)
- s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
clk_disable_unprepare(s5p_ehci->clk);
@@ -225,7 +207,6 @@ static int s5p_ehci_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
- struct platform_device *pdev = to_platform_device(dev);
bool do_wakeup = device_may_wakeup(dev);
int rc;
@@ -237,8 +218,6 @@ static int s5p_ehci_suspend(struct device *dev)
if (s5p_ehci->phy)
usb_phy_shutdown(s5p_ehci->phy);
- else if (s5p_ehci->pdata->phy_exit)
- s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
clk_disable_unprepare(s5p_ehci->clk);
@@ -249,7 +228,6 @@ static int s5p_ehci_resume(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
- struct platform_device *pdev = to_platform_device(dev);
clk_prepare_enable(s5p_ehci->clk);
@@ -258,8 +236,6 @@ static int s5p_ehci_resume(struct device *dev)
if (s5p_ehci->phy)
usb_phy_init(s5p_ehci->phy);
- else if (s5p_ehci->pdata->phy_init)
- s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
/* DMA burst Enable */
writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
diff --git a/include/linux/platform_data/usb-ehci-s5p.h b/include/linux/platform_data/usb-ehci-s5p.h
deleted file mode 100644
index 5f28cae..0000000
--- a/include/linux/platform_data/usb-ehci-s5p.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2011 Samsung Electronics Co.Ltd
- * Author: Joonyoung Shim <jy0922.shim@samsung.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#ifndef __PLAT_SAMSUNG_EHCI_H
-#define __PLAT_SAMSUNG_EHCI_H __FILE__
-
-struct s5p_ehci_platdata {
- int (*phy_init)(struct platform_device *pdev, int type);
- int (*phy_exit)(struct platform_device *pdev, int type);
-};
-
-extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd);
-
-#endif /* __PLAT_SAMSUNG_EHCI_H */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH V2 3/5] USB: ohci-exynos: Remove non-DT support
[not found] ` <000101cec58b$ee8bd2f0$cba378d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2013-10-10 7:41 ` Jingoo Han
[not found] ` <000401cec58c$2dff1c30$89fd5490$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Jingoo Han @ 2013-10-10 7:41 UTC (permalink / raw)
To: 'Greg Kroah-Hartman'
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat',
'Jingoo Han'
The non-DT for EXYNOS SoCs is not supported from v3.11.
Thus, there is no need to support non-DT for Exynos OHCI driver.
The 'include/linux/platform_data/usb-ohci-exynos.h' file has been
used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can
be removed.
Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
drivers/usb/host/ohci-exynos.c | 16 ++--------------
include/linux/platform_data/usb-ohci-exynos.h | 21 ---------------------
2 files changed, 2 insertions(+), 35 deletions(-)
delete mode 100644 include/linux/platform_data/usb-ohci-exynos.h
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index f5f372e..5c877bf 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -18,7 +18,6 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
-#include <linux/platform_data/usb-ohci-exynos.h>
#include <linux/usb/phy.h>
#include <linux/usb/samsung_usb_phy.h>
#include <linux/usb.h>
@@ -38,7 +37,6 @@ struct exynos_ohci_hcd {
struct clk *clk;
struct usb_phy *phy;
struct usb_otg *otg;
- struct exynos4_ohci_platdata *pdata;
};
static void exynos_ohci_phy_enable(struct platform_device *pdev)
@@ -48,8 +46,6 @@ static void exynos_ohci_phy_enable(struct platform_device *pdev)
if (exynos_ohci->phy)
usb_phy_init(exynos_ohci->phy);
- else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_init)
- exynos_ohci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
}
static void exynos_ohci_phy_disable(struct platform_device *pdev)
@@ -59,13 +55,10 @@ static void exynos_ohci_phy_disable(struct platform_device *pdev)
if (exynos_ohci->phy)
usb_phy_shutdown(exynos_ohci->phy);
- else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_exit)
- exynos_ohci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
}
static int exynos_ohci_probe(struct platform_device *pdev)
{
- struct exynos4_ohci_platdata *pdata = dev_get_platdata(&pdev->dev);
struct exynos_ohci_hcd *exynos_ohci;
struct usb_hcd *hcd;
struct resource *res;
@@ -98,13 +91,8 @@ static int exynos_ohci_probe(struct platform_device *pdev)
phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
if (IS_ERR(phy)) {
- /* Fallback to pdata */
- if (!pdata) {
- dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
- return -EPROBE_DEFER;
- } else {
- exynos_ohci->pdata = pdata;
- }
+ dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
+ return -EPROBE_DEFER;
} else {
exynos_ohci->phy = phy;
exynos_ohci->otg = phy->otg;
diff --git a/include/linux/platform_data/usb-ohci-exynos.h b/include/linux/platform_data/usb-ohci-exynos.h
deleted file mode 100644
index c256c59..0000000
--- a/include/linux/platform_data/usb-ohci-exynos.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2011 Samsung Electronics Co.Ltd
- * http://www.samsung.com/
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#ifndef __MACH_EXYNOS_OHCI_H
-#define __MACH_EXYNOS_OHCI_H
-
-struct exynos4_ohci_platdata {
- int (*phy_init)(struct platform_device *pdev, int type);
- int (*phy_exit)(struct platform_device *pdev, int type);
-};
-
-extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd);
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH V2 4/5] USB: ohci-exynos: Add missing usb_put_hcd()
2013-10-10 7:40 [PATCH V2 0/5] USB: host: Remove non-DT support for Exynos EHCI and OHCI Jingoo Han
` (2 preceding siblings ...)
[not found] ` <000101cec58b$ee8bd2f0$cba378d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2013-10-10 7:42 ` Jingoo Han
2013-10-11 23:55 ` 'Greg Kroah-Hartman'
2013-10-10 7:42 ` [PATCH V2 5/5] USB: host: Rename ehci-s5p to ehci-exynos Jingoo Han
4 siblings, 1 reply; 9+ messages in thread
From: Jingoo Han @ 2013-10-10 7:42 UTC (permalink / raw)
To: 'Greg Kroah-Hartman'
Cc: linux-usb, linux-samsung-soc, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat',
'Jingoo Han'
When devm_usb_get_phy() fails, usb_put_hcd() should be called
to prevent memory leak.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/usb/host/ohci-exynos.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 5c877bf..aa50e18 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -91,6 +91,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
if (IS_ERR(phy)) {
+ usb_put_hcd(hcd);
dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
return -EPROBE_DEFER;
} else {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH V2 5/5] USB: host: Rename ehci-s5p to ehci-exynos
2013-10-10 7:40 [PATCH V2 0/5] USB: host: Remove non-DT support for Exynos EHCI and OHCI Jingoo Han
` (3 preceding siblings ...)
2013-10-10 7:42 ` [PATCH V2 4/5] USB: ohci-exynos: Add missing usb_put_hcd() Jingoo Han
@ 2013-10-10 7:42 ` Jingoo Han
4 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-10-10 7:42 UTC (permalink / raw)
To: 'Greg Kroah-Hartman'
Cc: linux-usb, linux-samsung-soc, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat',
'Jingoo Han'
Currently, Samsung is using 'EXYNOS' as the name of Samsung SoCs.
Thus, ehci-exynos is preferred than ehci-s5p.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/usb/host/Kconfig | 5 +-
drivers/usb/host/Makefile | 2 +-
drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} | 132 ++++++++++++------------
3 files changed, 69 insertions(+), 70 deletions(-)
rename drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} (62%)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 70cb1a9..80e72fb 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -203,12 +203,11 @@ config USB_EHCI_SH
Enables support for the on-chip EHCI controller on the SuperH.
If you use the PCI EHCI controller, this option is not necessary.
-config USB_EHCI_S5P
+config USB_EHCI_EXYNOS
tristate "EHCI support for Samsung S5P/EXYNOS SoC Series"
depends on PLAT_S5P || ARCH_EXYNOS
help
- Enable support for the Samsung S5Pxxxx and Exynos3/4/5 SOC's
- on-chip EHCI controller.
+ Enable support for the Samsung Exynos SOC's on-chip EHCI controller.
config USB_EHCI_MV
bool "EHCI support for Marvell PXA/MMP USB controller"
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 0b9fdee..9dc11c2 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -34,7 +34,7 @@ obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o
obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o
obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o
-obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
+obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o
obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-exynos.c
similarity index 62%
rename from drivers/usb/host/ehci-s5p.c
rename to drivers/usb/host/ehci-exynos.c
index 45e1ad3..016352e 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -1,5 +1,5 @@
/*
- * SAMSUNG S5P USB HOST EHCI Controller
+ * SAMSUNG EXYNOS USB HOST EHCI Controller
*
* Copyright (C) 2011 Samsung Electronics Co.Ltd
* Author: Jingoo Han <jg1.han@samsung.com>
@@ -28,7 +28,7 @@
#include "ehci.h"
-#define DRIVER_DESC "EHCI s5p driver"
+#define DRIVER_DESC "EHCI EXYNOS driver"
#define EHCI_INSNREG00(base) (base + 0x90)
#define EHCI_INSNREG00_ENA_INCR16 (0x1 << 25)
@@ -39,18 +39,18 @@
(EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
-static const char hcd_name[] = "ehci-s5p";
-static struct hc_driver __read_mostly s5p_ehci_hc_driver;
+static const char hcd_name[] = "ehci-exynos";
+static struct hc_driver __read_mostly exynos_ehci_hc_driver;
-struct s5p_ehci_hcd {
+struct exynos_ehci_hcd {
struct clk *clk;
struct usb_phy *phy;
struct usb_otg *otg;
};
-#define to_s5p_ehci(hcd) (struct s5p_ehci_hcd *)(hcd_to_ehci(hcd)->priv)
+#define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)->priv)
-static void s5p_setup_vbus_gpio(struct platform_device *pdev)
+static void exynos_setup_vbus_gpio(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
int err;
@@ -69,9 +69,9 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev)
dev_err(dev, "can't request ehci vbus gpio %d", gpio);
}
-static int s5p_ehci_probe(struct platform_device *pdev)
+static int exynos_ehci_probe(struct platform_device *pdev)
{
- struct s5p_ehci_hcd *s5p_ehci;
+ struct exynos_ehci_hcd *exynos_ehci;
struct usb_hcd *hcd;
struct ehci_hcd *ehci;
struct resource *res;
@@ -89,15 +89,15 @@ static int s5p_ehci_probe(struct platform_device *pdev)
if (!pdev->dev.coherent_dma_mask)
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- s5p_setup_vbus_gpio(pdev);
+ exynos_setup_vbus_gpio(pdev);
- hcd = usb_create_hcd(&s5p_ehci_hc_driver,
+ hcd = usb_create_hcd(&exynos_ehci_hc_driver,
&pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
dev_err(&pdev->dev, "Unable to create HCD\n");
return -ENOMEM;
}
- s5p_ehci = to_s5p_ehci(hcd);
+ exynos_ehci = to_exynos_ehci(hcd);
if (of_device_is_compatible(pdev->dev.of_node,
"samsung,exynos5440-ehci"))
@@ -109,21 +109,21 @@ static int s5p_ehci_probe(struct platform_device *pdev)
dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
return -EPROBE_DEFER;
} else {
- s5p_ehci->phy = phy;
- s5p_ehci->otg = phy->otg;
+ exynos_ehci->phy = phy;
+ exynos_ehci->otg = phy->otg;
}
skip_phy:
- s5p_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");
+ exynos_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");
- if (IS_ERR(s5p_ehci->clk)) {
+ if (IS_ERR(exynos_ehci->clk)) {
dev_err(&pdev->dev, "Failed to get usbhost clock\n");
- err = PTR_ERR(s5p_ehci->clk);
+ err = PTR_ERR(exynos_ehci->clk);
goto fail_clk;
}
- err = clk_prepare_enable(s5p_ehci->clk);
+ err = clk_prepare_enable(exynos_ehci->clk);
if (err)
goto fail_clk;
@@ -150,11 +150,11 @@ skip_phy:
goto fail_io;
}
- if (s5p_ehci->otg)
- s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
+ if (exynos_ehci->otg)
+ exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
- if (s5p_ehci->phy)
- usb_phy_init(s5p_ehci->phy);
+ if (exynos_ehci->phy)
+ usb_phy_init(exynos_ehci->phy);
ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs;
@@ -173,29 +173,29 @@ skip_phy:
return 0;
fail_add_hcd:
- if (s5p_ehci->phy)
- usb_phy_shutdown(s5p_ehci->phy);
+ if (exynos_ehci->phy)
+ usb_phy_shutdown(exynos_ehci->phy);
fail_io:
- clk_disable_unprepare(s5p_ehci->clk);
+ clk_disable_unprepare(exynos_ehci->clk);
fail_clk:
usb_put_hcd(hcd);
return err;
}
-static int s5p_ehci_remove(struct platform_device *pdev)
+static int exynos_ehci_remove(struct platform_device *pdev)
{
struct usb_hcd *hcd = platform_get_drvdata(pdev);
- struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
+ struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
usb_remove_hcd(hcd);
- if (s5p_ehci->otg)
- s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
+ if (exynos_ehci->otg)
+ exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
- if (s5p_ehci->phy)
- usb_phy_shutdown(s5p_ehci->phy);
+ if (exynos_ehci->phy)
+ usb_phy_shutdown(exynos_ehci->phy);
- clk_disable_unprepare(s5p_ehci->clk);
+ clk_disable_unprepare(exynos_ehci->clk);
usb_put_hcd(hcd);
@@ -203,39 +203,39 @@ static int s5p_ehci_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM
-static int s5p_ehci_suspend(struct device *dev)
+static int exynos_ehci_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
- struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
+ struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
bool do_wakeup = device_may_wakeup(dev);
int rc;
rc = ehci_suspend(hcd, do_wakeup);
- if (s5p_ehci->otg)
- s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
+ if (exynos_ehci->otg)
+ exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
- if (s5p_ehci->phy)
- usb_phy_shutdown(s5p_ehci->phy);
+ if (exynos_ehci->phy)
+ usb_phy_shutdown(exynos_ehci->phy);
- clk_disable_unprepare(s5p_ehci->clk);
+ clk_disable_unprepare(exynos_ehci->clk);
return rc;
}
-static int s5p_ehci_resume(struct device *dev)
+static int exynos_ehci_resume(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
- struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
+ struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
- clk_prepare_enable(s5p_ehci->clk);
+ clk_prepare_enable(exynos_ehci->clk);
- if (s5p_ehci->otg)
- s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
+ if (exynos_ehci->otg)
+ exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
- if (s5p_ehci->phy)
- usb_phy_init(s5p_ehci->phy);
+ if (exynos_ehci->phy)
+ usb_phy_init(exynos_ehci->phy);
/* DMA burst Enable */
writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
@@ -244,13 +244,13 @@ static int s5p_ehci_resume(struct device *dev)
return 0;
}
#else
-#define s5p_ehci_suspend NULL
-#define s5p_ehci_resume NULL
+#define exynos_ehci_suspend NULL
+#define exynos_ehci_resume NULL
#endif
-static const struct dev_pm_ops s5p_ehci_pm_ops = {
- .suspend = s5p_ehci_suspend,
- .resume = s5p_ehci_resume,
+static const struct dev_pm_ops exynos_ehci_pm_ops = {
+ .suspend = exynos_ehci_suspend,
+ .resume = exynos_ehci_resume,
};
#ifdef CONFIG_OF
@@ -262,40 +262,40 @@ static const struct of_device_id exynos_ehci_match[] = {
MODULE_DEVICE_TABLE(of, exynos_ehci_match);
#endif
-static struct platform_driver s5p_ehci_driver = {
- .probe = s5p_ehci_probe,
- .remove = s5p_ehci_remove,
+static struct platform_driver exynos_ehci_driver = {
+ .probe = exynos_ehci_probe,
+ .remove = exynos_ehci_remove,
.shutdown = usb_hcd_platform_shutdown,
.driver = {
- .name = "s5p-ehci",
+ .name = "exynos-ehci",
.owner = THIS_MODULE,
- .pm = &s5p_ehci_pm_ops,
+ .pm = &exynos_ehci_pm_ops,
.of_match_table = of_match_ptr(exynos_ehci_match),
}
};
-static const struct ehci_driver_overrides s5p_overrides __initdata = {
- .extra_priv_size = sizeof(struct s5p_ehci_hcd),
+static const struct ehci_driver_overrides exynos_overrides __initdata = {
+ .extra_priv_size = sizeof(struct exynos_ehci_hcd),
};
-static int __init ehci_s5p_init(void)
+static int __init ehci_exynos_init(void)
{
if (usb_disabled())
return -ENODEV;
pr_info("%s: " DRIVER_DESC "\n", hcd_name);
- ehci_init_driver(&s5p_ehci_hc_driver, &s5p_overrides);
- return platform_driver_register(&s5p_ehci_driver);
+ ehci_init_driver(&exynos_ehci_hc_driver, &exynos_overrides);
+ return platform_driver_register(&exynos_ehci_driver);
}
-module_init(ehci_s5p_init);
+module_init(ehci_exynos_init);
-static void __exit ehci_s5p_cleanup(void)
+static void __exit ehci_exynos_cleanup(void)
{
- platform_driver_unregister(&s5p_ehci_driver);
+ platform_driver_unregister(&exynos_ehci_driver);
}
-module_exit(ehci_s5p_cleanup);
+module_exit(ehci_exynos_cleanup);
MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_ALIAS("platform:s5p-ehci");
+MODULE_ALIAS("platform:exynos-ehci");
MODULE_AUTHOR("Jingoo Han");
MODULE_AUTHOR("Joonyoung Shim");
MODULE_LICENSE("GPL v2");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH V2 3/5] USB: ohci-exynos: Remove non-DT support
[not found] ` <000401cec58c$2dff1c30$89fd5490$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2013-10-11 23:55 ` 'Greg Kroah-Hartman'
2013-10-14 0:18 ` [PATCH V3] " Jingoo Han
0 siblings, 1 reply; 9+ messages in thread
From: 'Greg Kroah-Hartman' @ 2013-10-11 23:55 UTC (permalink / raw)
To: Jingoo Han
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat'
On Thu, Oct 10, 2013 at 04:41:49PM +0900, Jingoo Han wrote:
> The non-DT for EXYNOS SoCs is not supported from v3.11.
> Thus, there is no need to support non-DT for Exynos OHCI driver.
>
> The 'include/linux/platform_data/usb-ohci-exynos.h' file has been
> used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can
> be removed.
>
> Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
This patch fails to apply to my tree for some reason:
checking file drivers/usb/host/ohci-exynos.c
Hunk #5 FAILED at 91.
1 out of 5 hunks FAILED
checking file include/linux/platform_data/usb-ohci-exynos.h
Can you redo it against my usb-next usb.git tree and resend it?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2 4/5] USB: ohci-exynos: Add missing usb_put_hcd()
2013-10-10 7:42 ` [PATCH V2 4/5] USB: ohci-exynos: Add missing usb_put_hcd() Jingoo Han
@ 2013-10-11 23:55 ` 'Greg Kroah-Hartman'
0 siblings, 0 replies; 9+ messages in thread
From: 'Greg Kroah-Hartman' @ 2013-10-11 23:55 UTC (permalink / raw)
To: Jingoo Han
Cc: linux-usb, linux-samsung-soc, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat'
On Thu, Oct 10, 2013 at 04:42:22PM +0900, Jingoo Han wrote:
> When devm_usb_get_phy() fails, usb_put_hcd() should be called
> to prevent memory leak.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Already applied this one, thanks.
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH V3] USB: ohci-exynos: Remove non-DT support
2013-10-11 23:55 ` 'Greg Kroah-Hartman'
@ 2013-10-14 0:18 ` Jingoo Han
0 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-10-14 0:18 UTC (permalink / raw)
To: 'Greg Kroah-Hartman'
Cc: linux-usb, linux-samsung-soc, 'Kukjin Kim',
'Alan Stern', 'Sylwester Nawrocki',
'Tomasz Figa', 'Sachin Kamat',
'Jingoo Han'
The non-DT for EXYNOS SoCs is not supported from v3.11.
Thus, there is no need to support non-DT for Exynos OHCI driver.
The 'include/linux/platform_data/usb-ohci-exynos.h' file has been
used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can
be removed.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
- re-based against the latest 'usb-next' branch.
drivers/usb/host/ohci-exynos.c | 18 +++---------------
include/linux/platform_data/usb-ohci-exynos.h | 21 ---------------------
2 files changed, 3 insertions(+), 36 deletions(-)
delete mode 100644 include/linux/platform_data/usb-ohci-exynos.h
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 122e52e..aa50e18 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -18,7 +18,6 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
-#include <linux/platform_data/usb-ohci-exynos.h>
#include <linux/usb/phy.h>
#include <linux/usb/samsung_usb_phy.h>
#include <linux/usb.h>
@@ -38,7 +37,6 @@ struct exynos_ohci_hcd {
struct clk *clk;
struct usb_phy *phy;
struct usb_otg *otg;
- struct exynos4_ohci_platdata *pdata;
};
static void exynos_ohci_phy_enable(struct platform_device *pdev)
@@ -48,8 +46,6 @@ static void exynos_ohci_phy_enable(struct platform_device *pdev)
if (exynos_ohci->phy)
usb_phy_init(exynos_ohci->phy);
- else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_init)
- exynos_ohci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
}
static void exynos_ohci_phy_disable(struct platform_device *pdev)
@@ -59,13 +55,10 @@ static void exynos_ohci_phy_disable(struct platform_device *pdev)
if (exynos_ohci->phy)
usb_phy_shutdown(exynos_ohci->phy);
- else if (exynos_ohci->pdata && exynos_ohci->pdata->phy_exit)
- exynos_ohci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
}
static int exynos_ohci_probe(struct platform_device *pdev)
{
- struct exynos4_ohci_platdata *pdata = dev_get_platdata(&pdev->dev);
struct exynos_ohci_hcd *exynos_ohci;
struct usb_hcd *hcd;
struct resource *res;
@@ -98,14 +91,9 @@ static int exynos_ohci_probe(struct platform_device *pdev)
phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
if (IS_ERR(phy)) {
- /* Fallback to pdata */
- if (!pdata) {
- usb_put_hcd(hcd);
- dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
- return -EPROBE_DEFER;
- } else {
- exynos_ohci->pdata = pdata;
- }
+ usb_put_hcd(hcd);
+ dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
+ return -EPROBE_DEFER;
} else {
exynos_ohci->phy = phy;
exynos_ohci->otg = phy->otg;
diff --git a/include/linux/platform_data/usb-ohci-exynos.h b/include/linux/platform_data/usb-ohci-exynos.h
deleted file mode 100644
index c256c59..0000000
--- a/include/linux/platform_data/usb-ohci-exynos.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2011 Samsung Electronics Co.Ltd
- * http://www.samsung.com/
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#ifndef __MACH_EXYNOS_OHCI_H
-#define __MACH_EXYNOS_OHCI_H
-
-struct exynos4_ohci_platdata {
- int (*phy_init)(struct platform_device *pdev, int type);
- int (*phy_exit)(struct platform_device *pdev, int type);
-};
-
-extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd);
-
-#endif /* __MACH_EXYNOS_OHCI_H */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-10-14 0:18 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 7:40 [PATCH V2 0/5] USB: host: Remove non-DT support for Exynos EHCI and OHCI Jingoo Han
2013-10-10 7:40 ` [PATCH V2 1/5] ARM: SAMSUNG: Remove unused s5p_device_ehci Jingoo Han
2013-10-10 7:41 ` [PATCH V2 2/5] USB: ehci-s5p: Remove non-DT support Jingoo Han
[not found] ` <000101cec58b$ee8bd2f0$cba378d0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-10-10 7:41 ` [PATCH V2 3/5] USB: ohci-exynos: " Jingoo Han
[not found] ` <000401cec58c$2dff1c30$89fd5490$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-10-11 23:55 ` 'Greg Kroah-Hartman'
2013-10-14 0:18 ` [PATCH V3] " Jingoo Han
2013-10-10 7:42 ` [PATCH V2 4/5] USB: ohci-exynos: Add missing usb_put_hcd() Jingoo Han
2013-10-11 23:55 ` 'Greg Kroah-Hartman'
2013-10-10 7:42 ` [PATCH V2 5/5] USB: host: Rename ehci-s5p to ehci-exynos Jingoo Han
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.