Linux Audio

Check our new training course

Linux debugging, profiling, tracing and performance analysis training

Apr 14-17, 2025
Register
Loading...
v6.8
  1// SPDX-License-Identifier: GPL-2.0+
  2/*
  3 * Copyright (C) 2010 ST-Ericsson AB
  4 * Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
  5 *
  6 * Based on omap2430.c
  7 */
  8
  9#include <linux/module.h>
 10#include <linux/kernel.h>
 11#include <linux/clk.h>
 12#include <linux/err.h>
 13#include <linux/io.h>
 14#include <linux/of.h>
 15#include <linux/platform_device.h>
 16#include <linux/usb/musb-ux500.h>
 17
 18#include "musb_core.h"
 19
 20static const struct musb_hdrc_config ux500_musb_hdrc_config = {
 21	.multipoint	= true,
 22	.dyn_fifo	= true,
 23	.num_eps	= 16,
 24	.ram_bits	= 16,
 25};
 26
 27struct ux500_glue {
 28	struct device		*dev;
 29	struct platform_device	*musb;
 30	struct clk		*clk;
 31};
 32#define glue_to_musb(g)	platform_get_drvdata(g->musb)
 33
 34static void ux500_musb_set_vbus(struct musb *musb, int is_on)
 35{
 36	u8            devctl;
 37	unsigned long timeout = jiffies + msecs_to_jiffies(1000);
 38	/* HDRC controls CPEN, but beware current surges during device
 39	 * connect.  They can trigger transient overcurrent conditions
 40	 * that must be ignored.
 41	 */
 42
 43	devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
 44
 45	if (is_on) {
 46		if (musb->xceiv->otg->state == OTG_STATE_A_IDLE) {
 47			/* start the session */
 48			devctl |= MUSB_DEVCTL_SESSION;
 49			musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
 50			/*
 51			 * Wait for the musb to set as A device to enable the
 52			 * VBUS
 53			 */
 54			while (musb_readb(musb->mregs, MUSB_DEVCTL) & 0x80) {
 55
 56				if (time_after(jiffies, timeout)) {
 57					dev_err(musb->controller,
 58					"configured as A device timeout");
 59					break;
 60				}
 61			}
 62
 63		} else {
 64			musb->is_active = 1;
 
 65			musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE;
 66			devctl |= MUSB_DEVCTL_SESSION;
 67			MUSB_HST_MODE(musb);
 68		}
 69	} else {
 70		musb->is_active = 0;
 71
 72		/* NOTE: we're skipping A_WAIT_VFALL -> A_IDLE and jumping
 73		 * right to B_IDLE...
 74		 */
 
 75		devctl &= ~MUSB_DEVCTL_SESSION;
 76		MUSB_DEV_MODE(musb);
 77	}
 78	musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
 79
 80	/*
 81	 * Devctl values will be updated after vbus goes below
 82	 * session_valid. The time taken depends on the capacitance
 83	 * on VBUS line. The max discharge time can be upto 1 sec
 84	 * as per the spec. Typically on our platform, it is 200ms
 85	 */
 86	if (!is_on)
 87		mdelay(200);
 88
 89	dev_dbg(musb->controller, "VBUS %s, devctl %02x\n",
 90		usb_otg_state_string(musb->xceiv->otg->state),
 91		musb_readb(musb->mregs, MUSB_DEVCTL));
 92}
 93
 94static int musb_otg_notifications(struct notifier_block *nb,
 95		unsigned long event, void *unused)
 96{
 97	struct musb *musb = container_of(nb, struct musb, nb);
 98
 99	dev_dbg(musb->controller, "musb_otg_notifications %ld %s\n",
100			event, usb_otg_state_string(musb->xceiv->otg->state));
101
102	switch (event) {
103	case UX500_MUSB_ID:
104		dev_dbg(musb->controller, "ID GND\n");
105		ux500_musb_set_vbus(musb, 1);
106		break;
107	case UX500_MUSB_VBUS:
108		dev_dbg(musb->controller, "VBUS Connect\n");
109		break;
110	case UX500_MUSB_NONE:
111		dev_dbg(musb->controller, "VBUS Disconnect\n");
112		if (is_host_active(musb))
113			ux500_musb_set_vbus(musb, 0);
114		else
115			musb->xceiv->otg->state = OTG_STATE_B_IDLE;
116		break;
117	default:
118		dev_dbg(musb->controller, "ID float\n");
119		return NOTIFY_DONE;
120	}
121	return NOTIFY_OK;
122}
123
124static irqreturn_t ux500_musb_interrupt(int irq, void *__hci)
125{
126	unsigned long   flags;
127	irqreturn_t     retval = IRQ_NONE;
128	struct musb     *musb = __hci;
129
130	spin_lock_irqsave(&musb->lock, flags);
131
132	musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
133	musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
134	musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
135
136	if (musb->int_usb || musb->int_tx || musb->int_rx)
137		retval = musb_interrupt(musb);
138
139	spin_unlock_irqrestore(&musb->lock, flags);
140
141	return retval;
142}
143
144static int ux500_musb_init(struct musb *musb)
145{
146	int status;
147
148	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
149	if (IS_ERR_OR_NULL(musb->xceiv)) {
150		pr_err("HS USB OTG: no transceiver configured\n");
151		return -EPROBE_DEFER;
152	}
153
154	musb->nb.notifier_call = musb_otg_notifications;
155	status = usb_register_notifier(musb->xceiv, &musb->nb);
156	if (status < 0) {
157		dev_dbg(musb->controller, "notification register failed\n");
158		return status;
159	}
160
161	musb->isr = ux500_musb_interrupt;
162
163	return 0;
164}
165
166static int ux500_musb_exit(struct musb *musb)
167{
168	usb_unregister_notifier(musb->xceiv, &musb->nb);
169
170	usb_put_phy(musb->xceiv);
171
172	return 0;
173}
174
175static const struct musb_platform_ops ux500_ops = {
176	.quirks		= MUSB_DMA_UX500 | MUSB_INDEXED_EP,
177#ifdef CONFIG_USB_UX500_DMA
178	.dma_init	= ux500_dma_controller_create,
179	.dma_exit	= ux500_dma_controller_destroy,
180#endif
181	.init		= ux500_musb_init,
182	.exit		= ux500_musb_exit,
183	.fifo_mode	= 5,
184
185	.set_vbus	= ux500_musb_set_vbus,
186};
187
188static struct musb_hdrc_platform_data *
189ux500_of_probe(struct platform_device *pdev, struct device_node *np)
190{
191	struct musb_hdrc_platform_data *pdata;
192	const char *mode;
193	int strlen;
194
195	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
196	if (!pdata)
197		return NULL;
198
199	mode = of_get_property(np, "dr_mode", &strlen);
200	if (!mode) {
201		dev_err(&pdev->dev, "No 'dr_mode' property found\n");
202		return NULL;
203	}
204
205	if (strlen > 0) {
206		if (!strcmp(mode, "host"))
207			pdata->mode = MUSB_HOST;
208		if (!strcmp(mode, "otg"))
209			pdata->mode = MUSB_OTG;
210		if (!strcmp(mode, "peripheral"))
211			pdata->mode = MUSB_PERIPHERAL;
212	}
213
214	return pdata;
215}
216
217static int ux500_probe(struct platform_device *pdev)
218{
 
219	struct musb_hdrc_platform_data	*pdata = dev_get_platdata(&pdev->dev);
220	struct device_node		*np = pdev->dev.of_node;
221	struct platform_device		*musb;
222	struct ux500_glue		*glue;
223	struct clk			*clk;
224	int				ret = -ENOMEM;
225
226	if (!pdata) {
227		if (np) {
228			pdata = ux500_of_probe(pdev, np);
229			if (!pdata)
230				goto err0;
231
232			pdev->dev.platform_data = pdata;
233		} else {
234			dev_err(&pdev->dev, "no pdata or device tree found\n");
235			goto err0;
236		}
237	}
238
239	glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
240	if (!glue)
241		goto err0;
242
243	musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
244	if (!musb) {
245		dev_err(&pdev->dev, "failed to allocate musb device\n");
246		goto err0;
247	}
248
249	clk = devm_clk_get(&pdev->dev, NULL);
250	if (IS_ERR(clk)) {
251		dev_err(&pdev->dev, "failed to get clock\n");
252		ret = PTR_ERR(clk);
253		goto err1;
254	}
255
256	ret = clk_prepare_enable(clk);
257	if (ret) {
258		dev_err(&pdev->dev, "failed to enable clock\n");
259		goto err1;
260	}
261
262	musb->dev.parent		= &pdev->dev;
263	musb->dev.dma_mask		= &pdev->dev.coherent_dma_mask;
264	musb->dev.coherent_dma_mask	= pdev->dev.coherent_dma_mask;
265	device_set_of_node_from_dev(&musb->dev, &pdev->dev);
266
267	glue->dev			= &pdev->dev;
268	glue->musb			= musb;
269	glue->clk			= clk;
270
271	pdata->platform_ops		= &ux500_ops;
272	pdata->config 			= &ux500_musb_hdrc_config;
273
274	platform_set_drvdata(pdev, glue);
275
276	ret = platform_device_add_resources(musb, pdev->resource, pdev->num_resources);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277	if (ret) {
278		dev_err(&pdev->dev, "failed to add resources\n");
279		goto err2;
280	}
281
282	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
283	if (ret) {
284		dev_err(&pdev->dev, "failed to add platform_data\n");
285		goto err2;
286	}
287
288	ret = platform_device_add(musb);
289	if (ret) {
290		dev_err(&pdev->dev, "failed to register musb device\n");
291		goto err2;
292	}
293
294	return 0;
295
296err2:
297	clk_disable_unprepare(clk);
298
299err1:
300	platform_device_put(musb);
301
302err0:
303	return ret;
304}
305
306static void ux500_remove(struct platform_device *pdev)
307{
308	struct ux500_glue	*glue = platform_get_drvdata(pdev);
309
310	platform_device_unregister(glue->musb);
311	clk_disable_unprepare(glue->clk);
 
 
312}
313
314#ifdef CONFIG_PM_SLEEP
315static int ux500_suspend(struct device *dev)
316{
317	struct ux500_glue	*glue = dev_get_drvdata(dev);
318	struct musb		*musb = glue_to_musb(glue);
319
320	if (musb)
321		usb_phy_set_suspend(musb->xceiv, 1);
322
323	clk_disable_unprepare(glue->clk);
324
325	return 0;
326}
327
328static int ux500_resume(struct device *dev)
329{
330	struct ux500_glue	*glue = dev_get_drvdata(dev);
331	struct musb		*musb = glue_to_musb(glue);
332	int			ret;
333
334	ret = clk_prepare_enable(glue->clk);
335	if (ret) {
336		dev_err(dev, "failed to enable clock\n");
337		return ret;
338	}
339
340	if (musb)
341		usb_phy_set_suspend(musb->xceiv, 0);
342
343	return 0;
344}
345#endif
346
347static SIMPLE_DEV_PM_OPS(ux500_pm_ops, ux500_suspend, ux500_resume);
348
349static const struct of_device_id ux500_match[] = {
350        { .compatible = "stericsson,db8500-musb", },
351        {}
352};
353
354MODULE_DEVICE_TABLE(of, ux500_match);
355
356static struct platform_driver ux500_driver = {
357	.probe		= ux500_probe,
358	.remove_new	= ux500_remove,
359	.driver		= {
360		.name	= "musb-ux500",
361		.pm	= &ux500_pm_ops,
362		.of_match_table = ux500_match,
363	},
364};
365
366MODULE_DESCRIPTION("UX500 MUSB Glue Layer");
367MODULE_AUTHOR("Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>");
368MODULE_LICENSE("GPL v2");
369module_platform_driver(ux500_driver);
v4.17
  1// SPDX-License-Identifier: GPL-2.0+
  2/*
  3 * Copyright (C) 2010 ST-Ericsson AB
  4 * Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
  5 *
  6 * Based on omap2430.c
  7 */
  8
  9#include <linux/module.h>
 10#include <linux/kernel.h>
 11#include <linux/clk.h>
 12#include <linux/err.h>
 13#include <linux/io.h>
 14#include <linux/of.h>
 15#include <linux/platform_device.h>
 16#include <linux/usb/musb-ux500.h>
 17
 18#include "musb_core.h"
 19
 20static const struct musb_hdrc_config ux500_musb_hdrc_config = {
 21	.multipoint	= true,
 22	.dyn_fifo	= true,
 23	.num_eps	= 16,
 24	.ram_bits	= 16,
 25};
 26
 27struct ux500_glue {
 28	struct device		*dev;
 29	struct platform_device	*musb;
 30	struct clk		*clk;
 31};
 32#define glue_to_musb(g)	platform_get_drvdata(g->musb)
 33
 34static void ux500_musb_set_vbus(struct musb *musb, int is_on)
 35{
 36	u8            devctl;
 37	unsigned long timeout = jiffies + msecs_to_jiffies(1000);
 38	/* HDRC controls CPEN, but beware current surges during device
 39	 * connect.  They can trigger transient overcurrent conditions
 40	 * that must be ignored.
 41	 */
 42
 43	devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
 44
 45	if (is_on) {
 46		if (musb->xceiv->otg->state == OTG_STATE_A_IDLE) {
 47			/* start the session */
 48			devctl |= MUSB_DEVCTL_SESSION;
 49			musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
 50			/*
 51			 * Wait for the musb to set as A device to enable the
 52			 * VBUS
 53			 */
 54			while (musb_readb(musb->mregs, MUSB_DEVCTL) & 0x80) {
 55
 56				if (time_after(jiffies, timeout)) {
 57					dev_err(musb->controller,
 58					"configured as A device timeout");
 59					break;
 60				}
 61			}
 62
 63		} else {
 64			musb->is_active = 1;
 65			musb->xceiv->otg->default_a = 1;
 66			musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE;
 67			devctl |= MUSB_DEVCTL_SESSION;
 68			MUSB_HST_MODE(musb);
 69		}
 70	} else {
 71		musb->is_active = 0;
 72
 73		/* NOTE: we're skipping A_WAIT_VFALL -> A_IDLE and jumping
 74		 * right to B_IDLE...
 75		 */
 76		musb->xceiv->otg->default_a = 0;
 77		devctl &= ~MUSB_DEVCTL_SESSION;
 78		MUSB_DEV_MODE(musb);
 79	}
 80	musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
 81
 82	/*
 83	 * Devctl values will be updated after vbus goes below
 84	 * session_valid. The time taken depends on the capacitance
 85	 * on VBUS line. The max discharge time can be upto 1 sec
 86	 * as per the spec. Typically on our platform, it is 200ms
 87	 */
 88	if (!is_on)
 89		mdelay(200);
 90
 91	dev_dbg(musb->controller, "VBUS %s, devctl %02x\n",
 92		usb_otg_state_string(musb->xceiv->otg->state),
 93		musb_readb(musb->mregs, MUSB_DEVCTL));
 94}
 95
 96static int musb_otg_notifications(struct notifier_block *nb,
 97		unsigned long event, void *unused)
 98{
 99	struct musb *musb = container_of(nb, struct musb, nb);
100
101	dev_dbg(musb->controller, "musb_otg_notifications %ld %s\n",
102			event, usb_otg_state_string(musb->xceiv->otg->state));
103
104	switch (event) {
105	case UX500_MUSB_ID:
106		dev_dbg(musb->controller, "ID GND\n");
107		ux500_musb_set_vbus(musb, 1);
108		break;
109	case UX500_MUSB_VBUS:
110		dev_dbg(musb->controller, "VBUS Connect\n");
111		break;
112	case UX500_MUSB_NONE:
113		dev_dbg(musb->controller, "VBUS Disconnect\n");
114		if (is_host_active(musb))
115			ux500_musb_set_vbus(musb, 0);
116		else
117			musb->xceiv->otg->state = OTG_STATE_B_IDLE;
118		break;
119	default:
120		dev_dbg(musb->controller, "ID float\n");
121		return NOTIFY_DONE;
122	}
123	return NOTIFY_OK;
124}
125
126static irqreturn_t ux500_musb_interrupt(int irq, void *__hci)
127{
128	unsigned long   flags;
129	irqreturn_t     retval = IRQ_NONE;
130	struct musb     *musb = __hci;
131
132	spin_lock_irqsave(&musb->lock, flags);
133
134	musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
135	musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
136	musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
137
138	if (musb->int_usb || musb->int_tx || musb->int_rx)
139		retval = musb_interrupt(musb);
140
141	spin_unlock_irqrestore(&musb->lock, flags);
142
143	return retval;
144}
145
146static int ux500_musb_init(struct musb *musb)
147{
148	int status;
149
150	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
151	if (IS_ERR_OR_NULL(musb->xceiv)) {
152		pr_err("HS USB OTG: no transceiver configured\n");
153		return -EPROBE_DEFER;
154	}
155
156	musb->nb.notifier_call = musb_otg_notifications;
157	status = usb_register_notifier(musb->xceiv, &musb->nb);
158	if (status < 0) {
159		dev_dbg(musb->controller, "notification register failed\n");
160		return status;
161	}
162
163	musb->isr = ux500_musb_interrupt;
164
165	return 0;
166}
167
168static int ux500_musb_exit(struct musb *musb)
169{
170	usb_unregister_notifier(musb->xceiv, &musb->nb);
171
172	usb_put_phy(musb->xceiv);
173
174	return 0;
175}
176
177static const struct musb_platform_ops ux500_ops = {
178	.quirks		= MUSB_DMA_UX500 | MUSB_INDEXED_EP,
179#ifdef CONFIG_USB_UX500_DMA
180	.dma_init	= ux500_dma_controller_create,
181	.dma_exit	= ux500_dma_controller_destroy,
182#endif
183	.init		= ux500_musb_init,
184	.exit		= ux500_musb_exit,
185	.fifo_mode	= 5,
186
187	.set_vbus	= ux500_musb_set_vbus,
188};
189
190static struct musb_hdrc_platform_data *
191ux500_of_probe(struct platform_device *pdev, struct device_node *np)
192{
193	struct musb_hdrc_platform_data *pdata;
194	const char *mode;
195	int strlen;
196
197	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
198	if (!pdata)
199		return NULL;
200
201	mode = of_get_property(np, "dr_mode", &strlen);
202	if (!mode) {
203		dev_err(&pdev->dev, "No 'dr_mode' property found\n");
204		return NULL;
205	}
206
207	if (strlen > 0) {
208		if (!strcmp(mode, "host"))
209			pdata->mode = MUSB_HOST;
210		if (!strcmp(mode, "otg"))
211			pdata->mode = MUSB_OTG;
212		if (!strcmp(mode, "peripheral"))
213			pdata->mode = MUSB_PERIPHERAL;
214	}
215
216	return pdata;
217}
218
219static int ux500_probe(struct platform_device *pdev)
220{
221	struct resource musb_resources[2];
222	struct musb_hdrc_platform_data	*pdata = dev_get_platdata(&pdev->dev);
223	struct device_node		*np = pdev->dev.of_node;
224	struct platform_device		*musb;
225	struct ux500_glue		*glue;
226	struct clk			*clk;
227	int				ret = -ENOMEM;
228
229	if (!pdata) {
230		if (np) {
231			pdata = ux500_of_probe(pdev, np);
232			if (!pdata)
233				goto err0;
234
235			pdev->dev.platform_data = pdata;
236		} else {
237			dev_err(&pdev->dev, "no pdata or device tree found\n");
238			goto err0;
239		}
240	}
241
242	glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
243	if (!glue)
244		goto err0;
245
246	musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
247	if (!musb) {
248		dev_err(&pdev->dev, "failed to allocate musb device\n");
249		goto err0;
250	}
251
252	clk = devm_clk_get(&pdev->dev, NULL);
253	if (IS_ERR(clk)) {
254		dev_err(&pdev->dev, "failed to get clock\n");
255		ret = PTR_ERR(clk);
256		goto err1;
257	}
258
259	ret = clk_prepare_enable(clk);
260	if (ret) {
261		dev_err(&pdev->dev, "failed to enable clock\n");
262		goto err1;
263	}
264
265	musb->dev.parent		= &pdev->dev;
266	musb->dev.dma_mask		= &pdev->dev.coherent_dma_mask;
267	musb->dev.coherent_dma_mask	= pdev->dev.coherent_dma_mask;
 
268
269	glue->dev			= &pdev->dev;
270	glue->musb			= musb;
271	glue->clk			= clk;
272
273	pdata->platform_ops		= &ux500_ops;
274	pdata->config 			= &ux500_musb_hdrc_config;
275
276	platform_set_drvdata(pdev, glue);
277
278	memset(musb_resources, 0x00, sizeof(*musb_resources) *
279			ARRAY_SIZE(musb_resources));
280
281	musb_resources[0].name = pdev->resource[0].name;
282	musb_resources[0].start = pdev->resource[0].start;
283	musb_resources[0].end = pdev->resource[0].end;
284	musb_resources[0].flags = pdev->resource[0].flags;
285
286	musb_resources[1].name = pdev->resource[1].name;
287	musb_resources[1].start = pdev->resource[1].start;
288	musb_resources[1].end = pdev->resource[1].end;
289	musb_resources[1].flags = pdev->resource[1].flags;
290
291	ret = platform_device_add_resources(musb, musb_resources,
292			ARRAY_SIZE(musb_resources));
293	if (ret) {
294		dev_err(&pdev->dev, "failed to add resources\n");
295		goto err2;
296	}
297
298	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
299	if (ret) {
300		dev_err(&pdev->dev, "failed to add platform_data\n");
301		goto err2;
302	}
303
304	ret = platform_device_add(musb);
305	if (ret) {
306		dev_err(&pdev->dev, "failed to register musb device\n");
307		goto err2;
308	}
309
310	return 0;
311
312err2:
313	clk_disable_unprepare(clk);
314
315err1:
316	platform_device_put(musb);
317
318err0:
319	return ret;
320}
321
322static int ux500_remove(struct platform_device *pdev)
323{
324	struct ux500_glue	*glue = platform_get_drvdata(pdev);
325
326	platform_device_unregister(glue->musb);
327	clk_disable_unprepare(glue->clk);
328
329	return 0;
330}
331
332#ifdef CONFIG_PM_SLEEP
333static int ux500_suspend(struct device *dev)
334{
335	struct ux500_glue	*glue = dev_get_drvdata(dev);
336	struct musb		*musb = glue_to_musb(glue);
337
338	if (musb)
339		usb_phy_set_suspend(musb->xceiv, 1);
340
341	clk_disable_unprepare(glue->clk);
342
343	return 0;
344}
345
346static int ux500_resume(struct device *dev)
347{
348	struct ux500_glue	*glue = dev_get_drvdata(dev);
349	struct musb		*musb = glue_to_musb(glue);
350	int			ret;
351
352	ret = clk_prepare_enable(glue->clk);
353	if (ret) {
354		dev_err(dev, "failed to enable clock\n");
355		return ret;
356	}
357
358	if (musb)
359		usb_phy_set_suspend(musb->xceiv, 0);
360
361	return 0;
362}
363#endif
364
365static SIMPLE_DEV_PM_OPS(ux500_pm_ops, ux500_suspend, ux500_resume);
366
367static const struct of_device_id ux500_match[] = {
368        { .compatible = "stericsson,db8500-musb", },
369        {}
370};
371
372MODULE_DEVICE_TABLE(of, ux500_match);
373
374static struct platform_driver ux500_driver = {
375	.probe		= ux500_probe,
376	.remove		= ux500_remove,
377	.driver		= {
378		.name	= "musb-ux500",
379		.pm	= &ux500_pm_ops,
380		.of_match_table = ux500_match,
381	},
382};
383
384MODULE_DESCRIPTION("UX500 MUSB Glue Layer");
385MODULE_AUTHOR("Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>");
386MODULE_LICENSE("GPL v2");
387module_platform_driver(ux500_driver);