Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 1 | /* |
| 2 | * SAMSUNG EXYNOS USB HOST OHCI Controller |
| 3 | * |
| 4 | * Copyright (C) 2011 Samsung Electronics Co.Ltd |
| 5 | * Author: Jingoo Han <jg1.han@samsung.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms of the GNU General Public License as published by the |
| 9 | * Free Software Foundation; either version 2 of the License, or (at your |
| 10 | * option) any later version. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/clk.h> |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 15 | #include <linux/dma-mapping.h> |
| 16 | #include <linux/io.h> |
| 17 | #include <linux/kernel.h> |
| 18 | #include <linux/module.h> |
Vivek Gautam | d513893 | 2012-07-16 11:25:36 +0530 | [diff] [blame] | 19 | #include <linux/of.h> |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 20 | #include <linux/platform_device.h> |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 21 | #include <linux/usb/phy.h> |
Vivek Gautam | b506eeb | 2013-01-22 18:30:40 +0530 | [diff] [blame] | 22 | #include <linux/usb/samsung_usb_phy.h> |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 23 | #include <linux/usb.h> |
| 24 | #include <linux/usb/hcd.h> |
| 25 | #include <linux/usb/otg.h> |
| 26 | |
| 27 | #include "ohci.h" |
| 28 | |
| 29 | #define DRIVER_DESC "OHCI EXYNOS driver" |
| 30 | |
| 31 | static const char hcd_name[] = "ohci-exynos"; |
| 32 | static struct hc_driver __read_mostly exynos_ohci_hc_driver; |
| 33 | |
| 34 | #define to_exynos_ohci(hcd) (struct exynos_ohci_hcd *)(hcd_to_ohci(hcd)->priv) |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 35 | |
| 36 | struct exynos_ohci_hcd { |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 37 | struct clk *clk; |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 38 | struct usb_phy *phy; |
| 39 | struct usb_otg *otg; |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 40 | }; |
| 41 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 42 | static void exynos_ohci_phy_enable(struct platform_device *pdev) |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 43 | { |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 44 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 45 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 46 | |
| 47 | if (exynos_ohci->phy) |
| 48 | usb_phy_init(exynos_ohci->phy); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 49 | } |
| 50 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 51 | static void exynos_ohci_phy_disable(struct platform_device *pdev) |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 52 | { |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 53 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 54 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 55 | |
| 56 | if (exynos_ohci->phy) |
| 57 | usb_phy_shutdown(exynos_ohci->phy); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 58 | } |
| 59 | |
Bill Pemberton | 41ac7b3 | 2012-11-19 13:21:48 -0500 | [diff] [blame] | 60 | static int exynos_ohci_probe(struct platform_device *pdev) |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 61 | { |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 62 | struct exynos_ohci_hcd *exynos_ohci; |
| 63 | struct usb_hcd *hcd; |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 64 | struct resource *res; |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 65 | struct usb_phy *phy; |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 66 | int irq; |
| 67 | int err; |
| 68 | |
Vivek Gautam | d513893 | 2012-07-16 11:25:36 +0530 | [diff] [blame] | 69 | /* |
| 70 | * Right now device-tree probed devices don't get dma_mask set. |
| 71 | * Since shared usb code relies on it, set it here for now. |
| 72 | * Once we move to full device tree support this will vanish off. |
| 73 | */ |
Russell King | e1fd734 | 2013-06-27 12:36:37 +0100 | [diff] [blame] | 74 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
Russell King | 22d9d8e | 2013-06-10 16:28:49 +0100 | [diff] [blame] | 75 | if (err) |
| 76 | return err; |
Vivek Gautam | d513893 | 2012-07-16 11:25:36 +0530 | [diff] [blame] | 77 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 78 | hcd = usb_create_hcd(&exynos_ohci_hc_driver, |
| 79 | &pdev->dev, dev_name(&pdev->dev)); |
| 80 | if (!hcd) { |
| 81 | dev_err(&pdev->dev, "Unable to create HCD\n"); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 82 | return -ENOMEM; |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | exynos_ohci = to_exynos_ohci(hcd); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 86 | |
Thomas Abraham | 2871782 | 2013-04-11 17:12:30 +0530 | [diff] [blame] | 87 | if (of_device_is_compatible(pdev->dev.of_node, |
| 88 | "samsung,exynos5440-ohci")) |
| 89 | goto skip_phy; |
| 90 | |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 91 | phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); |
Felipe Balbi | 9ee1c7f | 2013-03-15 11:05:03 +0200 | [diff] [blame] | 92 | if (IS_ERR(phy)) { |
Jingoo Han | c00809d | 2013-10-14 09:18:54 +0900 | [diff] [blame] | 93 | usb_put_hcd(hcd); |
| 94 | dev_warn(&pdev->dev, "no platform data or transceiver defined\n"); |
| 95 | return -EPROBE_DEFER; |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 96 | } else { |
| 97 | exynos_ohci->phy = phy; |
| 98 | exynos_ohci->otg = phy->otg; |
| 99 | } |
| 100 | |
Thomas Abraham | 2871782 | 2013-04-11 17:12:30 +0530 | [diff] [blame] | 101 | skip_phy: |
Jingoo Han | 60d80ad | 2012-10-04 16:11:50 +0900 | [diff] [blame] | 102 | exynos_ohci->clk = devm_clk_get(&pdev->dev, "usbhost"); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 103 | |
| 104 | if (IS_ERR(exynos_ohci->clk)) { |
| 105 | dev_err(&pdev->dev, "Failed to get usbhost clock\n"); |
| 106 | err = PTR_ERR(exynos_ohci->clk); |
| 107 | goto fail_clk; |
| 108 | } |
| 109 | |
Thomas Abraham | c05c946 | 2012-10-03 08:41:37 +0900 | [diff] [blame] | 110 | err = clk_prepare_enable(exynos_ohci->clk); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 111 | if (err) |
Jingoo Han | 60d80ad | 2012-10-04 16:11:50 +0900 | [diff] [blame] | 112 | goto fail_clk; |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 113 | |
| 114 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 115 | if (!res) { |
| 116 | dev_err(&pdev->dev, "Failed to get I/O memory\n"); |
| 117 | err = -ENXIO; |
| 118 | goto fail_io; |
| 119 | } |
| 120 | |
| 121 | hcd->rsrc_start = res->start; |
| 122 | hcd->rsrc_len = resource_size(res); |
Jingoo Han | 390a0a7 | 2012-06-28 16:30:30 +0900 | [diff] [blame] | 123 | hcd->regs = devm_ioremap(&pdev->dev, res->start, hcd->rsrc_len); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 124 | if (!hcd->regs) { |
| 125 | dev_err(&pdev->dev, "Failed to remap I/O memory\n"); |
| 126 | err = -ENOMEM; |
| 127 | goto fail_io; |
| 128 | } |
| 129 | |
| 130 | irq = platform_get_irq(pdev, 0); |
| 131 | if (!irq) { |
| 132 | dev_err(&pdev->dev, "Failed to get IRQ\n"); |
| 133 | err = -ENODEV; |
Jingoo Han | 390a0a7 | 2012-06-28 16:30:30 +0900 | [diff] [blame] | 134 | goto fail_io; |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 135 | } |
| 136 | |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 137 | if (exynos_ohci->otg) |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 138 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 139 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 140 | platform_set_drvdata(pdev, hcd); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 141 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 142 | exynos_ohci_phy_enable(pdev); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 143 | |
| 144 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); |
| 145 | if (err) { |
| 146 | dev_err(&pdev->dev, "Failed to add USB HCD\n"); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 147 | goto fail_add_hcd; |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 148 | } |
Peter Chen | 3c9740a | 2013-11-05 10:46:02 +0800 | [diff] [blame] | 149 | device_wakeup_enable(hcd->self.controller); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 150 | return 0; |
| 151 | |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 152 | fail_add_hcd: |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 153 | exynos_ohci_phy_disable(pdev); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 154 | fail_io: |
Thomas Abraham | c05c946 | 2012-10-03 08:41:37 +0900 | [diff] [blame] | 155 | clk_disable_unprepare(exynos_ohci->clk); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 156 | fail_clk: |
| 157 | usb_put_hcd(hcd); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 158 | return err; |
| 159 | } |
| 160 | |
Bill Pemberton | fb4e98a | 2012-11-19 13:26:20 -0500 | [diff] [blame] | 161 | static int exynos_ohci_remove(struct platform_device *pdev) |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 162 | { |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 163 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 164 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 165 | |
| 166 | usb_remove_hcd(hcd); |
| 167 | |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 168 | if (exynos_ohci->otg) |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 169 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 170 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 171 | exynos_ohci_phy_disable(pdev); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 172 | |
Thomas Abraham | c05c946 | 2012-10-03 08:41:37 +0900 | [diff] [blame] | 173 | clk_disable_unprepare(exynos_ohci->clk); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 174 | |
| 175 | usb_put_hcd(hcd); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 176 | |
| 177 | return 0; |
| 178 | } |
| 179 | |
| 180 | static void exynos_ohci_shutdown(struct platform_device *pdev) |
| 181 | { |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 182 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 183 | |
| 184 | if (hcd->driver->shutdown) |
| 185 | hcd->driver->shutdown(hcd); |
| 186 | } |
| 187 | |
| 188 | #ifdef CONFIG_PM |
| 189 | static int exynos_ohci_suspend(struct device *dev) |
| 190 | { |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 191 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
| 192 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 193 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 194 | struct platform_device *pdev = to_platform_device(dev); |
Majunath Goudar | 14982e3 | 2013-11-13 17:40:20 +0530 | [diff] [blame] | 195 | bool do_wakeup = device_may_wakeup(dev); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 196 | unsigned long flags; |
Majunath Goudar | 14982e3 | 2013-11-13 17:40:20 +0530 | [diff] [blame] | 197 | int rc = ohci_suspend(hcd, do_wakeup); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 198 | |
Majunath Goudar | 14982e3 | 2013-11-13 17:40:20 +0530 | [diff] [blame] | 199 | if (rc) |
| 200 | return rc; |
| 201 | |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 202 | spin_lock_irqsave(&ohci->lock, flags); |
Greg Kroah-Hartman | 066ba8e | 2013-10-14 10:16:58 -0700 | [diff] [blame] | 203 | |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 204 | if (exynos_ohci->otg) |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 205 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 206 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 207 | exynos_ohci_phy_disable(pdev); |
Jingoo Han | e864abe | 2012-06-28 16:49:42 +0900 | [diff] [blame] | 208 | |
Thomas Abraham | c05c946 | 2012-10-03 08:41:37 +0900 | [diff] [blame] | 209 | clk_disable_unprepare(exynos_ohci->clk); |
Jingoo Han | e864abe | 2012-06-28 16:49:42 +0900 | [diff] [blame] | 210 | |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 211 | spin_unlock_irqrestore(&ohci->lock, flags); |
| 212 | |
Majunath Goudar | 14982e3 | 2013-11-13 17:40:20 +0530 | [diff] [blame] | 213 | return 0; |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | static int exynos_ohci_resume(struct device *dev) |
| 217 | { |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 218 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
| 219 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
| 220 | struct platform_device *pdev = to_platform_device(dev); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 221 | |
Thomas Abraham | c05c946 | 2012-10-03 08:41:37 +0900 | [diff] [blame] | 222 | clk_prepare_enable(exynos_ohci->clk); |
Jingoo Han | e864abe | 2012-06-28 16:49:42 +0900 | [diff] [blame] | 223 | |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 224 | if (exynos_ohci->otg) |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 225 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
Vivek Gautam | ed993bf | 2013-01-22 18:30:43 +0530 | [diff] [blame] | 226 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 227 | exynos_ohci_phy_enable(pdev); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 228 | |
Florian Fainelli | cfa49b4 | 2012-10-08 15:11:29 +0200 | [diff] [blame] | 229 | ohci_resume(hcd, false); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 230 | |
| 231 | return 0; |
| 232 | } |
| 233 | #else |
| 234 | #define exynos_ohci_suspend NULL |
| 235 | #define exynos_ohci_resume NULL |
| 236 | #endif |
| 237 | |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 238 | static const struct ohci_driver_overrides exynos_overrides __initconst = { |
| 239 | .extra_priv_size = sizeof(struct exynos_ohci_hcd), |
| 240 | }; |
| 241 | |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 242 | static const struct dev_pm_ops exynos_ohci_pm_ops = { |
| 243 | .suspend = exynos_ohci_suspend, |
| 244 | .resume = exynos_ohci_resume, |
| 245 | }; |
| 246 | |
Vivek Gautam | d513893 | 2012-07-16 11:25:36 +0530 | [diff] [blame] | 247 | #ifdef CONFIG_OF |
| 248 | static const struct of_device_id exynos_ohci_match[] = { |
Vivek Gautam | 6e24777 | 2013-01-24 19:15:29 +0530 | [diff] [blame] | 249 | { .compatible = "samsung,exynos4210-ohci" }, |
Thomas Abraham | 2871782 | 2013-04-11 17:12:30 +0530 | [diff] [blame] | 250 | { .compatible = "samsung,exynos5440-ohci" }, |
Vivek Gautam | d513893 | 2012-07-16 11:25:36 +0530 | [diff] [blame] | 251 | {}, |
| 252 | }; |
| 253 | MODULE_DEVICE_TABLE(of, exynos_ohci_match); |
| 254 | #endif |
| 255 | |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 256 | static struct platform_driver exynos_ohci_driver = { |
| 257 | .probe = exynos_ohci_probe, |
Bill Pemberton | 7690417 | 2012-11-19 13:21:08 -0500 | [diff] [blame] | 258 | .remove = exynos_ohci_remove, |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 259 | .shutdown = exynos_ohci_shutdown, |
| 260 | .driver = { |
| 261 | .name = "exynos-ohci", |
| 262 | .owner = THIS_MODULE, |
| 263 | .pm = &exynos_ohci_pm_ops, |
Vivek Gautam | d513893 | 2012-07-16 11:25:36 +0530 | [diff] [blame] | 264 | .of_match_table = of_match_ptr(exynos_ohci_match), |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 265 | } |
| 266 | }; |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 267 | static int __init ohci_exynos_init(void) |
| 268 | { |
| 269 | if (usb_disabled()) |
| 270 | return -ENODEV; |
| 271 | |
| 272 | pr_info("%s: " DRIVER_DESC "\n", hcd_name); |
| 273 | ohci_init_driver(&exynos_ohci_hc_driver, &exynos_overrides); |
| 274 | return platform_driver_register(&exynos_ohci_driver); |
| 275 | } |
| 276 | module_init(ohci_exynos_init); |
| 277 | |
| 278 | static void __exit ohci_exynos_cleanup(void) |
| 279 | { |
| 280 | platform_driver_unregister(&exynos_ohci_driver); |
| 281 | } |
| 282 | module_exit(ohci_exynos_cleanup); |
Jingoo Han | 6219424 | 2011-12-23 11:20:54 +0900 | [diff] [blame] | 283 | |
| 284 | MODULE_ALIAS("platform:exynos-ohci"); |
| 285 | MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>"); |
Manjunath Goudar | 50a97e0 | 2013-09-21 16:38:38 +0530 | [diff] [blame] | 286 | MODULE_LICENSE("GPL v2"); |