blob: df3eb3e0324ea9ffde44836ed1788cd509d30d19 [file] [log] [blame]
Vitaly Wool60bbfc82006-06-29 18:28:18 +04001/*
Roland Stigge28643102012-03-12 22:54:50 +01002 * driver for NXP USB Host devices
Vitaly Wool60bbfc82006-06-29 18:28:18 +04003 *
Roland Stigge28643102012-03-12 22:54:50 +01004 * Currently supported OHCI host devices:
Roland Stigge53dc25a2012-03-12 22:54:51 +01005 * - NXP LPC32xx
Vitaly Wool60bbfc82006-06-29 18:28:18 +04006 *
7 * Authors: Dmitry Chigirev <source@mvista.com>
David Brownelldd9048a2006-12-05 03:18:31 -08008 * Vitaly Wool <vitalywool@gmail.com>
Vitaly Wool60bbfc82006-06-29 18:28:18 +04009 *
10 * register initialization is based on code examples provided by Philips
11 * Copyright (c) 2005 Koninklijke Philips Electronics N.V.
12 *
13 * NOTE: This driver does not have suspend/resume functionality
14 * This driver is intended for engineering development purposes only
15 *
16 * 2005-2006 (c) MontaVista Software, Inc. This file is licensed under
17 * the terms of the GNU General Public License version 2. This program
18 * is licensed "as is" without any warranty of any kind, whether express
19 * or implied.
20 */
21#include <linux/clk.h>
22#include <linux/platform_device.h>
23#include <linux/i2c.h>
Roland Stigge2265efe2012-04-29 16:47:03 +020024#include <linux/of.h>
Roland Stigge73108aa2012-04-29 16:47:06 +020025#include <linux/usb/isp1301.h>
Vitaly Wool60bbfc82006-06-29 18:28:18 +040026
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/hardware.h>
Roland Stigge53dc25a2012-03-12 22:54:51 +010028#include <asm/mach-types.h>
Vitaly Wool60bbfc82006-06-29 18:28:18 +040029#include <asm/io.h>
Vitaly Wool60bbfc82006-06-29 18:28:18 +040030
Russell Kinga09e64f2008-08-05 16:14:15 +010031#include <mach/platform.h>
32#include <mach/irqs.h>
Vitaly Wool60bbfc82006-06-29 18:28:18 +040033
Roland Stigge53dc25a2012-03-12 22:54:51 +010034#define USB_CONFIG_BASE 0x31020000
35#define PWRMAN_BASE 0x40004000
36
37#define USB_CTRL IO_ADDRESS(PWRMAN_BASE + 0x64)
Vitaly Wool60bbfc82006-06-29 18:28:18 +040038
39/* USB_CTRL bit defines */
40#define USB_SLAVE_HCLK_EN (1 << 24)
Roland Stiggea6a99cf2012-04-29 16:47:02 +020041#define USB_DEV_NEED_CLK_EN (1 << 22)
Vitaly Wool60bbfc82006-06-29 18:28:18 +040042#define USB_HOST_NEED_CLK_EN (1 << 21)
Roland Stiggea6a99cf2012-04-29 16:47:02 +020043#define PAD_CONTROL_LAST_DRIVEN (1 << 19)
Vitaly Wool60bbfc82006-06-29 18:28:18 +040044
Roland Stigge53dc25a2012-03-12 22:54:51 +010045#define USB_OTG_STAT_CONTROL IO_ADDRESS(USB_CONFIG_BASE + 0x110)
Vitaly Wool60bbfc82006-06-29 18:28:18 +040046
47/* USB_OTG_STAT_CONTROL bit defines */
48#define TRANSPARENT_I2C_EN (1 << 7)
49#define HOST_EN (1 << 0)
50
Roland Stigge53dc25a2012-03-12 22:54:51 +010051/* On LPC32xx, those are undefined */
52#ifndef start_int_set_falling_edge
53#define start_int_set_falling_edge(irq)
54#define start_int_set_rising_edge(irq)
55#define start_int_ack(irq)
56#define start_int_mask(irq)
57#define start_int_umask(irq)
58#endif
59
Jean Delvare09ce4972009-10-01 19:03:13 +020060static struct i2c_client *isp1301_i2c_client;
Vitaly Wool60bbfc82006-06-29 18:28:18 +040061
62extern int usb_disabled(void);
Vitaly Wool60bbfc82006-06-29 18:28:18 +040063
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -030064static struct clk *usb_pll_clk;
65static struct clk *usb_dev_clk;
66static struct clk *usb_otg_clk;
Vitaly Wool60bbfc82006-06-29 18:28:18 +040067
Roland Stigge53dc25a2012-03-12 22:54:51 +010068static void isp1301_configure_lpc32xx(void)
69{
70 /* LPC32XX only supports DAT_SE0 USB mode */
71 /* This sequence is important */
72
73 /* Disable transparent UART mode first */
74 i2c_smbus_write_byte_data(isp1301_i2c_client,
75 (ISP1301_I2C_MODE_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR),
76 MC1_UART_EN);
77 i2c_smbus_write_byte_data(isp1301_i2c_client,
78 (ISP1301_I2C_MODE_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR),
79 ~MC1_SPEED_REG);
80 i2c_smbus_write_byte_data(isp1301_i2c_client,
81 ISP1301_I2C_MODE_CONTROL_1, MC1_SPEED_REG);
82 i2c_smbus_write_byte_data(isp1301_i2c_client,
83 (ISP1301_I2C_MODE_CONTROL_2 | ISP1301_I2C_REG_CLEAR_ADDR),
84 ~0);
85 i2c_smbus_write_byte_data(isp1301_i2c_client,
86 ISP1301_I2C_MODE_CONTROL_2,
87 (MC2_BI_DI | MC2_PSW_EN | MC2_SPD_SUSP_CTRL));
88 i2c_smbus_write_byte_data(isp1301_i2c_client,
89 (ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR), ~0);
90 i2c_smbus_write_byte_data(isp1301_i2c_client,
91 ISP1301_I2C_MODE_CONTROL_1, MC1_DAT_SE0);
92 i2c_smbus_write_byte_data(isp1301_i2c_client,
93 ISP1301_I2C_OTG_CONTROL_1,
94 (OTG1_DM_PULLDOWN | OTG1_DP_PULLDOWN));
95 i2c_smbus_write_byte_data(isp1301_i2c_client,
96 (ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR),
97 (OTG1_DM_PULLUP | OTG1_DP_PULLUP));
98 i2c_smbus_write_byte_data(isp1301_i2c_client,
99 ISP1301_I2C_INTERRUPT_LATCH | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
100 i2c_smbus_write_byte_data(isp1301_i2c_client,
101 ISP1301_I2C_INTERRUPT_FALLING | ISP1301_I2C_REG_CLEAR_ADDR,
102 ~0);
103 i2c_smbus_write_byte_data(isp1301_i2c_client,
104 ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
105
106 /* Enable usb_need_clk clock after transceiver is initialized */
Roland Stiggea6a99cf2012-04-29 16:47:02 +0200107 __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL);
Roland Stigge53dc25a2012-03-12 22:54:51 +0100108
109 printk(KERN_INFO "ISP1301 Vendor ID : 0x%04x\n",
110 i2c_smbus_read_word_data(isp1301_i2c_client, 0x00));
111 printk(KERN_INFO "ISP1301 Product ID : 0x%04x\n",
112 i2c_smbus_read_word_data(isp1301_i2c_client, 0x02));
113 printk(KERN_INFO "ISP1301 Version ID : 0x%04x\n",
114 i2c_smbus_read_word_data(isp1301_i2c_client, 0x14));
115}
116
117static void isp1301_configure(void)
118{
Roland Stigged684f052012-08-26 16:30:37 +0200119 isp1301_configure_lpc32xx();
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400120}
121
122static inline void isp1301_vbus_on(void)
123{
Roland Stiggea6a36002012-03-12 22:54:52 +0100124 i2c_smbus_write_byte_data(isp1301_i2c_client, ISP1301_I2C_OTG_CONTROL_1,
125 OTG1_VBUS_DRV);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400126}
127
128static inline void isp1301_vbus_off(void)
129{
Roland Stiggea6a36002012-03-12 22:54:52 +0100130 i2c_smbus_write_byte_data(isp1301_i2c_client,
131 ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR,
132 OTG1_VBUS_DRV);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400133}
134
Roland Stigge28643102012-03-12 22:54:50 +0100135static void nxp_start_hc(void)
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400136{
137 unsigned long tmp = __raw_readl(USB_OTG_STAT_CONTROL) | HOST_EN;
138 __raw_writel(tmp, USB_OTG_STAT_CONTROL);
139 isp1301_vbus_on();
140}
141
Roland Stigge28643102012-03-12 22:54:50 +0100142static void nxp_stop_hc(void)
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400143{
144 unsigned long tmp;
145 isp1301_vbus_off();
146 tmp = __raw_readl(USB_OTG_STAT_CONTROL) & ~HOST_EN;
147 __raw_writel(tmp, USB_OTG_STAT_CONTROL);
148}
149
Bill Pemberton41ac7b32012-11-19 13:21:48 -0500150static int ohci_nxp_start(struct usb_hcd *hcd)
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400151{
152 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
153 int ret;
154
155 if ((ret = ohci_init(ohci)) < 0)
156 return ret;
157
158 if ((ret = ohci_run(ohci)) < 0) {
159 dev_err(hcd->self.controller, "can't start\n");
160 ohci_stop(hcd);
161 return ret;
162 }
163 return 0;
164}
165
Roland Stigge28643102012-03-12 22:54:50 +0100166static const struct hc_driver ohci_nxp_hc_driver = {
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400167 .description = hcd_name,
Roland Stigge28643102012-03-12 22:54:50 +0100168 .product_desc = "nxp OHCI",
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400169
170 /*
171 * generic hardware linkage
172 */
173 .irq = ohci_irq,
174 .flags = HCD_USB11 | HCD_MEMORY,
175
176 .hcd_priv_size = sizeof(struct ohci_hcd),
177 /*
178 * basic lifecycle operations
179 */
Roland Stigge28643102012-03-12 22:54:50 +0100180 .start = ohci_nxp_start,
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400181 .stop = ohci_stop,
David Brownell8442ae02006-10-02 07:20:10 -0700182 .shutdown = ohci_shutdown,
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400183
184 /*
185 * managing i/o requests and associated device resources
186 */
187 .urb_enqueue = ohci_urb_enqueue,
188 .urb_dequeue = ohci_urb_dequeue,
189 .endpoint_disable = ohci_endpoint_disable,
190
191 /*
192 * scheduling support
193 */
194 .get_frame_number = ohci_get_frame,
195
196 /*
197 * root hub support
198 */
199 .hub_status_data = ohci_hub_status_data,
200 .hub_control = ohci_hub_control,
David Brownell8442ae02006-10-02 07:20:10 -0700201#ifdef CONFIG_PM
202 .bus_suspend = ohci_bus_suspend,
203 .bus_resume = ohci_bus_resume,
204#endif
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400205 .start_port_reset = ohci_start_port_reset,
206};
207
Bill Pemberton41ac7b32012-11-19 13:21:48 -0500208static int usb_hcd_nxp_probe(struct platform_device *pdev)
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400209{
210 struct usb_hcd *hcd = 0;
211 struct ohci_hcd *ohci;
Roland Stigge28643102012-03-12 22:54:50 +0100212 const struct hc_driver *driver = &ohci_nxp_hc_driver;
Roland Stiggea6a99cf2012-04-29 16:47:02 +0200213 struct resource *res;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400214 int ret = 0, irq;
Roland Stigge73108aa2012-04-29 16:47:06 +0200215 struct device_node *isp1301_node;
216
217 if (pdev->dev.of_node) {
218 isp1301_node = of_parse_phandle(pdev->dev.of_node,
219 "transceiver", 0);
220 } else {
221 isp1301_node = NULL;
222 }
223
224 isp1301_i2c_client = isp1301_get_client(isp1301_node);
225 if (!isp1301_i2c_client) {
Libo Chenb3517d52013-05-10 14:22:42 +0800226 return -EPROBE_DEFER;
Roland Stigge73108aa2012-04-29 16:47:06 +0200227 }
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400228
Russell Kinge1fd7342013-06-27 12:36:37 +0100229 ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
Russell King22d9d8e2013-06-10 16:28:49 +0100230 if (ret)
231 goto fail_disable;
Roland Stiggea6a99cf2012-04-29 16:47:02 +0200232
Roland Stigge28643102012-03-12 22:54:50 +0100233 dev_dbg(&pdev->dev, "%s: " DRIVER_DESC " (nxp)\n", hcd_name);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400234 if (usb_disabled()) {
Greg Kroah-Hartmanb6c227e2012-04-27 11:24:41 -0700235 dev_err(&pdev->dev, "USB is disabled\n");
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400236 ret = -ENODEV;
Libo Chenb3517d52013-05-10 14:22:42 +0800237 goto fail_disable;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400238 }
239
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400240 /* Enable AHB slave USB clock, needed for further USB clock control */
Roland Stiggea6a99cf2012-04-29 16:47:02 +0200241 __raw_writel(USB_SLAVE_HCLK_EN | PAD_CONTROL_LAST_DRIVEN, USB_CTRL);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400242
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400243 /* Enable USB PLL */
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300244 usb_pll_clk = clk_get(&pdev->dev, "ck_pll5");
245 if (IS_ERR(usb_pll_clk)) {
Greg Kroah-Hartmanb6c227e2012-04-27 11:24:41 -0700246 dev_err(&pdev->dev, "failed to acquire USB PLL\n");
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300247 ret = PTR_ERR(usb_pll_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800248 goto fail_pll;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400249 }
250
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300251 ret = clk_enable(usb_pll_clk);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400252 if (ret < 0) {
Greg Kroah-Hartmanb6c227e2012-04-27 11:24:41 -0700253 dev_err(&pdev->dev, "failed to start USB PLL\n");
Libo Chenb3517d52013-05-10 14:22:42 +0800254 goto fail_pllen;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400255 }
256
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300257 ret = clk_set_rate(usb_pll_clk, 48000);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400258 if (ret < 0) {
Greg Kroah-Hartmanb6c227e2012-04-27 11:24:41 -0700259 dev_err(&pdev->dev, "failed to set USB clock rate\n");
Libo Chenb3517d52013-05-10 14:22:42 +0800260 goto fail_rate;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400261 }
262
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300263 /* Enable USB device clock */
264 usb_dev_clk = clk_get(&pdev->dev, "ck_usbd");
265 if (IS_ERR(usb_dev_clk)) {
266 dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n");
267 ret = PTR_ERR(usb_dev_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800268 goto fail_dev;
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300269 }
270
271 ret = clk_enable(usb_dev_clk);
272 if (ret < 0) {
273 dev_err(&pdev->dev, "failed to start USB DEV Clock\n");
Libo Chenb3517d52013-05-10 14:22:42 +0800274 goto fail_deven;
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300275 }
276
277 /* Enable USB otg clocks */
278 usb_otg_clk = clk_get(&pdev->dev, "ck_usb_otg");
279 if (IS_ERR(usb_otg_clk)) {
280 dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n");
Julia Lawall2ec15a62012-08-25 21:57:07 +0200281 ret = PTR_ERR(usb_otg_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800282 goto fail_otg;
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300283 }
284
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400285 __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL);
286
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300287 ret = clk_enable(usb_otg_clk);
288 if (ret < 0) {
289 dev_err(&pdev->dev, "failed to start USB DEV Clock\n");
Libo Chenb3517d52013-05-10 14:22:42 +0800290 goto fail_otgen;
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300291 }
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400292
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300293 isp1301_configure();
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400294
Roland Stiggea6a99cf2012-04-29 16:47:02 +0200295 hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400296 if (!hcd) {
Greg Kroah-Hartmanb6c227e2012-04-27 11:24:41 -0700297 dev_err(&pdev->dev, "Failed to allocate HC buffer\n");
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400298 ret = -ENOMEM;
Libo Chenb3517d52013-05-10 14:22:42 +0800299 goto fail_hcd;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400300 }
301
Roland Stiggea6a99cf2012-04-29 16:47:02 +0200302 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Thierry Reding148e1132013-01-21 11:09:22 +0100303 hcd->regs = devm_ioremap_resource(&pdev->dev, res);
304 if (IS_ERR(hcd->regs)) {
305 ret = PTR_ERR(hcd->regs);
Libo Chenb3517d52013-05-10 14:22:42 +0800306 goto fail_resource;
Roland Stiggea6a99cf2012-04-29 16:47:02 +0200307 }
308 hcd->rsrc_start = res->start;
309 hcd->rsrc_len = resource_size(res);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400310
311 irq = platform_get_irq(pdev, 0);
312 if (irq < 0) {
313 ret = -ENXIO;
Libo Chenb3517d52013-05-10 14:22:42 +0800314 goto fail_resource;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400315 }
316
Roland Stigge28643102012-03-12 22:54:50 +0100317 nxp_start_hc();
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400318 platform_set_drvdata(pdev, hcd);
319 ohci = hcd_to_ohci(hcd);
320 ohci_hcd_init(ohci);
321
322 dev_info(&pdev->dev, "at 0x%p, irq %d\n", hcd->regs, hcd->irq);
Yong Zhangb5dd18d2011-09-07 16:10:52 +0800323 ret = usb_add_hcd(hcd, irq, 0);
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400324 if (ret == 0)
325 return ret;
326
Roland Stigge28643102012-03-12 22:54:50 +0100327 nxp_stop_hc();
Libo Chenb3517d52013-05-10 14:22:42 +0800328fail_resource:
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400329 usb_put_hcd(hcd);
Libo Chenb3517d52013-05-10 14:22:42 +0800330fail_hcd:
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300331 clk_disable(usb_otg_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800332fail_otgen:
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300333 clk_put(usb_otg_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800334fail_otg:
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300335 clk_disable(usb_dev_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800336fail_deven:
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300337 clk_put(usb_dev_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800338fail_dev:
339fail_rate:
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300340 clk_disable(usb_pll_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800341fail_pllen:
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300342 clk_put(usb_pll_clk);
Libo Chenb3517d52013-05-10 14:22:42 +0800343fail_pll:
344fail_disable:
Jean Delvare3a407e72008-11-13 18:57:53 +0100345 isp1301_i2c_client = NULL;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400346 return ret;
347}
348
Roland Stigge28643102012-03-12 22:54:50 +0100349static int usb_hcd_nxp_remove(struct platform_device *pdev)
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400350{
351 struct usb_hcd *hcd = platform_get_drvdata(pdev);
352
353 usb_remove_hcd(hcd);
Roland Stigge28643102012-03-12 22:54:50 +0100354 nxp_stop_hc();
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400355 usb_put_hcd(hcd);
Alexandre Pereira da Silva78091dc2012-06-20 09:02:23 -0300356 clk_disable(usb_pll_clk);
357 clk_put(usb_pll_clk);
358 clk_disable(usb_dev_clk);
359 clk_put(usb_dev_clk);
Luotao Fu8740cc72010-02-19 15:42:00 +0100360 i2c_unregister_device(isp1301_i2c_client);
Jean Delvare3a407e72008-11-13 18:57:53 +0100361 isp1301_i2c_client = NULL;
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400362
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400363 return 0;
364}
365
Kay Sieversf4fce612008-04-10 21:29:22 -0700366/* work with hotplug and coldplug */
367MODULE_ALIAS("platform:usb-ohci");
368
Roland Stigge2265efe2012-04-29 16:47:03 +0200369#ifdef CONFIG_OF
370static const struct of_device_id usb_hcd_nxp_match[] = {
371 { .compatible = "nxp,ohci-nxp" },
372 {},
373};
374MODULE_DEVICE_TABLE(of, usb_hcd_nxp_match);
375#endif
376
Roland Stigge28643102012-03-12 22:54:50 +0100377static struct platform_driver usb_hcd_nxp_driver = {
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400378 .driver = {
379 .name = "usb-ohci",
Kay Sieversf4fce612008-04-10 21:29:22 -0700380 .owner = THIS_MODULE,
Roland Stigge2265efe2012-04-29 16:47:03 +0200381 .of_match_table = of_match_ptr(usb_hcd_nxp_match),
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400382 },
Roland Stigge28643102012-03-12 22:54:50 +0100383 .probe = usb_hcd_nxp_probe,
384 .remove = usb_hcd_nxp_remove,
Vitaly Wool60bbfc82006-06-29 18:28:18 +0400385};
386