blob: 1a9b7572e17fe681056f054ac764a98ba31919eb [file] [log] [blame]
Greg Kroah-Hartman5fd54ac2017-11-03 11:28:30 +01001// SPDX-License-Identifier: GPL-2.0+
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +09002/*
Krzysztof Kozlowskidea7b202020-01-04 16:20:55 +01003 * Samsung Exynos USB HOST EHCI Controller
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +09004 *
5 * Copyright (C) 2011 Samsung Electronics Co.Ltd
6 * Author: Jingoo Han <jg1.han@samsung.com>
7 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +09008 */
9
10#include <linux/clk.h>
Manjunath Goudar7edb3da2013-04-02 18:24:01 +020011#include <linux/dma-mapping.h>
12#include <linux/io.h>
13#include <linux/kernel.h>
14#include <linux/module.h>
Vivek Gautam2c026e22012-07-16 11:25:37 +053015#include <linux/of.h>
Vivek Gautamfd81d592012-07-17 10:10:50 +053016#include <linux/of_gpio.h>
Kamil Debski1c176752014-05-05 10:32:28 +053017#include <linux/phy/phy.h>
Manjunath Goudar7edb3da2013-04-02 18:24:01 +020018#include <linux/platform_device.h>
Manjunath Goudar7edb3da2013-04-02 18:24:01 +020019#include <linux/usb.h>
20#include <linux/usb/hcd.h>
Manjunath Goudar7edb3da2013-04-02 18:24:01 +020021
22#include "ehci.h"
23
Krzysztof Kozlowskidea7b202020-01-04 16:20:55 +010024#define DRIVER_DESC "EHCI Exynos driver"
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +090025
Jingoo Han88555a62012-03-05 10:40:14 +090026#define EHCI_INSNREG00(base) (base + 0x90)
27#define EHCI_INSNREG00_ENA_INCR16 (0x1 << 25)
28#define EHCI_INSNREG00_ENA_INCR8 (0x1 << 24)
29#define EHCI_INSNREG00_ENA_INCR4 (0x1 << 23)
30#define EHCI_INSNREG00_ENA_INCRX_ALIGN (0x1 << 22)
31#define EHCI_INSNREG00_ENABLE_DMA_BURST \
32 (EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
33 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
34
Jingoo Han29824c162013-10-10 16:42:47 +090035static const char hcd_name[] = "ehci-exynos";
36static struct hc_driver __read_mostly exynos_ehci_hc_driver;
Manjunath Goudar7edb3da2013-04-02 18:24:01 +020037
Kamil Debski1c176752014-05-05 10:32:28 +053038#define PHY_NUMBER 3
39
Jingoo Han29824c162013-10-10 16:42:47 +090040struct exynos_ehci_hcd {
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +090041 struct clk *clk;
Marek Szyprowski01d40712019-05-20 11:08:23 +020042 struct device_node *of_node;
Vivek Gautam46c1cda2014-09-29 11:54:14 +053043 struct phy *phy[PHY_NUMBER];
Marek Szyprowski214b6062019-07-26 10:14:52 +020044 bool legacy_phy;
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +090045};
46
Jingoo Han29824c162013-10-10 16:42:47 +090047#define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)->priv)
Vivek Gautamd233c192013-01-22 18:30:42 +053048
Kamil Debski1c176752014-05-05 10:32:28 +053049static int exynos_ehci_get_phy(struct device *dev,
50 struct exynos_ehci_hcd *exynos_ehci)
51{
52 struct device_node *child;
53 struct phy *phy;
Marek Szyprowski214b6062019-07-26 10:14:52 +020054 int phy_number, num_phys;
Vivek Gautam46c1cda2014-09-29 11:54:14 +053055 int ret;
Kamil Debski1c176752014-05-05 10:32:28 +053056
Vivek Gautam46c1cda2014-09-29 11:54:14 +053057 /* Get PHYs for the controller */
Marek Szyprowski214b6062019-07-26 10:14:52 +020058 num_phys = of_count_phandle_with_args(dev->of_node, "phys",
59 "#phy-cells");
60 for (phy_number = 0; phy_number < num_phys; phy_number++) {
61 phy = devm_of_phy_get_by_index(dev, dev->of_node, phy_number);
62 if (IS_ERR(phy))
63 return PTR_ERR(phy);
64 exynos_ehci->phy[phy_number] = phy;
65 }
66 if (num_phys > 0)
67 return 0;
68
69 /* Get PHYs using legacy bindings */
Kamil Debski1c176752014-05-05 10:32:28 +053070 for_each_available_child_of_node(dev->of_node, child) {
71 ret = of_property_read_u32(child, "reg", &phy_number);
72 if (ret) {
73 dev_err(dev, "Failed to parse device tree\n");
74 of_node_put(child);
75 return ret;
76 }
77
78 if (phy_number >= PHY_NUMBER) {
79 dev_err(dev, "Invalid number of PHYs\n");
80 of_node_put(child);
81 return -EINVAL;
82 }
83
Sachin Kamat14ad5a92014-06-06 14:13:45 +053084 phy = devm_of_phy_get(dev, child, NULL);
Vivek Gautam46c1cda2014-09-29 11:54:14 +053085 exynos_ehci->phy[phy_number] = phy;
Vivek Gautam46c1cda2014-09-29 11:54:14 +053086 if (IS_ERR(phy)) {
87 ret = PTR_ERR(phy);
88 if (ret == -EPROBE_DEFER) {
Krzysztof Kozlowski3f6026b2017-01-07 10:41:40 +020089 of_node_put(child);
Vivek Gautam46c1cda2014-09-29 11:54:14 +053090 return ret;
91 } else if (ret != -ENOSYS && ret != -ENODEV) {
92 dev_err(dev,
93 "Error retrieving usb2 phy: %d\n", ret);
Krzysztof Kozlowski3f6026b2017-01-07 10:41:40 +020094 of_node_put(child);
Vivek Gautam46c1cda2014-09-29 11:54:14 +053095 return ret;
96 }
97 }
Vivek Gautam2f7f41c2014-08-05 16:09:08 +053098 }
99
Marek Szyprowski214b6062019-07-26 10:14:52 +0200100 exynos_ehci->legacy_phy = true;
Vivek Gautam2f7f41c2014-08-05 16:09:08 +0530101 return 0;
Kamil Debski1c176752014-05-05 10:32:28 +0530102}
103
104static int exynos_ehci_phy_enable(struct device *dev)
105{
106 struct usb_hcd *hcd = dev_get_drvdata(dev);
107 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
108 int i;
109 int ret = 0;
110
Kamil Debski1c176752014-05-05 10:32:28 +0530111 for (i = 0; ret == 0 && i < PHY_NUMBER; i++)
Vivek Gautam46c1cda2014-09-29 11:54:14 +0530112 if (!IS_ERR(exynos_ehci->phy[i]))
113 ret = phy_power_on(exynos_ehci->phy[i]);
Kamil Debski1c176752014-05-05 10:32:28 +0530114 if (ret)
115 for (i--; i >= 0; i--)
Vivek Gautam46c1cda2014-09-29 11:54:14 +0530116 if (!IS_ERR(exynos_ehci->phy[i]))
117 phy_power_off(exynos_ehci->phy[i]);
Kamil Debski1c176752014-05-05 10:32:28 +0530118
119 return ret;
120}
121
122static void exynos_ehci_phy_disable(struct device *dev)
123{
124 struct usb_hcd *hcd = dev_get_drvdata(dev);
125 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
126 int i;
127
Kamil Debski1c176752014-05-05 10:32:28 +0530128 for (i = 0; i < PHY_NUMBER; i++)
Vivek Gautam46c1cda2014-09-29 11:54:14 +0530129 if (!IS_ERR(exynos_ehci->phy[i]))
130 phy_power_off(exynos_ehci->phy[i]);
Kamil Debski1c176752014-05-05 10:32:28 +0530131}
132
Vivek Gautam91a96772014-05-05 10:34:25 +0530133static void exynos_setup_vbus_gpio(struct device *dev)
Vivek Gautamfd81d592012-07-17 10:10:50 +0530134{
135 int err;
136 int gpio;
137
Doug Anderson3f3b55b2013-03-14 20:15:37 -0700138 if (!dev->of_node)
Vivek Gautamfd81d592012-07-17 10:10:50 +0530139 return;
140
Doug Anderson3f3b55b2013-03-14 20:15:37 -0700141 gpio = of_get_named_gpio(dev->of_node, "samsung,vbus-gpio", 0);
Vivek Gautamfd81d592012-07-17 10:10:50 +0530142 if (!gpio_is_valid(gpio))
143 return;
144
Doug Anderson3f3b55b2013-03-14 20:15:37 -0700145 err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH,
146 "ehci_vbus_gpio");
Vivek Gautamfd81d592012-07-17 10:10:50 +0530147 if (err)
Doug Anderson3f3b55b2013-03-14 20:15:37 -0700148 dev_err(dev, "can't request ehci vbus gpio %d", gpio);
Vivek Gautamfd81d592012-07-17 10:10:50 +0530149}
150
Jingoo Han29824c162013-10-10 16:42:47 +0900151static int exynos_ehci_probe(struct platform_device *pdev)
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900152{
Jingoo Han29824c162013-10-10 16:42:47 +0900153 struct exynos_ehci_hcd *exynos_ehci;
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900154 struct usb_hcd *hcd;
155 struct ehci_hcd *ehci;
156 struct resource *res;
157 int irq;
158 int err;
159
Vivek Gautam2c026e22012-07-16 11:25:37 +0530160 /*
161 * Right now device-tree probed devices don't get dma_mask set.
162 * Since shared usb code relies on it, set it here for now.
163 * Once we move to full device tree support this will vanish off.
164 */
Linus Torvalds8ceafbf2013-11-14 07:55:21 +0900165 err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
166 if (err)
167 return err;
Vivek Gautam2c026e22012-07-16 11:25:37 +0530168
Vivek Gautam91a96772014-05-05 10:34:25 +0530169 exynos_setup_vbus_gpio(&pdev->dev);
Vivek Gautamfd81d592012-07-17 10:10:50 +0530170
Jingoo Han29824c162013-10-10 16:42:47 +0900171 hcd = usb_create_hcd(&exynos_ehci_hc_driver,
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200172 &pdev->dev, dev_name(&pdev->dev));
173 if (!hcd) {
174 dev_err(&pdev->dev, "Unable to create HCD\n");
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900175 return -ENOMEM;
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200176 }
Jingoo Han29824c162013-10-10 16:42:47 +0900177 exynos_ehci = to_exynos_ehci(hcd);
Thomas Abrahame6b0166f2013-05-27 18:42:12 +0900178
Kamil Debski1c176752014-05-05 10:32:28 +0530179 err = exynos_ehci_get_phy(&pdev->dev, exynos_ehci);
180 if (err)
181 goto fail_clk;
Vivek Gautamd233c192013-01-22 18:30:42 +0530182
Jingoo Han29824c162013-10-10 16:42:47 +0900183 exynos_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900184
Jingoo Han29824c162013-10-10 16:42:47 +0900185 if (IS_ERR(exynos_ehci->clk)) {
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900186 dev_err(&pdev->dev, "Failed to get usbhost clock\n");
Jingoo Han29824c162013-10-10 16:42:47 +0900187 err = PTR_ERR(exynos_ehci->clk);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900188 goto fail_clk;
189 }
190
Jingoo Han29824c162013-10-10 16:42:47 +0900191 err = clk_prepare_enable(exynos_ehci->clk);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900192 if (err)
Julia Lawall63fd0ae2012-07-30 16:43:44 +0200193 goto fail_clk;
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900194
195 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Vivek Gautam4e24bde2014-05-10 17:30:05 +0530196 hcd->regs = devm_ioremap_resource(&pdev->dev, res);
197 if (IS_ERR(hcd->regs)) {
198 err = PTR_ERR(hcd->regs);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900199 goto fail_io;
200 }
201
Varka Bhadram35df6472014-11-04 07:51:33 +0530202 hcd->rsrc_start = res->start;
203 hcd->rsrc_len = resource_size(res);
204
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900205 irq = platform_get_irq(pdev, 0);
Tang Bin44ed2402020-06-02 19:47:08 +0800206 if (irq < 0) {
207 err = irq;
Jingoo Han9cb07562012-06-28 16:29:46 +0900208 goto fail_io;
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900209 }
210
Kamil Debski1c176752014-05-05 10:32:28 +0530211 err = exynos_ehci_phy_enable(&pdev->dev);
212 if (err) {
213 dev_err(&pdev->dev, "Failed to enable USB phy\n");
214 goto fail_io;
215 }
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900216
217 ehci = hcd_to_ehci(hcd);
218 ehci->caps = hcd->regs;
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900219
Marek Szyprowski01d40712019-05-20 11:08:23 +0200220 /*
Marek Szyprowski214b6062019-07-26 10:14:52 +0200221 * Workaround: reset of_node pointer to avoid conflict between legacy
222 * Exynos EHCI port subnodes and generic USB device bindings
Marek Szyprowski01d40712019-05-20 11:08:23 +0200223 */
224 exynos_ehci->of_node = pdev->dev.of_node;
Marek Szyprowski214b6062019-07-26 10:14:52 +0200225 if (exynos_ehci->legacy_phy)
226 pdev->dev.of_node = NULL;
Marek Szyprowski01d40712019-05-20 11:08:23 +0200227
Jingoo Han88555a62012-03-05 10:40:14 +0900228 /* DMA burst Enable */
229 writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
230
Yong Zhangb5dd18d2011-09-07 16:10:52 +0800231 err = usb_add_hcd(hcd, irq, IRQF_SHARED);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900232 if (err) {
233 dev_err(&pdev->dev, "Failed to add USB HCD\n");
Vivek Gautamd233c192013-01-22 18:30:42 +0530234 goto fail_add_hcd;
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900235 }
Peter Chen3c9740a2013-11-05 10:46:02 +0800236 device_wakeup_enable(hcd->self.controller);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900237
Vivek Gautambbcd85a2013-04-09 18:42:11 +0530238 platform_set_drvdata(pdev, hcd);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900239
240 return 0;
241
Vivek Gautamd233c192013-01-22 18:30:42 +0530242fail_add_hcd:
Kamil Debski1c176752014-05-05 10:32:28 +0530243 exynos_ehci_phy_disable(&pdev->dev);
Marek Szyprowski01d40712019-05-20 11:08:23 +0200244 pdev->dev.of_node = exynos_ehci->of_node;
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900245fail_io:
Jingoo Han29824c162013-10-10 16:42:47 +0900246 clk_disable_unprepare(exynos_ehci->clk);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900247fail_clk:
248 usb_put_hcd(hcd);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900249 return err;
250}
251
Jingoo Han29824c162013-10-10 16:42:47 +0900252static int exynos_ehci_remove(struct platform_device *pdev)
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900253{
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200254 struct usb_hcd *hcd = platform_get_drvdata(pdev);
Jingoo Han29824c162013-10-10 16:42:47 +0900255 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900256
Marek Szyprowski01d40712019-05-20 11:08:23 +0200257 pdev->dev.of_node = exynos_ehci->of_node;
258
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900259 usb_remove_hcd(hcd);
260
Kamil Debski1c176752014-05-05 10:32:28 +0530261 exynos_ehci_phy_disable(&pdev->dev);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900262
Jingoo Han29824c162013-10-10 16:42:47 +0900263 clk_disable_unprepare(exynos_ehci->clk);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900264
265 usb_put_hcd(hcd);
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900266
267 return 0;
268}
269
Jingoo Han1acb30e2011-05-20 20:48:33 +0900270#ifdef CONFIG_PM
Jingoo Han29824c162013-10-10 16:42:47 +0900271static int exynos_ehci_suspend(struct device *dev)
Jingoo Han1acb30e2011-05-20 20:48:33 +0900272{
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200273 struct usb_hcd *hcd = dev_get_drvdata(dev);
Jingoo Han29824c162013-10-10 16:42:47 +0900274 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200275
Alan Sternc5cf9212012-06-28 11:19:02 -0400276 bool do_wakeup = device_may_wakeup(dev);
Alan Sternc5cf9212012-06-28 11:19:02 -0400277 int rc;
Jingoo Han1acb30e2011-05-20 20:48:33 +0900278
Alan Sternc5cf9212012-06-28 11:19:02 -0400279 rc = ehci_suspend(hcd, do_wakeup);
Vivek Gautamd7217512014-04-10 15:58:01 +0530280 if (rc)
281 return rc;
Jingoo Han1acb30e2011-05-20 20:48:33 +0900282
Kamil Debski1c176752014-05-05 10:32:28 +0530283 exynos_ehci_phy_disable(dev);
Jingoo Han1acb30e2011-05-20 20:48:33 +0900284
Jingoo Han29824c162013-10-10 16:42:47 +0900285 clk_disable_unprepare(exynos_ehci->clk);
Jingoo Han8b4fc8c2012-04-13 11:06:36 +0900286
Jingoo Han1acb30e2011-05-20 20:48:33 +0900287 return rc;
288}
289
Jingoo Han29824c162013-10-10 16:42:47 +0900290static int exynos_ehci_resume(struct device *dev)
Jingoo Han1acb30e2011-05-20 20:48:33 +0900291{
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200292 struct usb_hcd *hcd = dev_get_drvdata(dev);
Jingoo Han29824c162013-10-10 16:42:47 +0900293 struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd);
Kamil Debski1c176752014-05-05 10:32:28 +0530294 int ret;
Jingoo Han1acb30e2011-05-20 20:48:33 +0900295
Arvind Yadav264ffb12017-06-12 16:45:14 +0530296 ret = clk_prepare_enable(exynos_ehci->clk);
297 if (ret)
298 return ret;
Jingoo Han8b4fc8c2012-04-13 11:06:36 +0900299
Kamil Debski1c176752014-05-05 10:32:28 +0530300 ret = exynos_ehci_phy_enable(dev);
301 if (ret) {
302 dev_err(dev, "Failed to enable USB phy\n");
303 clk_disable_unprepare(exynos_ehci->clk);
304 return ret;
305 }
Jingoo Han1acb30e2011-05-20 20:48:33 +0900306
Jingoo Han88555a62012-03-05 10:40:14 +0900307 /* DMA burst Enable */
308 writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
309
Alan Sternc5cf9212012-06-28 11:19:02 -0400310 ehci_resume(hcd, false);
Jingoo Han1acb30e2011-05-20 20:48:33 +0900311 return 0;
312}
313#else
Jingoo Han29824c162013-10-10 16:42:47 +0900314#define exynos_ehci_suspend NULL
315#define exynos_ehci_resume NULL
Jingoo Han1acb30e2011-05-20 20:48:33 +0900316#endif
317
Jingoo Han29824c162013-10-10 16:42:47 +0900318static const struct dev_pm_ops exynos_ehci_pm_ops = {
319 .suspend = exynos_ehci_suspend,
320 .resume = exynos_ehci_resume,
Jingoo Han1acb30e2011-05-20 20:48:33 +0900321};
322
Vivek Gautam2c026e22012-07-16 11:25:37 +0530323#ifdef CONFIG_OF
324static const struct of_device_id exynos_ehci_match[] = {
Vivek Gautam6e247772013-01-24 19:15:29 +0530325 { .compatible = "samsung,exynos4210-ehci" },
Vivek Gautam2c026e22012-07-16 11:25:37 +0530326 {},
327};
328MODULE_DEVICE_TABLE(of, exynos_ehci_match);
329#endif
330
Jingoo Han29824c162013-10-10 16:42:47 +0900331static struct platform_driver exynos_ehci_driver = {
332 .probe = exynos_ehci_probe,
333 .remove = exynos_ehci_remove,
Roger Quadrosaaf6b522013-07-22 15:04:50 +0300334 .shutdown = usb_hcd_platform_shutdown,
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900335 .driver = {
Jingoo Han29824c162013-10-10 16:42:47 +0900336 .name = "exynos-ehci",
Jingoo Han29824c162013-10-10 16:42:47 +0900337 .pm = &exynos_ehci_pm_ops,
Vivek Gautam2c026e22012-07-16 11:25:37 +0530338 .of_match_table = of_match_ptr(exynos_ehci_match),
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900339 }
340};
Nicolas Pitreedc8c542016-04-27 13:28:32 -0400341static const struct ehci_driver_overrides exynos_overrides __initconst = {
Jingoo Han29824c162013-10-10 16:42:47 +0900342 .extra_priv_size = sizeof(struct exynos_ehci_hcd),
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200343};
Joonyoung Shim1bcc5aa2011-04-08 14:08:50 +0900344
Jingoo Han29824c162013-10-10 16:42:47 +0900345static int __init ehci_exynos_init(void)
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200346{
347 if (usb_disabled())
348 return -ENODEV;
349
350 pr_info("%s: " DRIVER_DESC "\n", hcd_name);
Jingoo Han29824c162013-10-10 16:42:47 +0900351 ehci_init_driver(&exynos_ehci_hc_driver, &exynos_overrides);
352 return platform_driver_register(&exynos_ehci_driver);
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200353}
Jingoo Han29824c162013-10-10 16:42:47 +0900354module_init(ehci_exynos_init);
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200355
Jingoo Han29824c162013-10-10 16:42:47 +0900356static void __exit ehci_exynos_cleanup(void)
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200357{
Jingoo Han29824c162013-10-10 16:42:47 +0900358 platform_driver_unregister(&exynos_ehci_driver);
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200359}
Jingoo Han29824c162013-10-10 16:42:47 +0900360module_exit(ehci_exynos_cleanup);
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200361
362MODULE_DESCRIPTION(DRIVER_DESC);
Jingoo Han29824c162013-10-10 16:42:47 +0900363MODULE_ALIAS("platform:exynos-ehci");
Manjunath Goudar7edb3da2013-04-02 18:24:01 +0200364MODULE_AUTHOR("Jingoo Han");
365MODULE_AUTHOR("Joonyoung Shim");
366MODULE_LICENSE("GPL v2");