0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 #include <linux/kernel.h>
0039 #include <linux/module.h>
0040 #include <linux/slab.h>
0041 #include <linux/clk.h>
0042 #include <linux/device.h>
0043 #include <linux/dma-mapping.h>
0044 #include <linux/of_device.h>
0045 #include <linux/mutex.h>
0046 #include <linux/platform_device.h>
0047 #include <linux/phy/phy.h>
0048 #include <linux/platform_data/s3c-hsotg.h>
0049 #include <linux/reset.h>
0050
0051 #include <linux/usb/of.h>
0052
0053 #include "core.h"
0054 #include "hcd.h"
0055 #include "debug.h"
0056
0057 static const char dwc2_driver_name[] = "dwc2";
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 static int dwc2_get_dr_mode(struct dwc2_hsotg *hsotg)
0083 {
0084 enum usb_dr_mode mode;
0085
0086 hsotg->dr_mode = usb_get_dr_mode(hsotg->dev);
0087 if (hsotg->dr_mode == USB_DR_MODE_UNKNOWN)
0088 hsotg->dr_mode = USB_DR_MODE_OTG;
0089
0090 mode = hsotg->dr_mode;
0091
0092 if (dwc2_hw_is_device(hsotg)) {
0093 if (IS_ENABLED(CONFIG_USB_DWC2_HOST)) {
0094 dev_err(hsotg->dev,
0095 "Controller does not support host mode.\n");
0096 return -EINVAL;
0097 }
0098 mode = USB_DR_MODE_PERIPHERAL;
0099 } else if (dwc2_hw_is_host(hsotg)) {
0100 if (IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL)) {
0101 dev_err(hsotg->dev,
0102 "Controller does not support device mode.\n");
0103 return -EINVAL;
0104 }
0105 mode = USB_DR_MODE_HOST;
0106 } else {
0107 if (IS_ENABLED(CONFIG_USB_DWC2_HOST))
0108 mode = USB_DR_MODE_HOST;
0109 else if (IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL))
0110 mode = USB_DR_MODE_PERIPHERAL;
0111 }
0112
0113 if (mode != hsotg->dr_mode) {
0114 dev_warn(hsotg->dev,
0115 "Configuration mismatch. dr_mode forced to %s\n",
0116 mode == USB_DR_MODE_HOST ? "host" : "device");
0117
0118 hsotg->dr_mode = mode;
0119 }
0120
0121 return 0;
0122 }
0123
0124 static void __dwc2_disable_regulators(void *data)
0125 {
0126 struct dwc2_hsotg *hsotg = data;
0127
0128 regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
0129 }
0130
0131 static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
0132 {
0133 struct platform_device *pdev = to_platform_device(hsotg->dev);
0134 int ret;
0135
0136 ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies),
0137 hsotg->supplies);
0138 if (ret)
0139 return ret;
0140
0141 ret = devm_add_action_or_reset(&pdev->dev,
0142 __dwc2_disable_regulators, hsotg);
0143 if (ret)
0144 return ret;
0145
0146 if (hsotg->clk) {
0147 ret = clk_prepare_enable(hsotg->clk);
0148 if (ret)
0149 return ret;
0150 }
0151
0152 if (hsotg->uphy) {
0153 ret = usb_phy_init(hsotg->uphy);
0154 } else if (hsotg->plat && hsotg->plat->phy_init) {
0155 ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
0156 } else {
0157 ret = phy_init(hsotg->phy);
0158 if (ret == 0)
0159 ret = phy_power_on(hsotg->phy);
0160 }
0161
0162 return ret;
0163 }
0164
0165
0166
0167
0168
0169
0170
0171
0172 int dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
0173 {
0174 int ret = __dwc2_lowlevel_hw_enable(hsotg);
0175
0176 if (ret == 0)
0177 hsotg->ll_hw_enabled = true;
0178 return ret;
0179 }
0180
0181 static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
0182 {
0183 struct platform_device *pdev = to_platform_device(hsotg->dev);
0184 int ret = 0;
0185
0186 if (hsotg->uphy) {
0187 usb_phy_shutdown(hsotg->uphy);
0188 } else if (hsotg->plat && hsotg->plat->phy_exit) {
0189 ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type);
0190 } else {
0191 ret = phy_power_off(hsotg->phy);
0192 if (ret == 0)
0193 ret = phy_exit(hsotg->phy);
0194 }
0195 if (ret)
0196 return ret;
0197
0198 if (hsotg->clk)
0199 clk_disable_unprepare(hsotg->clk);
0200
0201 return 0;
0202 }
0203
0204
0205
0206
0207
0208
0209
0210
0211 int dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
0212 {
0213 int ret = __dwc2_lowlevel_hw_disable(hsotg);
0214
0215 if (ret == 0)
0216 hsotg->ll_hw_enabled = false;
0217 return ret;
0218 }
0219
0220 static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
0221 {
0222 int i, ret;
0223
0224 hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2");
0225 if (IS_ERR(hsotg->reset))
0226 return dev_err_probe(hsotg->dev, PTR_ERR(hsotg->reset),
0227 "error getting reset control\n");
0228
0229 reset_control_deassert(hsotg->reset);
0230
0231 hsotg->reset_ecc = devm_reset_control_get_optional(hsotg->dev, "dwc2-ecc");
0232 if (IS_ERR(hsotg->reset_ecc))
0233 return dev_err_probe(hsotg->dev, PTR_ERR(hsotg->reset_ecc),
0234 "error getting reset control for ecc\n");
0235
0236 reset_control_deassert(hsotg->reset_ecc);
0237
0238
0239
0240
0241
0242 hsotg->phy = devm_phy_get(hsotg->dev, "usb2-phy");
0243 if (IS_ERR(hsotg->phy)) {
0244 ret = PTR_ERR(hsotg->phy);
0245 switch (ret) {
0246 case -ENODEV:
0247 case -ENOSYS:
0248 hsotg->phy = NULL;
0249 break;
0250 default:
0251 return dev_err_probe(hsotg->dev, ret, "error getting phy\n");
0252 }
0253 }
0254
0255 if (!hsotg->phy) {
0256 hsotg->uphy = devm_usb_get_phy(hsotg->dev, USB_PHY_TYPE_USB2);
0257 if (IS_ERR(hsotg->uphy)) {
0258 ret = PTR_ERR(hsotg->uphy);
0259 switch (ret) {
0260 case -ENODEV:
0261 case -ENXIO:
0262 hsotg->uphy = NULL;
0263 break;
0264 default:
0265 return dev_err_probe(hsotg->dev, ret, "error getting usb phy\n");
0266 }
0267 }
0268 }
0269
0270 hsotg->plat = dev_get_platdata(hsotg->dev);
0271
0272
0273 hsotg->clk = devm_clk_get_optional(hsotg->dev, "otg");
0274 if (IS_ERR(hsotg->clk))
0275 return dev_err_probe(hsotg->dev, PTR_ERR(hsotg->clk), "cannot get otg clock\n");
0276
0277
0278 for (i = 0; i < ARRAY_SIZE(hsotg->supplies); i++)
0279 hsotg->supplies[i].supply = dwc2_hsotg_supply_names[i];
0280
0281 ret = devm_regulator_bulk_get(hsotg->dev, ARRAY_SIZE(hsotg->supplies),
0282 hsotg->supplies);
0283 if (ret)
0284 return dev_err_probe(hsotg->dev, ret, "failed to request supplies\n");
0285
0286 return 0;
0287 }
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300 static int dwc2_driver_remove(struct platform_device *dev)
0301 {
0302 struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
0303 struct dwc2_gregs_backup *gr;
0304 int ret = 0;
0305
0306 gr = &hsotg->gr_backup;
0307
0308
0309 if (hsotg->hibernated) {
0310 if (gr->gotgctl & GOTGCTL_CURMODE_HOST)
0311 ret = dwc2_exit_hibernation(hsotg, 0, 0, 1);
0312 else
0313 ret = dwc2_exit_hibernation(hsotg, 0, 0, 0);
0314
0315 if (ret)
0316 dev_err(hsotg->dev,
0317 "exit hibernation failed.\n");
0318 }
0319
0320
0321 if (hsotg->in_ppd) {
0322 ret = dwc2_exit_partial_power_down(hsotg, 0, true);
0323 if (ret)
0324 dev_err(hsotg->dev,
0325 "exit partial_power_down failed\n");
0326 }
0327
0328
0329 if (hsotg->params.power_down == DWC2_POWER_DOWN_PARAM_NONE &&
0330 hsotg->bus_suspended) {
0331 if (dwc2_is_device_mode(hsotg))
0332 dwc2_gadget_exit_clock_gating(hsotg, 0);
0333 else
0334 dwc2_host_exit_clock_gating(hsotg, 0);
0335 }
0336
0337 dwc2_debugfs_exit(hsotg);
0338 if (hsotg->hcd_enabled)
0339 dwc2_hcd_remove(hsotg);
0340 if (hsotg->gadget_enabled)
0341 dwc2_hsotg_remove(hsotg);
0342
0343 dwc2_drd_exit(hsotg);
0344
0345 if (hsotg->params.activate_stm_id_vb_detection)
0346 regulator_disable(hsotg->usb33d);
0347
0348 if (hsotg->ll_hw_enabled)
0349 dwc2_lowlevel_hw_disable(hsotg);
0350
0351 reset_control_assert(hsotg->reset);
0352 reset_control_assert(hsotg->reset_ecc);
0353
0354 return ret;
0355 }
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369 static void dwc2_driver_shutdown(struct platform_device *dev)
0370 {
0371 struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
0372
0373 dwc2_disable_global_interrupts(hsotg);
0374 synchronize_irq(hsotg->irq);
0375 }
0376
0377
0378
0379
0380
0381
0382 static bool dwc2_check_core_endianness(struct dwc2_hsotg *hsotg)
0383 {
0384 u32 snpsid;
0385
0386 snpsid = ioread32(hsotg->regs + GSNPSID);
0387 if ((snpsid & GSNPSID_ID_MASK) == DWC2_OTG_ID ||
0388 (snpsid & GSNPSID_ID_MASK) == DWC2_FS_IOT_ID ||
0389 (snpsid & GSNPSID_ID_MASK) == DWC2_HS_IOT_ID)
0390 return false;
0391 return true;
0392 }
0393
0394
0395
0396
0397
0398
0399
0400 int dwc2_check_core_version(struct dwc2_hsotg *hsotg)
0401 {
0402 struct dwc2_hw_params *hw = &hsotg->hw_params;
0403
0404
0405
0406
0407
0408
0409
0410 hw->snpsid = dwc2_readl(hsotg, GSNPSID);
0411 if ((hw->snpsid & GSNPSID_ID_MASK) != DWC2_OTG_ID &&
0412 (hw->snpsid & GSNPSID_ID_MASK) != DWC2_FS_IOT_ID &&
0413 (hw->snpsid & GSNPSID_ID_MASK) != DWC2_HS_IOT_ID) {
0414 dev_err(hsotg->dev, "Bad value for GSNPSID: 0x%08x\n",
0415 hw->snpsid);
0416 return -ENODEV;
0417 }
0418
0419 dev_dbg(hsotg->dev, "Core Release: %1x.%1x%1x%1x (snpsid=%x)\n",
0420 hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf,
0421 hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid);
0422 return 0;
0423 }
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437 static int dwc2_driver_probe(struct platform_device *dev)
0438 {
0439 struct dwc2_hsotg *hsotg;
0440 struct resource *res;
0441 int retval;
0442
0443 hsotg = devm_kzalloc(&dev->dev, sizeof(*hsotg), GFP_KERNEL);
0444 if (!hsotg)
0445 return -ENOMEM;
0446
0447 hsotg->dev = &dev->dev;
0448
0449
0450
0451
0452 if (!dev->dev.dma_mask)
0453 dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
0454 retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
0455 if (retval) {
0456 dev_err(&dev->dev, "can't set coherent DMA mask: %d\n", retval);
0457 return retval;
0458 }
0459
0460 hsotg->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res);
0461 if (IS_ERR(hsotg->regs))
0462 return PTR_ERR(hsotg->regs);
0463
0464 dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n",
0465 (unsigned long)res->start, hsotg->regs);
0466
0467 retval = dwc2_lowlevel_hw_init(hsotg);
0468 if (retval)
0469 return retval;
0470
0471 spin_lock_init(&hsotg->lock);
0472
0473 hsotg->irq = platform_get_irq(dev, 0);
0474 if (hsotg->irq < 0)
0475 return hsotg->irq;
0476
0477 dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
0478 hsotg->irq);
0479 retval = devm_request_irq(hsotg->dev, hsotg->irq,
0480 dwc2_handle_common_intr, IRQF_SHARED,
0481 dev_name(hsotg->dev), hsotg);
0482 if (retval)
0483 return retval;
0484
0485 hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus");
0486 if (IS_ERR(hsotg->vbus_supply)) {
0487 retval = PTR_ERR(hsotg->vbus_supply);
0488 hsotg->vbus_supply = NULL;
0489 if (retval != -ENODEV)
0490 return retval;
0491 }
0492
0493 retval = dwc2_lowlevel_hw_enable(hsotg);
0494 if (retval)
0495 return retval;
0496
0497 hsotg->needs_byte_swap = dwc2_check_core_endianness(hsotg);
0498
0499 retval = dwc2_get_dr_mode(hsotg);
0500 if (retval)
0501 goto error;
0502
0503 hsotg->need_phy_for_wake =
0504 of_property_read_bool(dev->dev.of_node,
0505 "snps,need-phy-for-wake");
0506
0507
0508
0509
0510
0511 retval = dwc2_check_core_version(hsotg);
0512 if (retval)
0513 goto error;
0514
0515
0516
0517
0518
0519 retval = dwc2_core_reset(hsotg, false);
0520 if (retval)
0521 goto error;
0522
0523
0524 retval = dwc2_get_hwparams(hsotg);
0525 if (retval)
0526 goto error;
0527
0528
0529
0530
0531
0532
0533 dwc2_force_dr_mode(hsotg);
0534
0535 retval = dwc2_init_params(hsotg);
0536 if (retval)
0537 goto error;
0538
0539 if (hsotg->params.activate_stm_id_vb_detection) {
0540 u32 ggpio;
0541
0542 hsotg->usb33d = devm_regulator_get(hsotg->dev, "usb33d");
0543 if (IS_ERR(hsotg->usb33d)) {
0544 retval = PTR_ERR(hsotg->usb33d);
0545 dev_err_probe(hsotg->dev, retval, "failed to request usb33d supply\n");
0546 goto error;
0547 }
0548 retval = regulator_enable(hsotg->usb33d);
0549 if (retval) {
0550 dev_err_probe(hsotg->dev, retval, "failed to enable usb33d supply\n");
0551 goto error;
0552 }
0553
0554 ggpio = dwc2_readl(hsotg, GGPIO);
0555 ggpio |= GGPIO_STM32_OTG_GCCFG_IDEN;
0556 ggpio |= GGPIO_STM32_OTG_GCCFG_VBDEN;
0557 dwc2_writel(hsotg, ggpio, GGPIO);
0558
0559
0560 usleep_range(5000, 7000);
0561 }
0562
0563 retval = dwc2_drd_init(hsotg);
0564 if (retval) {
0565 dev_err_probe(hsotg->dev, retval, "failed to initialize dual-role\n");
0566 goto error_init;
0567 }
0568
0569 if (hsotg->dr_mode != USB_DR_MODE_HOST) {
0570 retval = dwc2_gadget_init(hsotg);
0571 if (retval)
0572 goto error_drd;
0573 hsotg->gadget_enabled = 1;
0574 }
0575
0576
0577
0578
0579
0580
0581 if (hsotg->need_phy_for_wake)
0582 device_set_wakeup_capable(&dev->dev, true);
0583
0584 hsotg->reset_phy_on_wake =
0585 of_property_read_bool(dev->dev.of_node,
0586 "snps,reset-phy-on-wake");
0587 if (hsotg->reset_phy_on_wake && !hsotg->phy) {
0588 dev_warn(hsotg->dev,
0589 "Quirk reset-phy-on-wake only supports generic PHYs\n");
0590 hsotg->reset_phy_on_wake = false;
0591 }
0592
0593 if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL) {
0594 retval = dwc2_hcd_init(hsotg);
0595 if (retval) {
0596 if (hsotg->gadget_enabled)
0597 dwc2_hsotg_remove(hsotg);
0598 goto error_drd;
0599 }
0600 hsotg->hcd_enabled = 1;
0601 }
0602
0603 platform_set_drvdata(dev, hsotg);
0604 hsotg->hibernated = 0;
0605
0606 dwc2_debugfs_init(hsotg);
0607
0608
0609 if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
0610 dwc2_lowlevel_hw_disable(hsotg);
0611
0612 #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
0613 IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
0614
0615 if (hsotg->gadget_enabled) {
0616 retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
0617 if (retval) {
0618 hsotg->gadget.udc = NULL;
0619 dwc2_hsotg_remove(hsotg);
0620 goto error_debugfs;
0621 }
0622 }
0623 #endif
0624 return 0;
0625
0626 #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
0627 IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
0628 error_debugfs:
0629 dwc2_debugfs_exit(hsotg);
0630 if (hsotg->hcd_enabled)
0631 dwc2_hcd_remove(hsotg);
0632 #endif
0633 error_drd:
0634 dwc2_drd_exit(hsotg);
0635
0636 error_init:
0637 if (hsotg->params.activate_stm_id_vb_detection)
0638 regulator_disable(hsotg->usb33d);
0639 error:
0640 if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL)
0641 dwc2_lowlevel_hw_disable(hsotg);
0642 return retval;
0643 }
0644
0645 static int __maybe_unused dwc2_suspend(struct device *dev)
0646 {
0647 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);
0648 bool is_device_mode = dwc2_is_device_mode(dwc2);
0649 int ret = 0;
0650
0651 if (is_device_mode)
0652 dwc2_hsotg_suspend(dwc2);
0653
0654 dwc2_drd_suspend(dwc2);
0655
0656 if (dwc2->params.activate_stm_id_vb_detection) {
0657 unsigned long flags;
0658 u32 ggpio, gotgctl;
0659
0660
0661
0662
0663
0664 dwc2_force_mode(dwc2, !is_device_mode);
0665
0666 spin_lock_irqsave(&dwc2->lock, flags);
0667 gotgctl = dwc2_readl(dwc2, GOTGCTL);
0668
0669 gotgctl |= GOTGCTL_DBNCE_FLTR_BYPASS;
0670 gotgctl |= GOTGCTL_BVALOEN | GOTGCTL_AVALOEN;
0671
0672 if (gotgctl & GOTGCTL_ASESVLD)
0673 gotgctl |= GOTGCTL_AVALOVAL;
0674 if (gotgctl & GOTGCTL_BSESVLD)
0675 gotgctl |= GOTGCTL_BVALOVAL;
0676 dwc2_writel(dwc2, gotgctl, GOTGCTL);
0677 spin_unlock_irqrestore(&dwc2->lock, flags);
0678
0679 ggpio = dwc2_readl(dwc2, GGPIO);
0680 ggpio &= ~GGPIO_STM32_OTG_GCCFG_IDEN;
0681 ggpio &= ~GGPIO_STM32_OTG_GCCFG_VBDEN;
0682 dwc2_writel(dwc2, ggpio, GGPIO);
0683
0684 regulator_disable(dwc2->usb33d);
0685 }
0686
0687 if (dwc2->ll_hw_enabled &&
0688 (is_device_mode || dwc2_host_can_poweroff_phy(dwc2))) {
0689 ret = __dwc2_lowlevel_hw_disable(dwc2);
0690 dwc2->phy_off_for_suspend = true;
0691 }
0692
0693 return ret;
0694 }
0695
0696 static int __maybe_unused dwc2_resume(struct device *dev)
0697 {
0698 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);
0699 int ret = 0;
0700
0701 if (dwc2->phy_off_for_suspend && dwc2->ll_hw_enabled) {
0702 ret = __dwc2_lowlevel_hw_enable(dwc2);
0703 if (ret)
0704 return ret;
0705 }
0706 dwc2->phy_off_for_suspend = false;
0707
0708 if (dwc2->params.activate_stm_id_vb_detection) {
0709 unsigned long flags;
0710 u32 ggpio, gotgctl;
0711
0712 ret = regulator_enable(dwc2->usb33d);
0713 if (ret)
0714 return ret;
0715
0716 ggpio = dwc2_readl(dwc2, GGPIO);
0717 ggpio |= GGPIO_STM32_OTG_GCCFG_IDEN;
0718 ggpio |= GGPIO_STM32_OTG_GCCFG_VBDEN;
0719 dwc2_writel(dwc2, ggpio, GGPIO);
0720
0721
0722 usleep_range(5000, 7000);
0723
0724 spin_lock_irqsave(&dwc2->lock, flags);
0725 gotgctl = dwc2_readl(dwc2, GOTGCTL);
0726 gotgctl &= ~GOTGCTL_DBNCE_FLTR_BYPASS;
0727 gotgctl &= ~(GOTGCTL_BVALOEN | GOTGCTL_AVALOEN |
0728 GOTGCTL_BVALOVAL | GOTGCTL_AVALOVAL);
0729 dwc2_writel(dwc2, gotgctl, GOTGCTL);
0730 spin_unlock_irqrestore(&dwc2->lock, flags);
0731 }
0732
0733 if (!dwc2->role_sw) {
0734
0735 dwc2_force_dr_mode(dwc2);
0736 } else {
0737 dwc2_drd_resume(dwc2);
0738 }
0739
0740 if (dwc2_is_device_mode(dwc2))
0741 ret = dwc2_hsotg_resume(dwc2);
0742
0743 return ret;
0744 }
0745
0746 static const struct dev_pm_ops dwc2_dev_pm_ops = {
0747 SET_SYSTEM_SLEEP_PM_OPS(dwc2_suspend, dwc2_resume)
0748 };
0749
0750 static struct platform_driver dwc2_platform_driver = {
0751 .driver = {
0752 .name = dwc2_driver_name,
0753 .of_match_table = dwc2_of_match_table,
0754 .acpi_match_table = ACPI_PTR(dwc2_acpi_match),
0755 .pm = &dwc2_dev_pm_ops,
0756 },
0757 .probe = dwc2_driver_probe,
0758 .remove = dwc2_driver_remove,
0759 .shutdown = dwc2_driver_shutdown,
0760 };
0761
0762 module_platform_driver(dwc2_platform_driver);