aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-10-10 03:42:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-11 19:56:00 -0400
commit29824c167bead38986d5e8d33008680c62478777 (patch)
treed4b9d00706dd3892528f6a4e718d432afa158693
parent57ae1605c0f511bca212787d28d79a3f82c0a7f9 (diff)
USB: host: Rename ehci-s5p to ehci-exynos
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/Kconfig5
-rw-r--r--drivers/usb/host/Makefile2
-rw-r--r--drivers/usb/host/ehci-exynos.c (renamed from drivers/usb/host/ehci-s5p.c)132
3 files changed, 69 insertions, 70 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 70cb1a94beff..80e72fba01f4 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -203,12 +203,11 @@ config USB_EHCI_SH
203 Enables support for the on-chip EHCI controller on the SuperH. 203 Enables support for the on-chip EHCI controller on the SuperH.
204 If you use the PCI EHCI controller, this option is not necessary. 204 If you use the PCI EHCI controller, this option is not necessary.
205 205
206config USB_EHCI_S5P 206config USB_EHCI_EXYNOS
207 tristate "EHCI support for Samsung S5P/EXYNOS SoC Series" 207 tristate "EHCI support for Samsung S5P/EXYNOS SoC Series"
208 depends on PLAT_S5P || ARCH_EXYNOS 208 depends on PLAT_S5P || ARCH_EXYNOS
209 help 209 help
210 Enable support for the Samsung S5Pxxxx and Exynos3/4/5 SOC's 210 Enable support for the Samsung Exynos SOC's on-chip EHCI controller.
211 on-chip EHCI controller.
212 211
213config USB_EHCI_MV 212config USB_EHCI_MV
214 bool "EHCI support for Marvell PXA/MMP USB controller" 213 bool "EHCI support for Marvell PXA/MMP USB controller"
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 0b9fdeecf683..9dc11c2ee454 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -34,7 +34,7 @@ obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
34obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o 34obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o
35obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o 35obj-$(CONFIG_USB_EHCI_HCD_ORION) += ehci-orion.o
36obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o 36obj-$(CONFIG_USB_EHCI_HCD_SPEAR) += ehci-spear.o
37obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o 37obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
38obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o 38obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
39obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o 39obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o
40obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o 40obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-exynos.c
index 45e1ad3f56b2..016352e0f5a7 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * SAMSUNG S5P USB HOST EHCI Controller 2 * SAMSUNG EXYNOS USB HOST EHCI Controller
3 * 3 *
4 * Copyright (C) 2011 Samsung Electronics Co.Ltd 4 * Copyright (C) 2011 Samsung Electronics Co.Ltd
5 * Author: Jingoo Han <jg1.han@samsung.com> 5 * Author: Jingoo Han <jg1.han@samsung.com>
@@ -28,7 +28,7 @@
28 28
29#include "ehci.h" 29#include "ehci.h"
30 30
31#define DRIVER_DESC "EHCI s5p driver" 31#define DRIVER_DESC "EHCI EXYNOS driver"
32 32
33#define EHCI_INSNREG00(base) (base + 0x90) 33#define EHCI_INSNREG00(base) (base + 0x90)
34#define EHCI_INSNREG00_ENA_INCR16 (0x1 << 25) 34#define EHCI_INSNREG00_ENA_INCR16 (0x1 << 25)
@@ -39,18 +39,18 @@
39 (EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \ 39 (EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
40 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN) 40 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
41 41
42static const char hcd_name[] = "ehci-s5p"; 42static const char hcd_name[] = "ehci-exynos";
43static struct hc_driver __read_mostly s5p_ehci_hc_driver; 43static struct hc_driver __read_mostly exynos_ehci_hc_driver;
44 44
45struct s5p_ehci_hcd { 45struct exynos_ehci_hcd {
46 struct clk *clk; 46 struct clk *clk;
47 struct usb_phy *phy; 47 struct usb_phy *phy;
48 struct usb_otg *otg; 48 struct usb_otg *otg;
49}; 49};
50 50
51#define to_s5p_ehci(hcd) (struct s5p_ehci_hcd *)(hcd_to_ehci(hcd)->priv) 51#define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)->priv)
52 52
53static void s5p_setup_vbus_gpio(struct platform_device *pdev) 53static void exynos_setup_vbus_gpio(struct platform_device *pdev)
54{ 54{
55 struct device *dev = &pdev->dev; 55 struct device *dev = &pdev->dev;
56 int err; 56 int err;
@@ -69,9 +69,9 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev)
69 dev_err(dev, "can't request ehci vbus gpio %d", gpio); 69 dev_err(dev, "can't request ehci vbus gpio %d", gpio);
70} 70}
71 71
72static int s5p_ehci_probe(struct platform_device *pdev) 72static int exynos_ehci_probe(struct platform_device *pdev)
73{ 73{
74 struct s5p_ehci_hcd *s5p_ehci; 74 struct exynos_ehci_hcd *exynos_ehci;
75 struct usb_hcd *hcd; 75 struct usb_hcd *hcd;
76 struct ehci_hcd *ehci; 76 struct ehci_hcd *ehci;
77 struct resource *res; 77 struct resource *res;
@@ -89,15 +89,15 @@ static int s5p_ehci_probe(struct platform_device *pdev)
89 if (!pdev->dev.coherent_dma_mask) 89 if (!pdev->dev.coherent_dma_mask)
90 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 90 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
91 91
92 s5p_setup_vbus_gpio(pdev); 92 exynos_setup_vbus_gpio(pdev);
93 93
94 hcd = usb_create_hcd(&s5p_ehci_hc_driver, 94 hcd = usb_create_hcd(&exynos_ehci_hc_driver,
95 &pdev->dev, dev_name(&pdev->dev)); 95 &pdev->dev, dev_name(&pdev->dev));
96 if (!hcd) { 96 if (!hcd) {
97 dev_err(&pdev->dev, "Unable to create HCD\n"); 97 dev_err(&pdev->dev, "Unable to create HCD\n");
98 return -ENOMEM; 98 return -ENOMEM;
99 } 99 }
100 s5p_ehci = to_s5p_ehci(hcd); 100 exynos_ehci = to_exynos_ehci(hcd);
101 101
102 if (of_device_is_compatible(pdev->dev.of_node, 102 if (of_device_is_compatible(pdev->dev.of_node,
103 "samsung,exynos5440-ehci")) 103 "samsung,exynos5440-ehci"))
@@ -109,21 +109,21 @@ static int s5p_ehci_probe(struct platform_device *pdev)
109 dev_warn(&pdev->dev, "no platform data or transceiver defined\n"); 109 dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
110 return -EPROBE_DEFER; 110 return -EPROBE_DEFER;
111 } else { 111 } else {
112 s5p_ehci->phy = phy; 112 exynos_ehci->phy = phy;
113 s5p_ehci->otg = phy->otg; 113 exynos_ehci->otg = phy->otg;
114 } 114 }
115 115
116skip_phy: 116skip_phy:
117 117
118 s5p_ehci->clk = devm_clk_get(&pdev->dev, "usbhost"); 118 exynos_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");
119 119
120 if (IS_ERR(s5p_ehci->clk)) { 120 if (IS_ERR(exynos_ehci->clk)) {
121 dev_err(&pdev->dev, "Failed to get usbhost clock\n"); 121 dev_err(&pdev->dev, "Failed to get usbhost clock\n");
122 err = PTR_ERR(s5p_ehci->clk); 122 err = PTR_ERR(exynos_ehci->clk);
123 goto fail_clk; 123 goto fail_clk;
124 } 124 }
125 125
126 err = clk_prepare_enable(s5p_ehci->clk); 126 err = clk_prepare_enable(exynos_ehci->clk);
127 if (err) 127 if (err)
128 goto fail_clk; 128 goto fail_clk;
129 129
@@ -150,11 +150,11 @@ skip_phy:
150 goto fail_io; 150 goto fail_io;
151 } 151 }
152 152
153 if (s5p_ehci->otg) 153 if (exynos_ehci->otg)
154 s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self); 154 exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
155 155
156 if (s5p_ehci->phy) 156 if (exynos_ehci->phy)
157 usb_phy_init(s5p_ehci->phy); 157 usb_phy_init(exynos_ehci->phy);
158 158
159 ehci = hcd_to_ehci(hcd); 159 ehci = hcd_to_ehci(hcd);
160 ehci->caps = hcd->regs; 160 ehci->caps = hcd->regs;
@@ -173,29 +173,29 @@ skip_phy:
173 return 0; 173 return 0;
174 174
175fail_add_hcd: 175fail_add_hcd:
176 if (s5p_ehci->phy) 176 if (exynos_ehci->phy)
177 usb_phy_shutdown(s5p_ehci->phy); 177 usb_phy_shutdown(exynos_ehci->phy);
178fail_io: 178fail_io:
179 clk_disable_unprepare(s5p_ehci->clk); 179 clk_disable_unprepare(exynos_ehci->clk);
180fail_clk: 180fail_clk:
181 usb_put_hcd(hcd); 181 usb_put_hcd(hcd);
182 return err; 182 return err;
183} 183}
184 184
185static int s5p_ehci_remove(struct platform_device *pdev) 185static int exynos_ehci_remove(struct platform_device *pdev)
186{ 186{
187 struct usb_hcd *hcd = platform_get_drvdata(pdev); 187 struct usb_hcd *hcd = platform_get_drvdata(pdev);
188 struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd); 188 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
189 189
190 usb_remove_hcd(hcd); 190 usb_remove_hcd(hcd);
191 191
192 if (s5p_ehci->otg) 192 if (exynos_ehci->otg)
193 s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self); 193 exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
194 194
195 if (s5p_ehci->phy) 195 if (exynos_ehci->phy)
196 usb_phy_shutdown(s5p_ehci->phy); 196 usb_phy_shutdown(exynos_ehci->phy);
197 197
198 clk_disable_unprepare(s5p_ehci->clk); 198 clk_disable_unprepare(exynos_ehci->clk);
199 199
200 usb_put_hcd(hcd); 200 usb_put_hcd(hcd);
201 201
@@ -203,39 +203,39 @@ static int s5p_ehci_remove(struct platform_device *pdev)
203} 203}
204 204
205#ifdef CONFIG_PM 205#ifdef CONFIG_PM
206static int s5p_ehci_suspend(struct device *dev) 206static int exynos_ehci_suspend(struct device *dev)
207{ 207{
208 struct usb_hcd *hcd = dev_get_drvdata(dev); 208 struct usb_hcd *hcd = dev_get_drvdata(dev);
209 struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd); 209 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
210 210
211 bool do_wakeup = device_may_wakeup(dev); 211 bool do_wakeup = device_may_wakeup(dev);
212 int rc; 212 int rc;
213 213
214 rc = ehci_suspend(hcd, do_wakeup); 214 rc = ehci_suspend(hcd, do_wakeup);
215 215
216 if (s5p_ehci->otg) 216 if (exynos_ehci->otg)
217 s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self); 217 exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
218 218
219 if (s5p_ehci->phy) 219 if (exynos_ehci->phy)
220 usb_phy_shutdown(s5p_ehci->phy); 220 usb_phy_shutdown(exynos_ehci->phy);
221 221
222 clk_disable_unprepare(s5p_ehci->clk); 222 clk_disable_unprepare(exynos_ehci->clk);
223 223
224 return rc; 224 return rc;
225} 225}
226 226
227static int s5p_ehci_resume(struct device *dev) 227static int exynos_ehci_resume(struct device *dev)
228{ 228{
229 struct usb_hcd *hcd = dev_get_drvdata(dev); 229 struct usb_hcd *hcd = dev_get_drvdata(dev);
230 struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd); 230 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
231 231
232 clk_prepare_enable(s5p_ehci->clk); 232 clk_prepare_enable(exynos_ehci->clk);
233 233
234 if (s5p_ehci->otg) 234 if (exynos_ehci->otg)
235 s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self); 235 exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self);
236 236
237 if (s5p_ehci->phy) 237 if (exynos_ehci->phy)
238 usb_phy_init(s5p_ehci->phy); 238 usb_phy_init(exynos_ehci->phy);
239 239
240 /* DMA burst Enable */ 240 /* DMA burst Enable */
241 writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs)); 241 writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
@@ -244,13 +244,13 @@ static int s5p_ehci_resume(struct device *dev)
244 return 0; 244 return 0;
245} 245}
246#else 246#else
247#define s5p_ehci_suspend NULL 247#define exynos_ehci_suspend NULL
248#define s5p_ehci_resume NULL 248#define exynos_ehci_resume NULL
249#endif 249#endif
250 250
251static const struct dev_pm_ops s5p_ehci_pm_ops = { 251static const struct dev_pm_ops exynos_ehci_pm_ops = {
252 .suspend = s5p_ehci_suspend, 252 .suspend = exynos_ehci_suspend,
253 .resume = s5p_ehci_resume, 253 .resume = exynos_ehci_resume,
254}; 254};
255 255
256#ifdef CONFIG_OF 256#ifdef CONFIG_OF
@@ -262,40 +262,40 @@ static const struct of_device_id exynos_ehci_match[] = {
262MODULE_DEVICE_TABLE(of, exynos_ehci_match); 262MODULE_DEVICE_TABLE(of, exynos_ehci_match);
263#endif 263#endif
264 264
265static struct platform_driver s5p_ehci_driver = { 265static struct platform_driver exynos_ehci_driver = {
266 .probe = s5p_ehci_probe, 266 .probe = exynos_ehci_probe,
267 .remove = s5p_ehci_remove, 267 .remove = exynos_ehci_remove,
268 .shutdown = usb_hcd_platform_shutdown, 268 .shutdown = usb_hcd_platform_shutdown,
269 .driver = { 269 .driver = {
270 .name = "s5p-ehci", 270 .name = "exynos-ehci",
271 .owner = THIS_MODULE, 271 .owner = THIS_MODULE,
272 .pm = &s5p_ehci_pm_ops, 272 .pm = &exynos_ehci_pm_ops,
273 .of_match_table = of_match_ptr(exynos_ehci_match), 273 .of_match_table = of_match_ptr(exynos_ehci_match),
274 } 274 }
275}; 275};
276static const struct ehci_driver_overrides s5p_overrides __initdata = { 276static const struct ehci_driver_overrides exynos_overrides __initdata = {
277 .extra_priv_size = sizeof(struct s5p_ehci_hcd), 277 .extra_priv_size = sizeof(struct exynos_ehci_hcd),
278}; 278};
279 279
280static int __init ehci_s5p_init(void) 280static int __init ehci_exynos_init(void)
281{ 281{
282 if (usb_disabled()) 282 if (usb_disabled())
283 return -ENODEV; 283 return -ENODEV;
284 284
285 pr_info("%s: " DRIVER_DESC "\n", hcd_name); 285 pr_info("%s: " DRIVER_DESC "\n", hcd_name);
286 ehci_init_driver(&s5p_ehci_hc_driver, &s5p_overrides); 286 ehci_init_driver(&exynos_ehci_hc_driver, &exynos_overrides);
287 return platform_driver_register(&s5p_ehci_driver); 287 return platform_driver_register(&exynos_ehci_driver);
288} 288}
289module_init(ehci_s5p_init); 289module_init(ehci_exynos_init);
290 290
291static void __exit ehci_s5p_cleanup(void) 291static void __exit ehci_exynos_cleanup(void)
292{ 292{
293 platform_driver_unregister(&s5p_ehci_driver); 293 platform_driver_unregister(&exynos_ehci_driver);
294} 294}
295module_exit(ehci_s5p_cleanup); 295module_exit(ehci_exynos_cleanup);
296 296
297MODULE_DESCRIPTION(DRIVER_DESC); 297MODULE_DESCRIPTION(DRIVER_DESC);
298MODULE_ALIAS("platform:s5p-ehci"); 298MODULE_ALIAS("platform:exynos-ehci");
299MODULE_AUTHOR("Jingoo Han"); 299MODULE_AUTHOR("Jingoo Han");
300MODULE_AUTHOR("Joonyoung Shim"); 300MODULE_AUTHOR("Joonyoung Shim");
301MODULE_LICENSE("GPL v2"); 301MODULE_LICENSE("GPL v2");