Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Generic platform ohci driver |
| 3 | * |
| 4 | * Copyright 2007 Michael Buesch <m@bues.ch> |
| 5 | * Copyright 2011-2012 Hauke Mehrtens <hauke@hauke-m.de> |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 6 | * Copyright 2014 Hans de Goede <hdegoede@redhat.com> |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 7 | * |
| 8 | * Derived from the OCHI-SSB driver |
| 9 | * Derived from the OHCI-PCI driver |
| 10 | * Copyright 1999 Roman Weissgaerber |
| 11 | * Copyright 2000-2002 David Brownell |
| 12 | * Copyright 1999 Linus Torvalds |
| 13 | * Copyright 1999 Gregory P. Smith |
| 14 | * |
| 15 | * Licensed under the GNU/GPL. See COPYING for details. |
| 16 | */ |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 17 | |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 18 | #include <linux/clk.h> |
| 19 | #include <linux/dma-mapping.h> |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 20 | #include <linux/hrtimer.h> |
| 21 | #include <linux/io.h> |
| 22 | #include <linux/kernel.h> |
| 23 | #include <linux/module.h> |
Thierry Reding | 148e113 | 2013-01-21 11:09:22 +0100 | [diff] [blame] | 24 | #include <linux/err.h> |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 25 | #include <linux/phy/phy.h> |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 26 | #include <linux/platform_device.h> |
| 27 | #include <linux/usb/ohci_pdriver.h> |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 28 | #include <linux/usb.h> |
| 29 | #include <linux/usb/hcd.h> |
| 30 | |
| 31 | #include "ohci.h" |
| 32 | |
| 33 | #define DRIVER_DESC "OHCI generic platform driver" |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 34 | #define OHCI_MAX_CLKS 3 |
| 35 | #define hcd_to_ohci_priv(h) ((struct ohci_platform_priv *)hcd_to_ohci(h)->priv) |
| 36 | |
| 37 | struct ohci_platform_priv { |
| 38 | struct clk *clks[OHCI_MAX_CLKS]; |
| 39 | struct phy *phy; |
| 40 | }; |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 41 | |
| 42 | static const char hcd_name[] = "ohci-platform"; |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 43 | |
| 44 | static int ohci_platform_reset(struct usb_hcd *hcd) |
| 45 | { |
| 46 | struct platform_device *pdev = to_platform_device(hcd->self.controller); |
Jingoo Han | d4f09e2 | 2013-07-30 19:59:40 +0900 | [diff] [blame] | 47 | struct usb_ohci_pdata *pdata = dev_get_platdata(&pdev->dev); |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 48 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 49 | |
| 50 | if (pdata->big_endian_desc) |
| 51 | ohci->flags |= OHCI_QUIRK_BE_DESC; |
| 52 | if (pdata->big_endian_mmio) |
| 53 | ohci->flags |= OHCI_QUIRK_BE_MMIO; |
| 54 | if (pdata->no_big_frame_no) |
| 55 | ohci->flags |= OHCI_QUIRK_FRAME_NO; |
Florian Fainelli | 2b16e39 | 2012-10-08 15:11:26 +0200 | [diff] [blame] | 56 | if (pdata->num_ports) |
| 57 | ohci->num_ports = pdata->num_ports; |
| 58 | |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 59 | return ohci_setup(hcd); |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 60 | } |
| 61 | |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 62 | static int ohci_platform_power_on(struct platform_device *dev) |
| 63 | { |
| 64 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 65 | struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); |
| 66 | int clk, ret; |
| 67 | |
| 68 | for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++) { |
| 69 | ret = clk_prepare_enable(priv->clks[clk]); |
| 70 | if (ret) |
| 71 | goto err_disable_clks; |
| 72 | } |
| 73 | |
| 74 | if (priv->phy) { |
| 75 | ret = phy_init(priv->phy); |
| 76 | if (ret) |
| 77 | goto err_disable_clks; |
| 78 | |
| 79 | ret = phy_power_on(priv->phy); |
| 80 | if (ret) |
| 81 | goto err_exit_phy; |
| 82 | } |
| 83 | |
| 84 | return 0; |
| 85 | |
| 86 | err_exit_phy: |
| 87 | phy_exit(priv->phy); |
| 88 | err_disable_clks: |
| 89 | while (--clk >= 0) |
| 90 | clk_disable_unprepare(priv->clks[clk]); |
| 91 | |
| 92 | return ret; |
| 93 | } |
| 94 | |
| 95 | static void ohci_platform_power_off(struct platform_device *dev) |
| 96 | { |
| 97 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
| 98 | struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); |
| 99 | int clk; |
| 100 | |
| 101 | if (priv->phy) { |
| 102 | phy_power_off(priv->phy); |
| 103 | phy_exit(priv->phy); |
| 104 | } |
| 105 | |
| 106 | for (clk = OHCI_MAX_CLKS - 1; clk >= 0; clk--) |
| 107 | if (priv->clks[clk]) |
| 108 | clk_disable_unprepare(priv->clks[clk]); |
| 109 | } |
| 110 | |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 111 | static struct hc_driver __read_mostly ohci_platform_hc_driver; |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 112 | |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 113 | static const struct ohci_driver_overrides platform_overrides __initconst = { |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 114 | .product_desc = "Generic Platform OHCI controller", |
| 115 | .reset = ohci_platform_reset, |
| 116 | .extra_priv_size = sizeof(struct ohci_platform_priv), |
| 117 | }; |
| 118 | |
| 119 | static struct usb_ohci_pdata ohci_platform_defaults = { |
| 120 | .power_on = ohci_platform_power_on, |
| 121 | .power_suspend = ohci_platform_power_off, |
| 122 | .power_off = ohci_platform_power_off, |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 123 | }; |
| 124 | |
Bill Pemberton | 41ac7b3 | 2012-11-19 13:21:48 -0500 | [diff] [blame] | 125 | static int ohci_platform_probe(struct platform_device *dev) |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 126 | { |
| 127 | struct usb_hcd *hcd; |
| 128 | struct resource *res_mem; |
Jingoo Han | d4f09e2 | 2013-07-30 19:59:40 +0900 | [diff] [blame] | 129 | struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 130 | struct ohci_platform_priv *priv; |
Hans de Goede | b103441 | 2014-02-07 16:36:42 +0100 | [diff] [blame] | 131 | struct ohci_hcd *ohci; |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 132 | int err, irq, clk = 0; |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 133 | |
| 134 | if (usb_disabled()) |
| 135 | return -ENODEV; |
| 136 | |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 137 | /* |
| 138 | * Use reasonable defaults so platforms don't have to provide these |
| 139 | * with DT probing on ARM. |
| 140 | */ |
| 141 | if (!pdata) |
| 142 | pdata = &ohci_platform_defaults; |
| 143 | |
| 144 | err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); |
| 145 | if (err) |
| 146 | return err; |
| 147 | |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 148 | irq = platform_get_irq(dev, 0); |
| 149 | if (irq < 0) { |
Florian Fainelli | 976baf6 | 2012-10-08 15:11:42 +0200 | [diff] [blame] | 150 | dev_err(&dev->dev, "no irq provided"); |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 151 | return irq; |
| 152 | } |
| 153 | |
| 154 | res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 155 | if (!res_mem) { |
Florian Fainelli | ac0e3c0 | 2012-10-08 15:11:44 +0200 | [diff] [blame] | 156 | dev_err(&dev->dev, "no memory resource provided"); |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 157 | return -ENXIO; |
| 158 | } |
| 159 | |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 160 | hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev, |
| 161 | dev_name(&dev->dev)); |
| 162 | if (!hcd) |
| 163 | return -ENOMEM; |
| 164 | |
| 165 | platform_set_drvdata(dev, hcd); |
| 166 | dev->dev.platform_data = pdata; |
| 167 | priv = hcd_to_ohci_priv(hcd); |
Hans de Goede | b103441 | 2014-02-07 16:36:42 +0100 | [diff] [blame] | 168 | ohci = hcd_to_ohci(hcd); |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 169 | |
| 170 | if (pdata == &ohci_platform_defaults && dev->dev.of_node) { |
Hans de Goede | b103441 | 2014-02-07 16:36:42 +0100 | [diff] [blame] | 171 | if (of_property_read_bool(dev->dev.of_node, "big-endian-regs")) |
| 172 | ohci->flags |= OHCI_QUIRK_BE_MMIO; |
| 173 | |
| 174 | if (of_property_read_bool(dev->dev.of_node, "big-endian-desc")) |
| 175 | ohci->flags |= OHCI_QUIRK_BE_DESC; |
| 176 | |
| 177 | if (of_property_read_bool(dev->dev.of_node, "big-endian")) |
| 178 | ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC; |
| 179 | |
| 180 | #ifndef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO |
| 181 | if (ohci->flags & OHCI_QUIRK_BE_MMIO) { |
| 182 | dev_err(&dev->dev, |
| 183 | "Error big-endian-regs not compiled in\n"); |
| 184 | err = -EINVAL; |
| 185 | goto err_put_hcd; |
| 186 | } |
| 187 | #endif |
| 188 | #ifndef CONFIG_USB_OHCI_BIG_ENDIAN_DESC |
| 189 | if (ohci->flags & OHCI_QUIRK_BE_DESC) { |
| 190 | dev_err(&dev->dev, |
| 191 | "Error big-endian-desc not compiled in\n"); |
| 192 | err = -EINVAL; |
| 193 | goto err_put_hcd; |
| 194 | } |
| 195 | #endif |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 196 | priv->phy = devm_phy_get(&dev->dev, "usb"); |
| 197 | if (IS_ERR(priv->phy)) { |
| 198 | err = PTR_ERR(priv->phy); |
| 199 | if (err == -EPROBE_DEFER) |
| 200 | goto err_put_hcd; |
| 201 | priv->phy = NULL; |
| 202 | } |
| 203 | |
| 204 | for (clk = 0; clk < OHCI_MAX_CLKS; clk++) { |
| 205 | priv->clks[clk] = of_clk_get(dev->dev.of_node, clk); |
| 206 | if (IS_ERR(priv->clks[clk])) { |
| 207 | err = PTR_ERR(priv->clks[clk]); |
| 208 | if (err == -EPROBE_DEFER) |
| 209 | goto err_put_clks; |
| 210 | priv->clks[clk] = NULL; |
| 211 | break; |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 216 | if (pdata->power_on) { |
| 217 | err = pdata->power_on(dev); |
| 218 | if (err < 0) |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 219 | goto err_put_clks; |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 220 | } |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 221 | |
| 222 | hcd->rsrc_start = res_mem->start; |
| 223 | hcd->rsrc_len = resource_size(res_mem); |
| 224 | |
Thierry Reding | 148e113 | 2013-01-21 11:09:22 +0100 | [diff] [blame] | 225 | hcd->regs = devm_ioremap_resource(&dev->dev, res_mem); |
| 226 | if (IS_ERR(hcd->regs)) { |
| 227 | err = PTR_ERR(hcd->regs); |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 228 | goto err_power; |
Julia Lawall | aece389 | 2012-08-14 08:47:37 +0200 | [diff] [blame] | 229 | } |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 230 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); |
| 231 | if (err) |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 232 | goto err_power; |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 233 | |
Peter Chen | 3c9740a | 2013-11-05 10:46:02 +0800 | [diff] [blame] | 234 | device_wakeup_enable(hcd->self.controller); |
| 235 | |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 236 | platform_set_drvdata(dev, hcd); |
| 237 | |
| 238 | return err; |
| 239 | |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 240 | err_power: |
| 241 | if (pdata->power_off) |
| 242 | pdata->power_off(dev); |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 243 | err_put_clks: |
| 244 | while (--clk >= 0) |
| 245 | clk_put(priv->clks[clk]); |
| 246 | err_put_hcd: |
| 247 | if (pdata == &ohci_platform_defaults) |
| 248 | dev->dev.platform_data = NULL; |
| 249 | |
| 250 | usb_put_hcd(hcd); |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 251 | |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 252 | return err; |
| 253 | } |
| 254 | |
Bill Pemberton | fb4e98a | 2012-11-19 13:26:20 -0500 | [diff] [blame] | 255 | static int ohci_platform_remove(struct platform_device *dev) |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 256 | { |
| 257 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
Jingoo Han | d4f09e2 | 2013-07-30 19:59:40 +0900 | [diff] [blame] | 258 | struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 259 | struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); |
| 260 | int clk; |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 261 | |
| 262 | usb_remove_hcd(hcd); |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 263 | |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 264 | if (pdata->power_off) |
| 265 | pdata->power_off(dev); |
| 266 | |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 267 | for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++) |
| 268 | clk_put(priv->clks[clk]); |
| 269 | |
| 270 | usb_put_hcd(hcd); |
| 271 | |
| 272 | if (pdata == &ohci_platform_defaults) |
| 273 | dev->dev.platform_data = NULL; |
| 274 | |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 275 | return 0; |
| 276 | } |
| 277 | |
| 278 | #ifdef CONFIG_PM |
| 279 | |
| 280 | static int ohci_platform_suspend(struct device *dev) |
| 281 | { |
Manjunath Goudar | 39dbd7d | 2013-10-04 09:58:14 +0530 | [diff] [blame] | 282 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
| 283 | struct usb_ohci_pdata *pdata = dev->platform_data; |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 284 | struct platform_device *pdev = |
| 285 | container_of(dev, struct platform_device, dev); |
Manjunath Goudar | 39dbd7d | 2013-10-04 09:58:14 +0530 | [diff] [blame] | 286 | bool do_wakeup = device_may_wakeup(dev); |
| 287 | int ret; |
| 288 | |
| 289 | ret = ohci_suspend(hcd, do_wakeup); |
| 290 | if (ret) |
| 291 | return ret; |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 292 | |
| 293 | if (pdata->power_suspend) |
| 294 | pdata->power_suspend(pdev); |
| 295 | |
Manjunath Goudar | 39dbd7d | 2013-10-04 09:58:14 +0530 | [diff] [blame] | 296 | return ret; |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | static int ohci_platform_resume(struct device *dev) |
| 300 | { |
| 301 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
Jingoo Han | d4f09e2 | 2013-07-30 19:59:40 +0900 | [diff] [blame] | 302 | struct usb_ohci_pdata *pdata = dev_get_platdata(dev); |
Kuninori Morimoto | e4d37ae | 2012-08-06 18:09:10 -0700 | [diff] [blame] | 303 | struct platform_device *pdev = |
| 304 | container_of(dev, struct platform_device, dev); |
| 305 | |
| 306 | if (pdata->power_on) { |
| 307 | int err = pdata->power_on(pdev); |
| 308 | if (err < 0) |
| 309 | return err; |
| 310 | } |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 311 | |
Florian Fainelli | cfa49b4 | 2012-10-08 15:11:29 +0200 | [diff] [blame] | 312 | ohci_resume(hcd, false); |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 313 | return 0; |
| 314 | } |
| 315 | |
| 316 | #else /* !CONFIG_PM */ |
| 317 | #define ohci_platform_suspend NULL |
| 318 | #define ohci_platform_resume NULL |
| 319 | #endif /* CONFIG_PM */ |
| 320 | |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 321 | static const struct of_device_id ohci_platform_ids[] = { |
Hans de Goede | ce149c3 | 2014-02-11 17:35:28 +0100 | [diff] [blame^] | 322 | { .compatible = "generic-ohci", }, |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 323 | { } |
| 324 | }; |
| 325 | MODULE_DEVICE_TABLE(of, ohci_platform_ids); |
| 326 | |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 327 | static const struct platform_device_id ohci_platform_table[] = { |
| 328 | { "ohci-platform", 0 }, |
| 329 | { } |
| 330 | }; |
| 331 | MODULE_DEVICE_TABLE(platform, ohci_platform_table); |
| 332 | |
| 333 | static const struct dev_pm_ops ohci_platform_pm_ops = { |
| 334 | .suspend = ohci_platform_suspend, |
| 335 | .resume = ohci_platform_resume, |
| 336 | }; |
| 337 | |
| 338 | static struct platform_driver ohci_platform_driver = { |
| 339 | .id_table = ohci_platform_table, |
| 340 | .probe = ohci_platform_probe, |
Bill Pemberton | 7690417 | 2012-11-19 13:21:08 -0500 | [diff] [blame] | 341 | .remove = ohci_platform_remove, |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 342 | .shutdown = usb_hcd_platform_shutdown, |
| 343 | .driver = { |
| 344 | .owner = THIS_MODULE, |
| 345 | .name = "ohci-platform", |
| 346 | .pm = &ohci_platform_pm_ops, |
Hans de Goede | ca52a17 | 2014-02-07 16:36:40 +0100 | [diff] [blame] | 347 | .of_match_table = ohci_platform_ids, |
Hauke Mehrtens | fa3364b | 2012-03-13 01:04:47 +0100 | [diff] [blame] | 348 | } |
| 349 | }; |
Manjunath Goudar | 928fb68 | 2013-06-03 20:46:08 +0530 | [diff] [blame] | 350 | |
| 351 | static int __init ohci_platform_init(void) |
| 352 | { |
| 353 | if (usb_disabled()) |
| 354 | return -ENODEV; |
| 355 | |
| 356 | pr_info("%s: " DRIVER_DESC "\n", hcd_name); |
| 357 | |
| 358 | ohci_init_driver(&ohci_platform_hc_driver, &platform_overrides); |
| 359 | return platform_driver_register(&ohci_platform_driver); |
| 360 | } |
| 361 | module_init(ohci_platform_init); |
| 362 | |
| 363 | static void __exit ohci_platform_cleanup(void) |
| 364 | { |
| 365 | platform_driver_unregister(&ohci_platform_driver); |
| 366 | } |
| 367 | module_exit(ohci_platform_cleanup); |
| 368 | |
| 369 | MODULE_DESCRIPTION(DRIVER_DESC); |
| 370 | MODULE_AUTHOR("Hauke Mehrtens"); |
| 371 | MODULE_AUTHOR("Alan Stern"); |
| 372 | MODULE_LICENSE("GPL"); |