blob: c134989052f5e85968621db791ed21c49a3467f6 [file] [log] [blame]
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +05301/*
2 * omap-usb2.c - USB PHY, talking to musb controller in OMAP.
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * Author: Kishon Vijay Abraham I <kishon@ti.com>
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 */
18
19#include <linux/module.h>
20#include <linux/platform_device.h>
21#include <linux/slab.h>
22#include <linux/of.h>
23#include <linux/io.h>
Kishon Vijay Abraham I6284be22014-03-03 17:08:14 +053024#include <linux/phy/omap_usb.h>
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053025#include <linux/usb/phy_companion.h>
26#include <linux/clk.h>
27#include <linux/err.h>
28#include <linux/pm_runtime.h>
29#include <linux/delay.h>
Kishon Vijay Abraham I14da6992014-03-06 16:38:37 +020030#include <linux/phy/omap_control_phy.h>
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +053031#include <linux/phy/phy.h>
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +053032#include <linux/mfd/syscon.h>
33#include <linux/regmap.h>
Roger Quadros478b6c72013-10-03 18:12:32 +030034#include <linux/of_platform.h>
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053035
Austin Beam7e472402014-03-06 18:11:53 +053036#define USB2PHY_DISCON_BYP_LATCH (1 << 31)
37#define USB2PHY_ANA_CONFIG1 0x4c
38
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053039/**
40 * omap_usb2_set_comparator - links the comparator present in the sytem with
41 * this phy
42 * @comparator - the companion phy(comparator) for this phy
43 *
44 * The phy companion driver should call this API passing the phy_companion
45 * filled with set_vbus and start_srp to be used by usb phy.
46 *
47 * For use by phy companion driver
48 */
49int omap_usb2_set_comparator(struct phy_companion *comparator)
50{
51 struct omap_usb *phy;
52 struct usb_phy *x = usb_get_phy(USB_PHY_TYPE_USB2);
53
54 if (IS_ERR(x))
55 return -ENODEV;
56
57 phy = phy_to_omapusb(x);
58 phy->comparator = comparator;
59 return 0;
60}
61EXPORT_SYMBOL_GPL(omap_usb2_set_comparator);
62
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053063static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)
64{
Antoine Tenart19c1eac2014-10-30 18:41:14 +010065 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053066
67 if (!phy->comparator)
68 return -ENODEV;
69
70 return phy->comparator->set_vbus(phy->comparator, enabled);
71}
72
73static int omap_usb_start_srp(struct usb_otg *otg)
74{
Antoine Tenart19c1eac2014-10-30 18:41:14 +010075 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053076
77 if (!phy->comparator)
78 return -ENODEV;
79
80 return phy->comparator->start_srp(phy->comparator);
81}
82
83static int omap_usb_set_host(struct usb_otg *otg, struct usb_bus *host)
84{
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053085 otg->host = host;
86 if (!host)
Antoine Tenarte47d9252014-10-30 18:41:13 +010087 otg->state = OTG_STATE_UNDEFINED;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053088
89 return 0;
90}
91
92static int omap_usb_set_peripheral(struct usb_otg *otg,
93 struct usb_gadget *gadget)
94{
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053095 otg->gadget = gadget;
96 if (!gadget)
Antoine Tenarte47d9252014-10-30 18:41:13 +010097 otg->state = OTG_STATE_UNDEFINED;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +053098
99 return 0;
100}
101
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530102static int omap_usb_phy_power(struct omap_usb *phy, int on)
103{
104 u32 val;
105 int ret;
106
107 if (!phy->syscon_phy_power) {
108 omap_control_phy_power(phy->control_dev, on);
109 return 0;
110 }
111
112 if (on)
113 val = phy->power_on;
114 else
115 val = phy->power_off;
116
117 ret = regmap_update_bits(phy->syscon_phy_power, phy->power_reg,
118 phy->mask, val);
119 return ret;
120}
121
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530122static int omap_usb_power_off(struct phy *x)
123{
124 struct omap_usb *phy = phy_get_drvdata(x);
125
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530126 return omap_usb_phy_power(phy, false);
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530127}
128
129static int omap_usb_power_on(struct phy *x)
130{
131 struct omap_usb *phy = phy_get_drvdata(x);
132
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530133 return omap_usb_phy_power(phy, true);
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530134}
135
Austin Beam7e472402014-03-06 18:11:53 +0530136static int omap_usb_init(struct phy *x)
137{
138 struct omap_usb *phy = phy_get_drvdata(x);
139 u32 val;
140
141 if (phy->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) {
142 /*
143 *
144 * Reduce the sensitivity of internal PHY by enabling the
145 * DISCON_BYP_LATCH of the USB2PHY_ANA_CONFIG1 register. This
146 * resolves issues with certain devices which can otherwise
147 * be prone to false disconnects.
148 *
149 */
150 val = omap_usb_readl(phy->phy_base, USB2PHY_ANA_CONFIG1);
151 val |= USB2PHY_DISCON_BYP_LATCH;
152 omap_usb_writel(phy->phy_base, USB2PHY_ANA_CONFIG1, val);
153 }
154
155 return 0;
156}
157
Axel Lin4a9e5ca2015-07-15 15:33:51 +0800158static const struct phy_ops ops = {
Austin Beam7e472402014-03-06 18:11:53 +0530159 .init = omap_usb_init,
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530160 .power_on = omap_usb_power_on,
161 .power_off = omap_usb_power_off,
162 .owner = THIS_MODULE,
163};
164
George Cherian09a01682014-03-06 18:11:52 +0530165static const struct usb_phy_data omap_usb2_data = {
166 .label = "omap_usb2",
167 .flags = OMAP_USB2_HAS_START_SRP | OMAP_USB2_HAS_SET_VBUS,
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530168 .mask = OMAP_DEV_PHY_PD,
169 .power_off = OMAP_DEV_PHY_PD,
George Cherian09a01682014-03-06 18:11:52 +0530170};
171
George Cheriandb68e802014-03-06 18:11:54 +0530172static const struct usb_phy_data omap5_usb2_data = {
173 .label = "omap5_usb2",
174 .flags = 0,
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530175 .mask = OMAP_DEV_PHY_PD,
176 .power_off = OMAP_DEV_PHY_PD,
George Cheriandb68e802014-03-06 18:11:54 +0530177};
178
Austin Beam7e472402014-03-06 18:11:53 +0530179static const struct usb_phy_data dra7x_usb2_data = {
180 .label = "dra7x_usb2",
181 .flags = OMAP_USB2_CALIBRATE_FALSE_DISCONNECT,
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530182 .mask = OMAP_DEV_PHY_PD,
183 .power_off = OMAP_DEV_PHY_PD,
184};
185
186static const struct usb_phy_data dra7x_usb2_phy2_data = {
187 .label = "dra7x_usb2_phy2",
188 .flags = OMAP_USB2_CALIBRATE_FALSE_DISCONNECT,
189 .mask = OMAP_USB2_PHY_PD,
190 .power_off = OMAP_USB2_PHY_PD,
Austin Beam7e472402014-03-06 18:11:53 +0530191};
192
George Cherian09a01682014-03-06 18:11:52 +0530193static const struct usb_phy_data am437x_usb2_data = {
194 .label = "am437x_usb2",
195 .flags = 0,
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530196 .mask = AM437X_USB2_PHY_PD | AM437X_USB2_OTG_PD |
197 AM437X_USB2_OTGVDET_EN | AM437X_USB2_OTGSESSEND_EN,
198 .power_on = AM437X_USB2_OTGVDET_EN | AM437X_USB2_OTGSESSEND_EN,
199 .power_off = AM437X_USB2_PHY_PD | AM437X_USB2_OTG_PD,
George Cherian09a01682014-03-06 18:11:52 +0530200};
201
202static const struct of_device_id omap_usb2_id_table[] = {
203 {
204 .compatible = "ti,omap-usb2",
205 .data = &omap_usb2_data,
206 },
207 {
George Cheriandb68e802014-03-06 18:11:54 +0530208 .compatible = "ti,omap5-usb2",
209 .data = &omap5_usb2_data,
210 },
211 {
Austin Beam7e472402014-03-06 18:11:53 +0530212 .compatible = "ti,dra7x-usb2",
213 .data = &dra7x_usb2_data,
214 },
215 {
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530216 .compatible = "ti,dra7x-usb2-phy2",
217 .data = &dra7x_usb2_phy2_data,
218 },
219 {
George Cherian09a01682014-03-06 18:11:52 +0530220 .compatible = "ti,am437x-usb2",
221 .data = &am437x_usb2_data,
222 },
223 {},
224};
225MODULE_DEVICE_TABLE(of, omap_usb2_id_table);
George Cherian09a01682014-03-06 18:11:52 +0530226
Bill Pemberton41ac7b32012-11-19 13:21:48 -0500227static int omap_usb2_probe(struct platform_device *pdev)
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530228{
Roger Quadros478b6c72013-10-03 18:12:32 +0300229 struct omap_usb *phy;
230 struct phy *generic_phy;
Austin Beam7e472402014-03-06 18:11:53 +0530231 struct resource *res;
Roger Quadros478b6c72013-10-03 18:12:32 +0300232 struct phy_provider *phy_provider;
233 struct usb_otg *otg;
234 struct device_node *node = pdev->dev.of_node;
235 struct device_node *control_node;
236 struct platform_device *control_pdev;
George Cherian09a01682014-03-06 18:11:52 +0530237 const struct of_device_id *of_id;
238 struct usb_phy_data *phy_data;
Roger Quadros478b6c72013-10-03 18:12:32 +0300239
Axel Lin52a4a722015-03-05 18:20:07 +0800240 of_id = of_match_device(omap_usb2_id_table, &pdev->dev);
George Cherian09a01682014-03-06 18:11:52 +0530241
242 if (!of_id)
Roger Quadros478b6c72013-10-03 18:12:32 +0300243 return -EINVAL;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530244
George Cherian09a01682014-03-06 18:11:52 +0530245 phy_data = (struct usb_phy_data *)of_id->data;
246
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530247 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
Peter Griffin0b682532014-08-15 13:40:10 +0100248 if (!phy)
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530249 return -ENOMEM;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530250
251 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL);
Peter Griffin0b682532014-08-15 13:40:10 +0100252 if (!otg)
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530253 return -ENOMEM;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530254
255 phy->dev = &pdev->dev;
256
257 phy->phy.dev = phy->dev;
George Cherian09a01682014-03-06 18:11:52 +0530258 phy->phy.label = phy_data->label;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530259 phy->phy.otg = otg;
Kishon Vijay Abraham Ic11747f2013-01-25 08:03:24 +0530260 phy->phy.type = USB_PHY_TYPE_USB2;
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530261 phy->mask = phy_data->mask;
262 phy->power_on = phy_data->power_on;
263 phy->power_off = phy_data->power_off;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530264
Austin Beam7e472402014-03-06 18:11:53 +0530265 if (phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) {
266 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
267 phy->phy_base = devm_ioremap_resource(&pdev->dev, res);
Himangi Saraogi3df9fcd2014-07-10 11:55:00 +0530268 if (IS_ERR(phy->phy_base))
269 return PTR_ERR(phy->phy_base);
Austin Beam7e472402014-03-06 18:11:53 +0530270 phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT;
271 }
272
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530273 phy->syscon_phy_power = syscon_regmap_lookup_by_phandle(node,
274 "syscon-phy-power");
275 if (IS_ERR(phy->syscon_phy_power)) {
276 dev_dbg(&pdev->dev,
277 "can't get syscon-phy-power, using control device\n");
278 phy->syscon_phy_power = NULL;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530279
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530280 control_node = of_parse_phandle(node, "ctrl-module", 0);
281 if (!control_node) {
282 dev_err(&pdev->dev,
283 "Failed to get control device phandle\n");
284 return -EINVAL;
285 }
Roger Quadros478b6c72013-10-03 18:12:32 +0300286
Kishon Vijay Abraham I9955a7832015-12-21 14:24:13 +0530287 control_pdev = of_find_device_by_node(control_node);
288 if (!control_pdev) {
289 dev_err(&pdev->dev, "Failed to get control device\n");
290 return -EINVAL;
291 }
292 phy->control_dev = &control_pdev->dev;
293 } else {
294 if (of_property_read_u32_index(node,
295 "syscon-phy-power", 1,
296 &phy->power_reg)) {
297 dev_err(&pdev->dev,
298 "couldn't get power reg. offset\n");
299 return -EINVAL;
300 }
301 }
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530302
303 otg->set_host = omap_usb_set_host;
304 otg->set_peripheral = omap_usb_set_peripheral;
George Cherian09a01682014-03-06 18:11:52 +0530305 if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS)
306 otg->set_vbus = omap_usb_set_vbus;
307 if (phy_data->flags & OMAP_USB2_HAS_START_SRP)
308 otg->start_srp = omap_usb_start_srp;
Antoine Tenart19c1eac2014-10-30 18:41:14 +0100309 otg->usb_phy = &phy->phy;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530310
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530311 platform_set_drvdata(pdev, phy);
Oussama Ghorbelf20531a2014-11-04 11:47:06 +0530312 pm_runtime_enable(phy->dev);
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530313
Heikki Krogerusdbc98632014-11-19 17:28:21 +0200314 generic_phy = devm_phy_create(phy->dev, NULL, &ops);
Oussama Ghorbelf20531a2014-11-04 11:47:06 +0530315 if (IS_ERR(generic_phy)) {
316 pm_runtime_disable(phy->dev);
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530317 return PTR_ERR(generic_phy);
Oussama Ghorbelf20531a2014-11-04 11:47:06 +0530318 }
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530319
320 phy_set_drvdata(generic_phy, phy);
Kishon Vijay Abraham I86c574e2015-12-21 14:24:12 +0530321 omap_usb_power_off(generic_phy);
Kishon Vijay Abraham I5d93d1e2013-09-27 11:53:26 +0530322
Kishon Vijay Abraham I64fe1892014-02-17 14:29:25 +0530323 phy_provider = devm_of_phy_provider_register(phy->dev,
324 of_phy_simple_xlate);
Roger Quadroseb82a3d2014-07-10 11:55:03 +0530325 if (IS_ERR(phy_provider)) {
326 pm_runtime_disable(phy->dev);
Kishon Vijay Abraham I64fe1892014-02-17 14:29:25 +0530327 return PTR_ERR(phy_provider);
Roger Quadroseb82a3d2014-07-10 11:55:03 +0530328 }
Kishon Vijay Abraham I64fe1892014-02-17 14:29:25 +0530329
Roger Quadros9f1d8ed2014-05-05 12:54:40 +0300330 phy->wkupclk = devm_clk_get(phy->dev, "wkupclk");
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530331 if (IS_ERR(phy->wkupclk)) {
Roger Quadros9f1d8ed2014-05-05 12:54:40 +0300332 dev_warn(&pdev->dev, "unable to get wkupclk, trying old name\n");
333 phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k");
334 if (IS_ERR(phy->wkupclk)) {
335 dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n");
Kishon Vijay Abraham I4581f792015-05-04 22:07:33 +0530336 pm_runtime_disable(phy->dev);
Roger Quadros9f1d8ed2014-05-05 12:54:40 +0300337 return PTR_ERR(phy->wkupclk);
338 } else {
339 dev_warn(&pdev->dev,
340 "found usb_phy_cm_clk32k, please fix DTS\n");
341 }
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530342 }
343 clk_prepare(phy->wkupclk);
344
Roger Quadros9f1d8ed2014-05-05 12:54:40 +0300345 phy->optclk = devm_clk_get(phy->dev, "refclk");
346 if (IS_ERR(phy->optclk)) {
347 dev_dbg(&pdev->dev, "unable to get refclk, trying old name\n");
348 phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m");
349 if (IS_ERR(phy->optclk)) {
350 dev_dbg(&pdev->dev,
351 "unable to get usb_otg_ss_refclk960m\n");
352 } else {
353 dev_warn(&pdev->dev,
354 "found usb_otg_ss_refclk960m, please fix DTS\n");
355 }
Roger Quadros9f1d8ed2014-05-05 12:54:40 +0300356 }
Kishon Vijay Abraham I0c4c8bb2013-01-25 08:21:49 +0530357
Axel Linb1ff3232015-03-11 09:41:34 +0800358 if (!IS_ERR(phy->optclk))
359 clk_prepare(phy->optclk);
360
Kishon Vijay Abraham Ic11747f2013-01-25 08:03:24 +0530361 usb_add_phy_dev(&phy->phy);
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530362
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530363 return 0;
364}
365
Bill Pembertonfb4e98a2012-11-19 13:26:20 -0500366static int omap_usb2_remove(struct platform_device *pdev)
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530367{
368 struct omap_usb *phy = platform_get_drvdata(pdev);
369
370 clk_unprepare(phy->wkupclk);
Kishon Vijay Abraham I0c4c8bb2013-01-25 08:21:49 +0530371 if (!IS_ERR(phy->optclk))
372 clk_unprepare(phy->optclk);
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530373 usb_remove_phy(&phy->phy);
Roger Quadroseb82a3d2014-07-10 11:55:03 +0530374 pm_runtime_disable(phy->dev);
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530375
376 return 0;
377}
378
Rafael J. Wysocki7ba37052014-12-13 00:42:12 +0100379#ifdef CONFIG_PM
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530380
381static int omap_usb2_runtime_suspend(struct device *dev)
382{
383 struct platform_device *pdev = to_platform_device(dev);
384 struct omap_usb *phy = platform_get_drvdata(pdev);
385
386 clk_disable(phy->wkupclk);
Kishon Vijay Abraham I0c4c8bb2013-01-25 08:21:49 +0530387 if (!IS_ERR(phy->optclk))
388 clk_disable(phy->optclk);
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530389
390 return 0;
391}
392
393static int omap_usb2_runtime_resume(struct device *dev)
394{
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530395 struct platform_device *pdev = to_platform_device(dev);
396 struct omap_usb *phy = platform_get_drvdata(pdev);
Dan Carpenter0f827682013-08-21 11:41:22 +0300397 int ret;
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530398
399 ret = clk_enable(phy->wkupclk);
Kishon Vijay Abraham I0c4c8bb2013-01-25 08:21:49 +0530400 if (ret < 0) {
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530401 dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret);
Kishon Vijay Abraham I0c4c8bb2013-01-25 08:21:49 +0530402 goto err0;
403 }
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530404
Kishon Vijay Abraham I0c4c8bb2013-01-25 08:21:49 +0530405 if (!IS_ERR(phy->optclk)) {
406 ret = clk_enable(phy->optclk);
407 if (ret < 0) {
408 dev_err(phy->dev, "Failed to enable optclk %d\n", ret);
409 goto err1;
410 }
411 }
412
413 return 0;
414
415err1:
416 clk_disable(phy->wkupclk);
417
418err0:
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530419 return ret;
420}
421
422static const struct dev_pm_ops omap_usb2_pm_ops = {
423 SET_RUNTIME_PM_OPS(omap_usb2_runtime_suspend, omap_usb2_runtime_resume,
424 NULL)
425};
426
427#define DEV_PM_OPS (&omap_usb2_pm_ops)
428#else
429#define DEV_PM_OPS NULL
430#endif
431
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530432static struct platform_driver omap_usb2_driver = {
433 .probe = omap_usb2_probe,
Bill Pemberton76904172012-11-19 13:21:08 -0500434 .remove = omap_usb2_remove,
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530435 .driver = {
436 .name = "omap-usb2",
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530437 .pm = DEV_PM_OPS,
Axel Lin52a4a722015-03-05 18:20:07 +0800438 .of_match_table = omap_usb2_id_table,
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530439 },
440};
441
442module_platform_driver(omap_usb2_driver);
443
Axel Lindd64ad382015-03-07 00:01:21 +0800444MODULE_ALIAS("platform:omap_usb2");
Kishon Vijay Abraham I657b3062012-09-06 20:27:06 +0530445MODULE_AUTHOR("Texas Instruments Inc.");
446MODULE_DESCRIPTION("OMAP USB2 phy driver");
447MODULE_LICENSE("GPL v2");