9162b61ddb95dbacd91cf8c6dd50ccd2ffdaa2df
[linux-2.6-microblaze.git] / drivers / phy / motorola / phy-mapphone-mdm6600.c
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Motorola Mapphone MDM6600 modem GPIO controlled USB PHY driver
4  * Copyright (C) 2018 Tony Lindgren <tony@atomide.com>
5  */
6
7 #include <linux/delay.h>
8 #include <linux/err.h>
9 #include <linux/io.h>
10 #include <linux/interrupt.h>
11 #include <linux/module.h>
12 #include <linux/of.h>
13 #include <linux/platform_device.h>
14 #include <linux/slab.h>
15
16 #include <linux/gpio/consumer.h>
17 #include <linux/of_platform.h>
18 #include <linux/phy/phy.h>
19
20 #define PHY_MDM6600_PHY_DELAY_MS        4000    /* PHY enable 2.2s to 3.5s */
21 #define PHY_MDM6600_ENABLED_DELAY_MS    8000    /* 8s more total for MDM6600 */
22 #define MDM6600_MODEM_IDLE_DELAY_MS     1000    /* modem after USB suspend */
23 #define MDM6600_MODEM_WAKE_DELAY_MS     200     /* modem response after idle */
24
25 enum phy_mdm6600_ctrl_lines {
26         PHY_MDM6600_ENABLE,                     /* USB PHY enable */
27         PHY_MDM6600_POWER,                      /* Device power */
28         PHY_MDM6600_RESET,                      /* Device reset */
29         PHY_MDM6600_NR_CTRL_LINES,
30 };
31
32 enum phy_mdm6600_bootmode_lines {
33         PHY_MDM6600_MODE0,                      /* out USB mode0 and OOB wake */
34         PHY_MDM6600_MODE1,                      /* out USB mode1, in OOB wake */
35         PHY_MDM6600_NR_MODE_LINES,
36 };
37
38 enum phy_mdm6600_cmd_lines {
39         PHY_MDM6600_CMD0,
40         PHY_MDM6600_CMD1,
41         PHY_MDM6600_CMD2,
42         PHY_MDM6600_NR_CMD_LINES,
43 };
44
45 enum phy_mdm6600_status_lines {
46         PHY_MDM6600_STATUS0,
47         PHY_MDM6600_STATUS1,
48         PHY_MDM6600_STATUS2,
49         PHY_MDM6600_NR_STATUS_LINES,
50 };
51
52 /*
53  * MDM6600 command codes. These are based on Motorola Mapphone Linux
54  * kernel tree.
55  */
56 enum phy_mdm6600_cmd {
57         PHY_MDM6600_CMD_BP_PANIC_ACK,
58         PHY_MDM6600_CMD_DATA_ONLY_BYPASS,       /* Reroute USB to CPCAP PHY */
59         PHY_MDM6600_CMD_FULL_BYPASS,            /* Reroute USB to CPCAP PHY */
60         PHY_MDM6600_CMD_NO_BYPASS,              /* Request normal USB mode */
61         PHY_MDM6600_CMD_BP_SHUTDOWN_REQ,        /* Request device power off */
62         PHY_MDM6600_CMD_BP_UNKNOWN_5,
63         PHY_MDM6600_CMD_BP_UNKNOWN_6,
64         PHY_MDM6600_CMD_UNDEFINED,
65 };
66
67 /*
68  * MDM6600 status codes. These are based on Motorola Mapphone Linux
69  * kernel tree.
70  */
71 enum phy_mdm6600_status {
72         PHY_MDM6600_STATUS_PANIC,               /* Seems to be really off */
73         PHY_MDM6600_STATUS_PANIC_BUSY_WAIT,
74         PHY_MDM6600_STATUS_QC_DLOAD,
75         PHY_MDM6600_STATUS_RAM_DOWNLOADER,      /* MDM6600 USB flashing mode */
76         PHY_MDM6600_STATUS_PHONE_CODE_AWAKE,    /* MDM6600 normal USB mode */
77         PHY_MDM6600_STATUS_PHONE_CODE_ASLEEP,
78         PHY_MDM6600_STATUS_SHUTDOWN_ACK,
79         PHY_MDM6600_STATUS_UNDEFINED,
80 };
81
82 static const char * const
83 phy_mdm6600_status_name[] = {
84         "off", "busy", "qc_dl", "ram_dl", "awake",
85         "asleep", "shutdown", "undefined",
86 };
87
88 struct phy_mdm6600 {
89         struct device *dev;
90         struct phy *generic_phy;
91         struct phy_provider *phy_provider;
92         struct gpio_desc *ctrl_gpios[PHY_MDM6600_NR_CTRL_LINES];
93         struct gpio_descs *mode_gpios;
94         struct gpio_descs *status_gpios;
95         struct gpio_descs *cmd_gpios;
96         struct delayed_work bootup_work;
97         struct delayed_work status_work;
98         struct delayed_work modem_wake_work;
99         struct completion ack;
100         bool enabled;                           /* mdm6600 phy enabled */
101         bool running;                           /* mdm6600 boot done */
102         bool awake;                             /* mdm6600 respnds on n_gsm */
103         int status;
104 };
105
106 static int phy_mdm6600_init(struct phy *x)
107 {
108         struct phy_mdm6600 *ddata = phy_get_drvdata(x);
109         struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
110
111         if (!ddata->enabled)
112                 return -EPROBE_DEFER;
113
114         gpiod_set_value_cansleep(enable_gpio, 0);
115
116         return 0;
117 }
118
119 static int phy_mdm6600_power_on(struct phy *x)
120 {
121         struct phy_mdm6600 *ddata = phy_get_drvdata(x);
122         struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
123
124         if (!ddata->enabled)
125                 return -ENODEV;
126
127         gpiod_set_value_cansleep(enable_gpio, 1);
128
129         return 0;
130 }
131
132 static int phy_mdm6600_power_off(struct phy *x)
133 {
134         struct phy_mdm6600 *ddata = phy_get_drvdata(x);
135         struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
136
137         if (!ddata->enabled)
138                 return -ENODEV;
139
140         gpiod_set_value_cansleep(enable_gpio, 0);
141
142         return 0;
143 }
144
145 static const struct phy_ops gpio_usb_ops = {
146         .init = phy_mdm6600_init,
147         .power_on = phy_mdm6600_power_on,
148         .power_off = phy_mdm6600_power_off,
149         .owner = THIS_MODULE,
150 };
151
152 /**
153  * phy_mdm6600_cmd() - send a command request to mdm6600
154  * @ddata: device driver data
155  *
156  * Configures the three command request GPIOs to the specified value.
157  */
158 static void phy_mdm6600_cmd(struct phy_mdm6600 *ddata, int val)
159 {
160         DECLARE_BITMAP(values, PHY_MDM6600_NR_CMD_LINES);
161
162         values[0] = val;
163
164         gpiod_set_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES,
165                                        ddata->cmd_gpios->desc, values);
166 }
167
168 /**
169  * phy_mdm6600_status() - read mdm6600 status lines
170  * @ddata: device driver data
171  */
172 static void phy_mdm6600_status(struct work_struct *work)
173 {
174         struct phy_mdm6600 *ddata;
175         struct device *dev;
176         DECLARE_BITMAP(values, PHY_MDM6600_NR_STATUS_LINES);
177         int error, i, val = 0;
178
179         ddata = container_of(work, struct phy_mdm6600, status_work.work);
180         dev = ddata->dev;
181
182         error = gpiod_get_array_value_cansleep(PHY_MDM6600_NR_STATUS_LINES,
183                                                ddata->status_gpios->desc,
184                                                values);
185         if (error)
186                 return;
187
188         for (i = 0; i < PHY_MDM6600_NR_STATUS_LINES; i++) {
189                 val |= test_bit(i, values) << i;
190                 dev_dbg(ddata->dev, "XXX %s: i: %i values[i]: %i val: %i\n",
191                         __func__, i, test_bit(i, values), val);
192         }
193         ddata->status = values[0];
194
195         dev_info(dev, "modem status: %i %s\n",
196                  ddata->status,
197                  phy_mdm6600_status_name[ddata->status & 7]);
198         complete(&ddata->ack);
199 }
200
201 static irqreturn_t phy_mdm6600_irq_thread(int irq, void *data)
202 {
203         struct phy_mdm6600 *ddata = data;
204
205         schedule_delayed_work(&ddata->status_work, msecs_to_jiffies(10));
206
207         return IRQ_HANDLED;
208 }
209
210 /**
211  * phy_mdm6600_wakeirq_thread - handle mode1 line OOB wake after booting
212  * @irq: interrupt
213  * @data: interrupt handler data
214  *
215  * GPIO mode1 is used initially as output to configure the USB boot
216  * mode for mdm6600. After booting it is used as input for OOB wake
217  * signal from mdm6600 to the SoC. Just use it for debug info only
218  * for now.
219  */
220 static irqreturn_t phy_mdm6600_wakeirq_thread(int irq, void *data)
221 {
222         struct phy_mdm6600 *ddata = data;
223         struct gpio_desc *mode_gpio1;
224
225         mode_gpio1 = ddata->mode_gpios->desc[PHY_MDM6600_MODE1];
226         dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n",
227                 gpiod_get_value(mode_gpio1));
228
229         return IRQ_HANDLED;
230 }
231
232 /**
233  * phy_mdm6600_init_irq() - initialize mdm6600 status IRQ lines
234  * @ddata: device driver data
235  */
236 static void phy_mdm6600_init_irq(struct phy_mdm6600 *ddata)
237 {
238         struct device *dev = ddata->dev;
239         int i, error, irq;
240
241         for (i = PHY_MDM6600_STATUS0;
242              i <= PHY_MDM6600_STATUS2; i++) {
243                 struct gpio_desc *gpio = ddata->status_gpios->desc[i];
244
245                 irq = gpiod_to_irq(gpio);
246                 if (irq <= 0)
247                         continue;
248
249                 error = devm_request_threaded_irq(dev, irq, NULL,
250                                         phy_mdm6600_irq_thread,
251                                         IRQF_TRIGGER_RISING |
252                                         IRQF_TRIGGER_FALLING |
253                                         IRQF_ONESHOT,
254                                         "mdm6600",
255                                         ddata);
256                 if (error)
257                         dev_warn(dev, "no modem status irq%i: %i\n",
258                                  irq, error);
259         }
260 }
261
262 struct phy_mdm6600_map {
263         const char *name;
264         int direction;
265 };
266
267 static const struct phy_mdm6600_map
268 phy_mdm6600_ctrl_gpio_map[PHY_MDM6600_NR_CTRL_LINES] = {
269         { "enable", GPIOD_OUT_LOW, },           /* low = phy disabled */
270         { "power", GPIOD_OUT_LOW, },            /* low = off */
271         { "reset", GPIOD_OUT_HIGH, },           /* high = reset */
272 };
273
274 /**
275  * phy_mdm6600_init_lines() - initialize mdm6600 GPIO lines
276  * @ddata: device driver data
277  */
278 static int phy_mdm6600_init_lines(struct phy_mdm6600 *ddata)
279 {
280         struct device *dev = ddata->dev;
281         int i;
282
283         /* MDM6600 control lines */
284         for (i = 0; i < ARRAY_SIZE(phy_mdm6600_ctrl_gpio_map); i++) {
285                 const struct phy_mdm6600_map *map =
286                         &phy_mdm6600_ctrl_gpio_map[i];
287                 struct gpio_desc **gpio = &ddata->ctrl_gpios[i];
288
289                 *gpio = devm_gpiod_get(dev, map->name, map->direction);
290                 if (IS_ERR(*gpio)) {
291                         dev_info(dev, "gpio %s error %li\n",
292                                  map->name, PTR_ERR(*gpio));
293                         return PTR_ERR(*gpio);
294                 }
295         }
296
297         /* MDM6600 USB start-up mode output lines */
298         ddata->mode_gpios = devm_gpiod_get_array(dev, "motorola,mode",
299                                                  GPIOD_OUT_LOW);
300         if (IS_ERR(ddata->mode_gpios))
301                 return PTR_ERR(ddata->mode_gpios);
302
303         if (ddata->mode_gpios->ndescs != PHY_MDM6600_NR_MODE_LINES)
304                 return -EINVAL;
305
306         /* MDM6600 status input lines */
307         ddata->status_gpios = devm_gpiod_get_array(dev, "motorola,status",
308                                                    GPIOD_IN);
309         if (IS_ERR(ddata->status_gpios))
310                 return PTR_ERR(ddata->status_gpios);
311
312         if (ddata->status_gpios->ndescs != PHY_MDM6600_NR_STATUS_LINES)
313                 return -EINVAL;
314
315         /* MDM6600 cmd output lines */
316         ddata->cmd_gpios = devm_gpiod_get_array(dev, "motorola,cmd",
317                                                 GPIOD_OUT_LOW);
318         if (IS_ERR(ddata->cmd_gpios))
319                 return PTR_ERR(ddata->cmd_gpios);
320
321         if (ddata->cmd_gpios->ndescs != PHY_MDM6600_NR_CMD_LINES)
322                 return -EINVAL;
323
324         return 0;
325 }
326
327 /**
328  * phy_mdm6600_device_power_on() - power on mdm6600 device
329  * @ddata: device driver data
330  *
331  * To get the integrated USB phy in MDM6600 takes some hoops. We must ensure
332  * the shared USB bootmode GPIOs are configured, then request modem start-up,
333  * reset and power-up.. And then we need to recycle the shared USB bootmode
334  * GPIOs as they are also used for Out of Band (OOB) wake for the USB and
335  * TS 27.010 serial mux.
336  */
337 static int phy_mdm6600_device_power_on(struct phy_mdm6600 *ddata)
338 {
339         struct gpio_desc *mode_gpio0, *mode_gpio1, *reset_gpio, *power_gpio;
340         int error = 0, wakeirq;
341
342         mode_gpio0 = ddata->mode_gpios->desc[PHY_MDM6600_MODE0];
343         mode_gpio1 = ddata->mode_gpios->desc[PHY_MDM6600_MODE1];
344         reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET];
345         power_gpio = ddata->ctrl_gpios[PHY_MDM6600_POWER];
346
347         /*
348          * Shared GPIOs must be low for normal USB mode. After booting
349          * they are used for OOB wake signaling. These can be also used
350          * to configure USB flashing mode later on based on a module
351          * parameter.
352          */
353         gpiod_set_value_cansleep(mode_gpio0, 0);
354         gpiod_set_value_cansleep(mode_gpio1, 0);
355
356         /* Request start-up mode */
357         phy_mdm6600_cmd(ddata, PHY_MDM6600_CMD_NO_BYPASS);
358
359         /* Request a reset first */
360         gpiod_set_value_cansleep(reset_gpio, 0);
361         msleep(100);
362
363         /* Toggle power GPIO to request mdm6600 to start */
364         gpiod_set_value_cansleep(power_gpio, 1);
365         msleep(100);
366         gpiod_set_value_cansleep(power_gpio, 0);
367
368         /*
369          * Looks like the USB PHY needs between 2.2 to 4 seconds.
370          * If we try to use it before that, we will get L3 errors
371          * from omap-usb-host trying to access the PHY. See also
372          * phy_mdm6600_init() for -EPROBE_DEFER.
373          */
374         msleep(PHY_MDM6600_PHY_DELAY_MS);
375         ddata->enabled = true;
376
377         /* Booting up the rest of MDM6600 will take total about 8 seconds */
378         dev_info(ddata->dev, "Waiting for power up request to complete..\n");
379         if (wait_for_completion_timeout(&ddata->ack,
380                         msecs_to_jiffies(PHY_MDM6600_ENABLED_DELAY_MS))) {
381                 if (ddata->status > PHY_MDM6600_STATUS_PANIC &&
382                     ddata->status < PHY_MDM6600_STATUS_SHUTDOWN_ACK)
383                         dev_info(ddata->dev, "Powered up OK\n");
384         } else {
385                 ddata->enabled = false;
386                 error = -ETIMEDOUT;
387                 dev_err(ddata->dev, "Timed out powering up\n");
388         }
389
390         /* Reconfigure mode1 GPIO as input for OOB wake */
391         gpiod_direction_input(mode_gpio1);
392
393         wakeirq = gpiod_to_irq(mode_gpio1);
394         if (wakeirq <= 0)
395                 return wakeirq;
396
397         error = devm_request_threaded_irq(ddata->dev, wakeirq, NULL,
398                                           phy_mdm6600_wakeirq_thread,
399                                           IRQF_TRIGGER_RISING |
400                                           IRQF_TRIGGER_FALLING |
401                                           IRQF_ONESHOT,
402                                           "mdm6600-wake",
403                                           ddata);
404         if (error)
405                 dev_warn(ddata->dev, "no modem wakeirq irq%i: %i\n",
406                          wakeirq, error);
407
408         ddata->running = true;
409
410         return error;
411 }
412
413 /**
414  * phy_mdm6600_device_power_off() - power off mdm6600 device
415  * @ddata: device driver data
416  */
417 static void phy_mdm6600_device_power_off(struct phy_mdm6600 *ddata)
418 {
419         struct gpio_desc *reset_gpio =
420                 ddata->ctrl_gpios[PHY_MDM6600_RESET];
421
422         ddata->enabled = false;
423         phy_mdm6600_cmd(ddata, PHY_MDM6600_CMD_BP_SHUTDOWN_REQ);
424         msleep(100);
425
426         gpiod_set_value_cansleep(reset_gpio, 1);
427
428         dev_info(ddata->dev, "Waiting for power down request to complete.. ");
429         if (wait_for_completion_timeout(&ddata->ack,
430                                         msecs_to_jiffies(5000))) {
431                 if (ddata->status == PHY_MDM6600_STATUS_PANIC)
432                         dev_info(ddata->dev, "Powered down OK\n");
433         } else {
434                 dev_err(ddata->dev, "Timed out powering down\n");
435         }
436 }
437
438 static void phy_mdm6600_deferred_power_on(struct work_struct *work)
439 {
440         struct phy_mdm6600 *ddata;
441         int error;
442
443         ddata = container_of(work, struct phy_mdm6600, bootup_work.work);
444
445         error = phy_mdm6600_device_power_on(ddata);
446         if (error)
447                 dev_err(ddata->dev, "Device not functional\n");
448 }
449
450 /*
451  * USB suspend puts mdm6600 into low power mode. For any n_gsm using apps,
452  * we need to keep the modem awake by kicking it's mode0 GPIO. This will
453  * keep the modem awake for about 1.2 seconds. When no n_gsm apps are using
454  * the modem, runtime PM auto mode can be enabled so modem can enter low
455  * power mode.
456  */
457 static void phy_mdm6600_wake_modem(struct phy_mdm6600 *ddata)
458 {
459         struct gpio_desc *mode_gpio0;
460
461         mode_gpio0 = ddata->mode_gpios->desc[PHY_MDM6600_MODE0];
462         gpiod_set_value_cansleep(mode_gpio0, 1);
463         usleep_range(5, 15);
464         gpiod_set_value_cansleep(mode_gpio0, 0);
465         if (ddata->awake)
466                 usleep_range(5, 15);
467         else
468                 msleep(MDM6600_MODEM_WAKE_DELAY_MS);
469 }
470
471 static void phy_mdm6600_modem_wake(struct work_struct *work)
472 {
473         struct phy_mdm6600 *ddata;
474
475         ddata = container_of(work, struct phy_mdm6600, modem_wake_work.work);
476         phy_mdm6600_wake_modem(ddata);
477         schedule_delayed_work(&ddata->modem_wake_work,
478                               msecs_to_jiffies(MDM6600_MODEM_IDLE_DELAY_MS));
479 }
480
481 static int __maybe_unused phy_mdm6600_runtime_suspend(struct device *dev)
482 {
483         struct phy_mdm6600 *ddata = dev_get_drvdata(dev);
484
485         cancel_delayed_work_sync(&ddata->modem_wake_work);
486         ddata->awake = false;
487
488         return 0;
489 }
490
491 static int __maybe_unused phy_mdm6600_runtime_resume(struct device *dev)
492 {
493         struct phy_mdm6600 *ddata = dev_get_drvdata(dev);
494
495         phy_mdm6600_modem_wake(&ddata->modem_wake_work.work);
496         ddata->awake = true;
497
498         return 0;
499 }
500
501 static const struct dev_pm_ops phy_mdm6600_pm_ops = {
502         SET_RUNTIME_PM_OPS(phy_mdm6600_runtime_suspend,
503                            phy_mdm6600_runtime_resume, NULL)
504 };
505
506 static const struct of_device_id phy_mdm6600_id_table[] = {
507         { .compatible = "motorola,mapphone-mdm6600", },
508         {},
509 };
510 MODULE_DEVICE_TABLE(of, phy_mdm6600_id_table);
511
512 static int phy_mdm6600_probe(struct platform_device *pdev)
513 {
514         struct phy_mdm6600 *ddata;
515         int error;
516
517         ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
518         if (!ddata)
519                 return -ENOMEM;
520
521         INIT_DELAYED_WORK(&ddata->bootup_work,
522                           phy_mdm6600_deferred_power_on);
523         INIT_DELAYED_WORK(&ddata->status_work, phy_mdm6600_status);
524         INIT_DELAYED_WORK(&ddata->modem_wake_work, phy_mdm6600_modem_wake);
525         init_completion(&ddata->ack);
526
527         ddata->dev = &pdev->dev;
528         platform_set_drvdata(pdev, ddata);
529
530         error = phy_mdm6600_init_lines(ddata);
531         if (error)
532                 return error;
533
534         phy_mdm6600_init_irq(ddata);
535
536         ddata->generic_phy = devm_phy_create(ddata->dev, NULL, &gpio_usb_ops);
537         if (IS_ERR(ddata->generic_phy)) {
538                 error = PTR_ERR(ddata->generic_phy);
539                 goto cleanup;
540         }
541
542         phy_set_drvdata(ddata->generic_phy, ddata);
543
544         ddata->phy_provider =
545                 devm_of_phy_provider_register(ddata->dev,
546                                               of_phy_simple_xlate);
547         if (IS_ERR(ddata->phy_provider)) {
548                 error = PTR_ERR(ddata->phy_provider);
549                 goto cleanup;
550         }
551
552         schedule_delayed_work(&ddata->bootup_work, 0);
553
554         /*
555          * See phy_mdm6600_device_power_on(). We should be able
556          * to remove this eventually when ohci-platform can deal
557          * with -EPROBE_DEFER.
558          */
559         msleep(PHY_MDM6600_PHY_DELAY_MS + 500);
560
561         /*
562          * Enable PM runtime only after PHY has been powered up properly.
563          * It is currently only needed after USB suspends mdm6600 and n_gsm
564          * needs to access the device. We don't want to do this earlier as
565          * gpio mode0 pin doubles as mdm6600 wake-up gpio.
566          */
567         pm_runtime_use_autosuspend(ddata->dev);
568         pm_runtime_set_autosuspend_delay(ddata->dev,
569                                          MDM6600_MODEM_IDLE_DELAY_MS);
570         pm_runtime_enable(ddata->dev);
571         error = pm_runtime_get_sync(ddata->dev);
572         if (error < 0) {
573                 dev_warn(ddata->dev, "failed to wake modem: %i\n", error);
574                 pm_runtime_put_noidle(ddata->dev);
575         }
576         pm_runtime_mark_last_busy(ddata->dev);
577         pm_runtime_put_autosuspend(ddata->dev);
578
579         return 0;
580
581 cleanup:
582         phy_mdm6600_device_power_off(ddata);
583         return error;
584 }
585
586 static int phy_mdm6600_remove(struct platform_device *pdev)
587 {
588         struct phy_mdm6600 *ddata = platform_get_drvdata(pdev);
589         struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET];
590
591         pm_runtime_dont_use_autosuspend(ddata->dev);
592         pm_runtime_put_sync(ddata->dev);
593         pm_runtime_disable(ddata->dev);
594
595         if (!ddata->running)
596                 wait_for_completion_timeout(&ddata->ack,
597                         msecs_to_jiffies(PHY_MDM6600_ENABLED_DELAY_MS));
598
599         gpiod_set_value_cansleep(reset_gpio, 1);
600         phy_mdm6600_device_power_off(ddata);
601
602         cancel_delayed_work_sync(&ddata->modem_wake_work);
603         cancel_delayed_work_sync(&ddata->bootup_work);
604         cancel_delayed_work_sync(&ddata->status_work);
605
606         return 0;
607 }
608
609 static struct platform_driver phy_mdm6600_driver = {
610         .probe = phy_mdm6600_probe,
611         .remove = phy_mdm6600_remove,
612         .driver = {
613                 .name = "phy-mapphone-mdm6600",
614                 .pm = &phy_mdm6600_pm_ops,
615                 .of_match_table = of_match_ptr(phy_mdm6600_id_table),
616         },
617 };
618
619 module_platform_driver(phy_mdm6600_driver);
620
621 MODULE_ALIAS("platform:gpio_usb");
622 MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
623 MODULE_DESCRIPTION("mdm6600 gpio usb phy driver");
624 MODULE_LICENSE("GPL v2");