2 #include "usbdev_grf_regs.h"
3 #include "dwc_otg_regs.h"
4 static struct dwc_otg_control_usb *control_usb;
6 #ifdef CONFIG_USB20_OTG
7 static void usb20otg_hw_init(void)
9 /* Turn off differential receiver in suspend mode */
10 writel(UOC_HIWORD_UPDATE(0, 1, 2),
11 RK_GRF_VIRT + RK312X_GRF_USBPHY0_CON6);
12 /* Set disconnect detection trigger point to 600mv */
13 writel(UOC_HIWORD_UPDATE(0, 0xf, 11),
14 RK_GRF_VIRT + RK312X_GRF_USBPHY0_CON7);
15 /* other haredware init,include:
16 * DRV_VBUS GPIO init */
17 if (gpio_is_valid(control_usb->otg_gpios->gpio)) {
18 if (gpio_get_value(control_usb->otg_gpios->gpio))
19 gpio_set_value(control_usb->otg_gpios->gpio, 0);
23 static void usb20otg_phy_suspend(void *pdata, int suspend)
25 struct dwc_otg_platform_data *usbpdata = pdata;
28 /* enable soft control */
29 writel(UOC_HIWORD_UPDATE(0x1d1, 0x1ff, 0),
30 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
31 usbpdata->phy_status = 1;
34 writel(UOC_HIWORD_UPDATE(0x0, 0x1, 0),
35 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
36 usbpdata->phy_status = 0;
40 static void usb20otg_soft_reset(void *pdata, enum rkusb_rst_flag rst_type)
42 struct dwc_otg_platform_data *usbpdata = pdata;
43 struct reset_control *rst_otg_h, *rst_otg_p, *rst_otg_c;
45 rst_otg_h = devm_reset_control_get(usbpdata->dev, "otg_ahb");
46 rst_otg_p = devm_reset_control_get(usbpdata->dev, "otg_phy");
47 rst_otg_c = devm_reset_control_get(usbpdata->dev, "otg_controller");
48 if (IS_ERR(rst_otg_h) || IS_ERR(rst_otg_p) || IS_ERR(rst_otg_c)) {
49 dev_err(usbpdata->dev, "Fail to get reset control from dts\n");
56 writel(UOC_HIWORD_UPDATE(0x1, 0x3, 0),
57 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
58 reset_control_assert(rst_otg_p);
60 writel(UOC_HIWORD_UPDATE(0x2, 0x3, 0),
61 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
63 reset_control_deassert(rst_otg_p);
66 /* Controller reset */
67 reset_control_assert(rst_otg_c);
68 reset_control_assert(rst_otg_h);
72 reset_control_deassert(rst_otg_c);
73 reset_control_deassert(rst_otg_h);
81 static void usb20otg_clock_init(void *pdata)
83 struct dwc_otg_platform_data *usbpdata = pdata;
84 struct clk *ahbclk, *phyclk;
86 ahbclk = devm_clk_get(usbpdata->dev, "hclk_usb0");
88 dev_err(usbpdata->dev, "Failed to get hclk_usb0\n");
92 phyclk = devm_clk_get(usbpdata->dev, "clk_usbphy0");
94 dev_err(usbpdata->dev, "Failed to get clk_usbphy0\n");
98 usbpdata->phyclk = phyclk;
99 usbpdata->ahbclk = ahbclk;
102 static void usb20otg_clock_enable(void *pdata, int enable)
104 struct dwc_otg_platform_data *usbpdata = pdata;
107 clk_prepare_enable(usbpdata->ahbclk);
108 clk_prepare_enable(usbpdata->phyclk);
110 clk_disable_unprepare(usbpdata->ahbclk);
112 clk_disable_unprepare(usbpdata->phyclk);
117 static int usb20otg_get_status(int id)
120 u32 soc_status0 = readl(RK_GRF_VIRT + RK312X_GRF_SOC_STATUS0);
122 case USB_STATUS_BVABLID:
124 ret = soc_status0 & (0x1 << 5);
126 case USB_STATUS_DPDM:
128 ret = soc_status0 & (0x3 << 6);
132 ret = soc_status0 & (0x1 << 8);
134 case USB_STATUS_UARTMODE:
135 ret = readl(RK_GRF_VIRT + RK312X_GRF_UOC1_CON4) & (1 << 12);
138 ret = control_usb->chip_id;
140 case USB_REMOTE_WAKEUP:
141 ret = control_usb->remote_wakeup;
144 ret = control_usb->usb_irq_wakeup;
152 #ifdef CONFIG_RK_USB_UART
154 * dwc_otg_uart_enabled - check if a usb-uart bypass func is enabled in DT
156 * Returns true if the status property of node "usb_uart" is set to "okay"
157 * or "ok", if this property is absent it will use the default status "ok"
160 static bool dwc_otg_uart_enabled(void)
162 struct device_node *np;
164 np = of_find_node_by_name(NULL, "usb_uart");
165 if (np && of_device_is_available(np))
171 static void dwc_otg_uart_mode(void *pdata, int enter_usb_uart_mode)
173 if ((1 == enter_usb_uart_mode) && dwc_otg_uart_enabled()) {
174 /* bypass dm, enter uart mode */
175 writel(UOC_HIWORD_UPDATE(0x3, 0x3, 12), RK_GRF_VIRT +
176 RK312X_GRF_UOC1_CON4);
178 } else if (0 == enter_usb_uart_mode) {
180 writel(UOC_HIWORD_UPDATE(0x0, 0x3, 12), RK_GRF_VIRT +
181 RK312X_GRF_UOC1_CON4);
185 static void dwc_otg_uart_mode(void *pdata, int enter_usb_uart_mode)
190 static void usb20otg_power_enable(int enable)
193 /* disable otg_drv power */
194 if (gpio_is_valid(control_usb->otg_gpios->gpio))
195 gpio_set_value(control_usb->otg_gpios->gpio, 0);
196 } else if (1 == enable) {
197 /* enable otg_drv power */
198 if (gpio_is_valid(control_usb->otg_gpios->gpio))
199 gpio_set_value(control_usb->otg_gpios->gpio, 1);
202 static void usb20otg_phy_power_down(int power_down)
204 if (power_down == PHY_POWER_DOWN) {
205 if (control_usb->linestate_wakeup) {
206 /* enable otg0_linestate irq */
207 writel(UOC_HIWORD_UPDATE(0x3, 0x3, 14),
208 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
209 /* enable otg1_linestate irq */
210 writel(UOC_HIWORD_UPDATE(0x3, 0x3, 12),
211 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
213 } else if (power_down == PHY_POWER_UP) {
217 struct dwc_otg_platform_data usb20otg_pdata_rk3126 = {
222 .hw_init = usb20otg_hw_init,
223 .phy_suspend = usb20otg_phy_suspend,
224 .soft_reset = usb20otg_soft_reset,
225 .clock_init = usb20otg_clock_init,
226 .clock_enable = usb20otg_clock_enable,
227 .get_status = usb20otg_get_status,
228 .power_enable = usb20otg_power_enable,
229 .dwc_otg_uart_mode = dwc_otg_uart_mode,
230 .bc_detect_cb = rk_battery_charger_detect_cb,
231 .phy_power_down = usb20otg_phy_power_down,
235 #if defined(CONFIG_USB20_HOST) || defined(CONFIG_USB_EHCI_RK)
236 static void usb20host_hw_init(void)
238 /* Turn off differential receiver in suspend mode */
239 writel(UOC_HIWORD_UPDATE(0, 1, 2),
240 RK_GRF_VIRT + RK312X_GRF_USBPHY1_CON6);
241 /* Set disconnect detection trigger point to 600mv */
242 writel(UOC_HIWORD_UPDATE(1, 0xf, 11),
243 RK_GRF_VIRT + RK312X_GRF_USBPHY1_CON7);
244 /* other haredware init,include:
245 * DRV_VBUS GPIO init */
246 if (gpio_is_valid(control_usb->host_gpios->gpio)) {
247 if (!gpio_get_value(control_usb->host_gpios->gpio))
248 gpio_set_value(control_usb->host_gpios->gpio, 1);
252 static void usb20host_phy_suspend(void *pdata, int suspend)
254 struct dwc_otg_platform_data *usbpdata = pdata;
257 /* enable soft control */
258 writel(UOC_HIWORD_UPDATE(0x1d5, 0x1ff, 0),
259 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
260 usbpdata->phy_status = 1;
263 writel(UOC_HIWORD_UPDATE(0x0, 0x1, 0),
264 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
265 usbpdata->phy_status = 0;
269 static void usb20host_soft_reset(void *pdata, enum rkusb_rst_flag rst_type)
271 struct dwc_otg_platform_data *usbpdata = pdata;
272 struct reset_control *rst_host_h, *rst_host_p, *rst_host_c;
274 rst_host_h = devm_reset_control_get(usbpdata->dev, "host_ahb");
275 rst_host_p = devm_reset_control_get(usbpdata->dev, "host_phy");
276 rst_host_c = devm_reset_control_get(usbpdata->dev, "host_controller");
277 if (IS_ERR(rst_host_h) || IS_ERR(rst_host_p) || IS_ERR(rst_host_c)) {
278 dev_err(usbpdata->dev, "Fail to get reset control from dts\n");
285 writel(UOC_HIWORD_UPDATE(0x1, 0x3, 0),
286 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
287 reset_control_assert(rst_host_p);
289 writel(UOC_HIWORD_UPDATE(0x2, 0x3, 0),
290 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
293 reset_control_deassert(rst_host_p);
295 /* Controller reset */
296 reset_control_assert(rst_host_c);
297 reset_control_assert(rst_host_h);
301 reset_control_deassert(rst_host_c);
302 reset_control_deassert(rst_host_h);
310 static void usb20host_clock_init(void *pdata)
312 struct dwc_otg_platform_data *usbpdata = pdata;
313 struct clk *ahbclk, *phyclk;
315 ahbclk = devm_clk_get(usbpdata->dev, "hclk_usb1");
316 if (IS_ERR(ahbclk)) {
317 dev_err(usbpdata->dev, "Failed to get hclk_usb1\n");
321 phyclk = devm_clk_get(usbpdata->dev, "clk_usbphy1");
322 if (IS_ERR(phyclk)) {
323 dev_err(usbpdata->dev, "Failed to get clk_usbphy1\n");
327 usbpdata->phyclk = phyclk;
328 usbpdata->ahbclk = ahbclk;
331 static void usb20host_clock_enable(void *pdata, int enable)
333 struct dwc_otg_platform_data *usbpdata = pdata;
336 clk_prepare_enable(usbpdata->ahbclk);
337 clk_prepare_enable(usbpdata->phyclk);
339 clk_disable_unprepare(usbpdata->ahbclk);
340 clk_disable_unprepare(usbpdata->phyclk);
344 static int usb20host_get_status(int id)
347 u32 soc_status0 = readl(RK_GRF_VIRT + RK312X_GRF_SOC_STATUS0);
350 case USB_STATUS_BVABLID:
352 ret = soc_status0 & (0x1 << 10);
354 case USB_STATUS_DPDM:
356 ret = soc_status0 & (0x3 << 11);
363 ret = control_usb->chip_id;
365 case USB_REMOTE_WAKEUP:
366 ret = control_usb->remote_wakeup;
369 ret = control_usb->usb_irq_wakeup;
377 static void usb20host_power_enable(int enable)
380 /* disable host_drv power */
381 /* do not disable power in default */
382 } else if (1 == enable) {
383 /* enable host_drv power */
384 if (gpio_is_valid(control_usb->host_gpios->gpio))
385 gpio_set_value(control_usb->host_gpios->gpio, 1);
389 struct dwc_otg_platform_data usb20host_pdata_rk3126 = {
394 .hw_init = usb20host_hw_init,
395 .phy_suspend = usb20host_phy_suspend,
396 .soft_reset = usb20host_soft_reset,
397 .clock_init = usb20host_clock_init,
398 .clock_enable = usb20host_clock_enable,
399 .get_status = usb20host_get_status,
400 .power_enable = usb20host_power_enable,
404 #ifdef CONFIG_USB_EHCI_RK
405 static void usb20ehci_phy_suspend(void *pdata, int suspend)
407 struct rkehci_platform_data *usbpdata = pdata;
410 /* enable soft control */
411 writel(UOC_HIWORD_UPDATE(0x1d5, 0x1ff, 0),
412 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
413 usbpdata->phy_status = 1;
416 writel(UOC_HIWORD_UPDATE(0x0, 0x1, 0),
417 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
418 usbpdata->phy_status = 0;
422 static void usb20ehci_soft_reset(void *pdata, enum rkusb_rst_flag rst_type)
424 struct rkehci_platform_data *usbpdata = pdata;
425 struct reset_control *rst_host_h, *rst_host_p, *rst_host_c;
427 rst_host_h = devm_reset_control_get(usbpdata->dev, "host_ahb");
428 rst_host_p = devm_reset_control_get(usbpdata->dev, "host_phy");
429 rst_host_c = devm_reset_control_get(usbpdata->dev, "host_controller");
430 if (IS_ERR(rst_host_h) || IS_ERR(rst_host_p) || IS_ERR(rst_host_c)) {
431 dev_err(usbpdata->dev, "Fail to get reset control from dts\n");
438 writel(UOC_HIWORD_UPDATE(0x1, 0x3, 0),
439 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
440 reset_control_assert(rst_host_p);
442 writel(UOC_HIWORD_UPDATE(0x2, 0x3, 0),
443 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
446 reset_control_deassert(rst_host_p);
448 /* Controller reset */
449 reset_control_assert(rst_host_c);
450 reset_control_assert(rst_host_h);
454 reset_control_deassert(rst_host_c);
455 reset_control_deassert(rst_host_h);
463 static void usb20ehci_clock_init(void *pdata)
465 struct rkehci_platform_data *usbpdata = pdata;
466 struct clk *ahbclk, *phyclk;
468 ahbclk = devm_clk_get(usbpdata->dev, "hclk_host0");
469 if (IS_ERR(ahbclk)) {
470 dev_err(usbpdata->dev, "Failed to get hclk_usb1\n");
474 phyclk = devm_clk_get(usbpdata->dev, "clk_usbphy1");
475 if (IS_ERR(phyclk)) {
476 dev_err(usbpdata->dev, "Failed to get clk_usbphy1\n");
480 usbpdata->phyclk = phyclk;
481 usbpdata->ahbclk = ahbclk;
484 static void usb20ehci_clock_enable(void *pdata, int enable)
486 struct rkehci_platform_data *usbpdata = pdata;
489 clk_prepare_enable(usbpdata->ahbclk);
490 clk_prepare_enable(usbpdata->phyclk);
492 clk_disable_unprepare(usbpdata->ahbclk);
493 clk_disable_unprepare(usbpdata->phyclk);
497 struct rkehci_platform_data usb20ehci_pdata_rk3126 = {
501 .hw_init = usb20host_hw_init,
502 .phy_suspend = usb20ehci_phy_suspend,
503 .soft_reset = usb20ehci_soft_reset,
504 .clock_init = usb20ehci_clock_init,
505 .clock_enable = usb20ehci_clock_enable,
506 .get_status = usb20host_get_status,
510 struct dwc_otg_platform_data usb20ohci_pdata_rk3126;
513 static const struct of_device_id rk_usb_control_id_table[] = {
515 .compatible = "rockchip,rk3126-usb-control",
520 /*********************************************************************
521 rk3126 usb detections
522 *********************************************************************/
524 #define WAKE_LOCK_TIMEOUT (HZ * 10)
525 static inline void do_wakeup(struct work_struct *work)
527 /* wake up the system */
528 rk_send_wakeup_key();
531 static void usb_battery_charger_detect_work(struct work_struct *work)
533 rk_battery_charger_detect_cb(usb_battery_charger_detect(1));
536 /********** handler for bvalid irq **********/
537 static irqreturn_t bvalid_irq_handler(int irq, void *dev_id)
540 writel(UOC_HIWORD_UPDATE(0x1, 0x1, 15),
541 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
542 #ifdef CONFIG_RK_USB_UART
543 /* usb otg dp/dm switch to usb phy */
544 dwc_otg_uart_mode(NULL, PHY_USB_MODE);
547 if (control_usb->usb_irq_wakeup) {
548 wake_lock_timeout(&control_usb->usb_wakelock,
550 schedule_delayed_work(&control_usb->usb_det_wakeup_work,
554 schedule_delayed_work(&control_usb->usb_charger_det_work, HZ / 10);
559 /********** Handler for linestate irq **********/
560 static irqreturn_t otg0_linestate_irq_handler(int irq, void *dev_id)
563 * Here is a chip hwrdware bug, when disable/enable
564 * linestate irq bit the state machine will not reset
565 * So here have to add a delay to wait the linestate filter
566 * timer run out (linestate filter time had been set to 100us)
570 /* clear and disable irq */
571 writel(UOC_HIWORD_UPDATE(0x2, 0x3, 12),
572 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
575 if (control_usb->usb_irq_wakeup) {
576 wake_lock_timeout(&control_usb->usb_wakelock,
583 static irqreturn_t otg1_linestate_irq_handler(int irq, void *dev_id)
586 * Here is a chip hwrdware bug, when disable/enable
587 * linestate irq bit the state machine will not reset
588 * So here have to add a delay to wait the linestate filter
589 * timer run out (linestate filter time had been set to 100us)
593 /* clear and disable irq */
594 writel(UOC_HIWORD_UPDATE(0x2, 0x3, 14),
595 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
598 if (control_usb->usb_irq_wakeup) {
599 wake_lock_timeout(&control_usb->usb_wakelock,
606 /************* register usb detection irqs **************/
607 static int otg_irq_detect_init(struct platform_device *pdev)
612 if (control_usb->usb_irq_wakeup) {
613 wake_lock_init(&control_usb->usb_wakelock, WAKE_LOCK_SUSPEND,
615 INIT_DELAYED_WORK(&control_usb->usb_det_wakeup_work, do_wakeup);
618 /* register otg_bvalid irq */
619 irq = platform_get_irq_byname(pdev, "otg_bvalid");
620 if ((irq > 0) && control_usb->usb_irq_wakeup) {
621 ret = request_irq(irq, bvalid_irq_handler,
622 0, "otg_bvalid", NULL);
624 dev_err(&pdev->dev, "request_irq %d failed!\n", irq);
626 /* enable bvalid irq */
627 writel(UOC_HIWORD_UPDATE(0x1, 0x1, 14),
628 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
632 if (!control_usb->linestate_wakeup)
635 /* Set otg0&1_linestate_filter time to 100us */
636 writel(UOC_HIWORD_UPDATE(0x0, 0xf, 6), RK_GRF_VIRT + 0x1a0);
638 /* Register otg0_linestate irq */
639 irq = platform_get_irq_byname(pdev, "otg0_linestate");
641 ret = request_irq(irq, otg0_linestate_irq_handler,
642 0, "otg0_linestate", NULL);
644 dev_err(&pdev->dev, "request_irq %d failed!\n", irq);
646 /* Clear otg0_linestate irq */
647 writel(UOC_HIWORD_UPDATE(0x2, 0x3, 12),
648 RK_GRF_VIRT + RK312X_GRF_UOC0_CON0);
652 /* Register otg1_linestate irq */
653 irq = platform_get_irq_byname(pdev, "otg1_linestate");
655 ret = request_irq(irq, otg1_linestate_irq_handler,
656 0, "otg1_linestate", NULL);
658 dev_err(&pdev->dev, "request_irq %d failed!\n", irq);
660 /* Clear otg1_linestate irq */
661 writel(UOC_HIWORD_UPDATE(0x2, 0x3, 14),
662 RK_GRF_VIRT + RK312X_GRF_UOC1_CON5);
668 /********** end of rk3126 usb detections **********/
669 static int rk_usb_control_probe(struct platform_device *pdev)
672 struct device_node *np = pdev->dev.of_node;
676 devm_kzalloc(&pdev->dev, sizeof(*control_usb), GFP_KERNEL);
678 dev_err(&pdev->dev, "unable to alloc memory for control usb\n");
683 control_usb->chip_id = RK3126_USB_CTLR;
684 control_usb->remote_wakeup = of_property_read_bool(np,
685 "rockchip,remote_wakeup");
686 control_usb->usb_irq_wakeup = of_property_read_bool(np,
687 "rockchip,usb_irq_wakeup");
688 control_usb->linestate_wakeup = of_property_read_bool(np,
689 "rockchip,linestate_wakeup");
691 INIT_DELAYED_WORK(&control_usb->usb_charger_det_work,
692 usb_battery_charger_detect_work);
694 control_usb->host_gpios =
695 devm_kzalloc(&pdev->dev, sizeof(struct gpio), GFP_KERNEL);
696 if (!control_usb->host_gpios) {
697 dev_err(&pdev->dev, "unable to alloc memory for host_gpios\n");
702 gpio = of_get_named_gpio(np, "host_drv_gpio", 0);
703 control_usb->host_gpios->gpio = gpio;
705 if (!gpio_is_valid(gpio)) {
706 dev_err(&pdev->dev, "invalid host gpio%d\n", gpio);
708 err = devm_gpio_request(&pdev->dev, gpio, "host_drv_gpio");
711 "failed to request GPIO%d for host_drv\n",
716 gpio_direction_output(control_usb->host_gpios->gpio, 1);
719 control_usb->otg_gpios =
720 devm_kzalloc(&pdev->dev, sizeof(struct gpio), GFP_KERNEL);
721 if (!control_usb->otg_gpios) {
722 dev_err(&pdev->dev, "unable to alloc memory for otg_gpios\n");
727 gpio = of_get_named_gpio(np, "otg_drv_gpio", 0);
728 control_usb->otg_gpios->gpio = gpio;
730 if (!gpio_is_valid(gpio)) {
731 dev_err(&pdev->dev, "invalid otg gpio%d\n", gpio);
733 err = devm_gpio_request(&pdev->dev, gpio, "otg_drv_gpio");
736 "failed to request GPIO%d for otg_drv\n", gpio);
740 gpio_direction_output(control_usb->otg_gpios->gpio, 0);
747 static int rk_usb_control_remove(struct platform_device *pdev)
752 static struct platform_driver rk_usb_control_driver = {
753 .probe = rk_usb_control_probe,
754 .remove = rk_usb_control_remove,
756 .name = "rk3126-usb-control",
757 .owner = THIS_MODULE,
758 .of_match_table = of_match_ptr(rk_usb_control_id_table),
764 static const struct of_device_id dwc_otg_control_usb_id_table[] = {
766 .compatible = "rockchip,rk3126-dwc-control-usb",
772 static int dwc_otg_control_usb_probe(struct platform_device *pdev)
774 struct clk *hclk_usb_peri;
778 dev_err(&pdev->dev, "unable to alloc memory for control usb\n");
783 hclk_usb_peri = devm_clk_get(&pdev->dev, "hclk_usb_peri");
784 if (IS_ERR(hclk_usb_peri)) {
785 dev_err(&pdev->dev, "Failed to get hclk_usb_peri\n");
790 control_usb->hclk_usb_peri = hclk_usb_peri;
791 clk_prepare_enable(hclk_usb_peri);
793 #ifdef CONFIG_USB20_OTG
794 if (usb20otg_get_status(USB_STATUS_BVABLID))
795 schedule_delayed_work(&control_usb->usb_charger_det_work,
799 ret = otg_irq_detect_init(pdev);
806 clk_disable_unprepare(hclk_usb_peri);
811 static int dwc_otg_control_usb_remove(struct platform_device *pdev)
813 clk_disable_unprepare(control_usb->hclk_usb_peri);
817 static struct platform_driver dwc_otg_control_usb_driver = {
818 .probe = dwc_otg_control_usb_probe,
819 .remove = dwc_otg_control_usb_remove,
821 .name = "rk3126-dwc-control-usb",
822 .owner = THIS_MODULE,
823 .of_match_table = of_match_ptr(dwc_otg_control_usb_id_table),
827 static int __init dwc_otg_control_usb_init(void)
831 retval |= platform_driver_register(&rk_usb_control_driver);
832 retval |= platform_driver_register(&dwc_otg_control_usb_driver);
836 subsys_initcall(dwc_otg_control_usb_init);
838 static void __exit dwc_otg_control_usb_exit(void)
840 platform_driver_unregister(&rk_usb_control_driver);
841 platform_driver_unregister(&dwc_otg_control_usb_driver);
844 module_exit(dwc_otg_control_usb_exit);
845 MODULE_ALIAS("platform: dwc_control_usb");
846 MODULE_AUTHOR("RockChip Inc.");
847 MODULE_DESCRIPTION("RockChip Control Module USB Driver");
848 MODULE_LICENSE("GPL v2");