Lines Matching +full:en +full:- +full:usb

1 // SPDX-License-Identifier: GPL-2.0+
9 #include <linux/clk-provider.h>
11 #include <linux/extcon-provider.h>
30 #include <linux/usb/of.h>
31 #include <linux/usb/otg.h>
70 * struct rockchip_chg_det_reg: usb charger detect registers
84 * struct rockchip_usb2phy_port_cfg: usb phy port configuration.
85 * @bypass_otgsuspendm: otg-suspendm bypass control register.
150 * struct rockchip_usb2phy_cfg: usb phy configuration.
151 * @reg: the address offset of grf for usb-phy config.
168 int (*phy_lowpower)(struct rockchip_usb2phy *rphy, bool en);
176 * struct rockchip_usb2phy_port: usb phy port data.
193 * @wakelock: wakeup source for otg-port.
227 * @chg_type: USB charger types.
230 * @vup_gpio: gpio switch for pull-up register on DM.
256 const struct usb2phy_reg *reg, bool en) in property_enable() argument
260 tmp = en ? reg->enable : reg->disable; in property_enable()
261 mask = GENMASK(reg->bitend, reg->bitstart); in property_enable()
262 val = (tmp << reg->bitstart) | (mask << BIT_WRITEABLE_SHIFT); in property_enable()
264 return regmap_write(base, reg->offset, val); in property_enable()
272 unsigned int mask = GENMASK(reg->bitend, reg->bitstart); in property_enabled()
274 ret = regmap_read(base, reg->offset, &orig); in property_enabled()
278 tmp = (orig & mask) >> reg->bitstart; in property_enabled()
279 return tmp == reg->enable; in property_enabled()
289 if (!property_enabled(rphy->grf, &rphy->phy_cfg->clkout_ctl)) { in rockchip_usb2phy_clk480m_prepare()
290 ret = property_enable(rphy->grf, &rphy->phy_cfg->clkout_ctl, in rockchip_usb2phy_clk480m_prepare()
308 property_enable(rphy->grf, &rphy->phy_cfg->clkout_ctl, false); in rockchip_usb2phy_clk480m_unprepare()
316 return property_enabled(rphy->grf, &rphy->phy_cfg->clkout_ctl); in rockchip_usb2phy_clk480m_prepared()
337 of_clk_del_provider(rphy->dev->of_node); in rockchip_usb2phy_clk480m_unregister()
338 clk_unregister(rphy->clk480m); in rockchip_usb2phy_clk480m_unregister()
344 struct device_node *node = rphy->dev->of_node; in rockchip_usb2phy_clk480m_register()
355 of_property_read_string(node, "clock-output-names", &init.name); in rockchip_usb2phy_clk480m_register()
366 rphy->clk480m_hw.init = &init; in rockchip_usb2phy_clk480m_register()
369 rphy->clk480m = clk_register(rphy->dev, &rphy->clk480m_hw); in rockchip_usb2phy_clk480m_register()
370 if (IS_ERR(rphy->clk480m)) { in rockchip_usb2phy_clk480m_register()
371 ret = PTR_ERR(rphy->clk480m); in rockchip_usb2phy_clk480m_register()
375 ret = of_clk_add_provider(node, of_clk_src_simple_get, rphy->clk480m); in rockchip_usb2phy_clk480m_register()
379 ret = devm_add_action(rphy->dev, rockchip_usb2phy_clk480m_unregister, in rockchip_usb2phy_clk480m_register()
389 clk_unregister(rphy->clk480m); in rockchip_usb2phy_clk480m_register()
394 /* The caller must hold rport->mutex lock */
397 bool en) in rockchip_usb2phy_enable_id_irq() argument
401 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_id_irq()
402 &rport->port_cfg->idfall_det_clr, true); in rockchip_usb2phy_enable_id_irq()
406 ret = property_enable(rphy->grf, &rport->port_cfg->idfall_det_en, en); in rockchip_usb2phy_enable_id_irq()
410 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_id_irq()
411 &rport->port_cfg->idrise_det_clr, true); in rockchip_usb2phy_enable_id_irq()
415 ret = property_enable(rphy->grf, &rport->port_cfg->idrise_det_en, en); in rockchip_usb2phy_enable_id_irq()
420 /* The caller must hold rport->mutex lock */
423 bool en) in rockchip_usb2phy_enable_vbus_irq() argument
427 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_vbus_irq()
428 &rport->port_cfg->bvalidfall_det_clr, true); in rockchip_usb2phy_enable_vbus_irq()
432 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_vbus_irq()
433 &rport->port_cfg->bvalidfall_det_en, en); in rockchip_usb2phy_enable_vbus_irq()
437 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_vbus_irq()
438 &rport->port_cfg->bvalidrise_det_clr, true); in rockchip_usb2phy_enable_vbus_irq()
442 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_vbus_irq()
443 &rport->port_cfg->bvalidrise_det_en, en); in rockchip_usb2phy_enable_vbus_irq()
450 bool en) in rockchip_usb2phy_enable_line_irq() argument
454 ret = property_enable(rphy->grf, &rport->port_cfg->ls_det_clr, true); in rockchip_usb2phy_enable_line_irq()
458 ret = property_enable(rphy->grf, &rport->port_cfg->ls_det_en, en); in rockchip_usb2phy_enable_line_irq()
466 bool en) in rockchip_usb2phy_enable_disconn_irq() argument
470 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_disconn_irq()
471 &rport->port_cfg->disconrise_det_clr, true); in rockchip_usb2phy_enable_disconn_irq()
475 ret = property_enable(rphy->grf, in rockchip_usb2phy_enable_disconn_irq()
476 &rport->port_cfg->disconrise_det_en, en); in rockchip_usb2phy_enable_disconn_irq()
484 struct device_node *node = rphy->dev->of_node; in rockchip_usb2phy_extcon_register()
488 edev = extcon_get_edev_by_phandle(rphy->dev, 0); in rockchip_usb2phy_extcon_register()
490 if (PTR_ERR(edev) != -EPROBE_DEFER) in rockchip_usb2phy_extcon_register()
491 dev_err(rphy->dev, in rockchip_usb2phy_extcon_register()
497 edev = devm_extcon_dev_allocate(rphy->dev, in rockchip_usb2phy_extcon_register()
501 return -ENOMEM; in rockchip_usb2phy_extcon_register()
503 ret = devm_extcon_dev_register(rphy->dev, edev); in rockchip_usb2phy_extcon_register()
505 dev_err(rphy->dev, in rockchip_usb2phy_extcon_register()
510 rphy->edev_self = true; in rockchip_usb2phy_extcon_register()
513 rphy->edev = edev; in rockchip_usb2phy_extcon_register()
521 struct rockchip_usb2phy *rphy = dev_get_drvdata(phy->dev.parent); in rockchip_usb2phy_init()
524 mutex_lock(&rport->mutex); in rockchip_usb2phy_init()
527 if (rport->disconnect_irq > 0) { in rockchip_usb2phy_init()
530 dev_err(rphy->dev, "failed to enable disconnect irq\n"); in rockchip_usb2phy_init()
536 if (rport->ls_irq > 0 && in rockchip_usb2phy_init()
537 (rport->port_id == USB2PHY_PORT_HOST || in rockchip_usb2phy_init()
538 rport->mode == USB_DR_MODE_HOST)) { in rockchip_usb2phy_init()
541 dev_err(rphy->dev, "failed to enable linestate irq\n"); in rockchip_usb2phy_init()
547 if (rport->bvalid_irq > 0) { in rockchip_usb2phy_init()
550 dev_err(rphy->dev, in rockchip_usb2phy_init()
555 rport->vbus_attached = in rockchip_usb2phy_init()
556 property_enabled(rphy->grf, in rockchip_usb2phy_init()
557 &rport->port_cfg->utmi_bvalid); in rockchip_usb2phy_init()
558 schedule_delayed_work(&rport->otg_sm_work, OTG_SCHEDULE_DELAY); in rockchip_usb2phy_init()
562 if (rport->id_irq > 0) { in rockchip_usb2phy_init()
566 dev_err(rphy->dev, in rockchip_usb2phy_init()
573 mutex_unlock(&rport->mutex); in rockchip_usb2phy_init()
580 struct rockchip_usb2phy *rphy = dev_get_drvdata(phy->dev.parent); in rockchip_usb2phy_power_on()
583 dev_dbg(&rport->phy->dev, "port power on\n"); in rockchip_usb2phy_power_on()
585 mutex_lock(&rport->mutex); in rockchip_usb2phy_power_on()
587 if (!rport->suspended) { in rockchip_usb2phy_power_on()
592 ret = property_enable(rphy->grf, &rport->port_cfg->phy_sus, false); in rockchip_usb2phy_power_on()
599 rport->suspended = false; in rockchip_usb2phy_power_on()
602 mutex_unlock(&rport->mutex); in rockchip_usb2phy_power_on()
610 struct rockchip_usb2phy *rphy = dev_get_drvdata(phy->dev.parent); in rockchip_usb2phy_power_off()
613 dev_dbg(&rport->phy->dev, "port power off\n"); in rockchip_usb2phy_power_off()
615 mutex_lock(&rport->mutex); in rockchip_usb2phy_power_off()
617 if (rport->suspended) { in rockchip_usb2phy_power_off()
622 ret = property_enable(rphy->grf, &rport->port_cfg->phy_sus, true); in rockchip_usb2phy_power_off()
626 rport->suspended = true; in rockchip_usb2phy_power_off()
629 mutex_unlock(&rport->mutex); in rockchip_usb2phy_power_off()
640 bool en) in rockchip_set_vbus_power() argument
644 if (!rport->vbus) in rockchip_set_vbus_power()
647 if (en && !rport->vbus_enabled) { in rockchip_set_vbus_power()
648 ret = regulator_enable(rport->vbus); in rockchip_set_vbus_power()
650 dev_err(&rport->phy->dev, in rockchip_set_vbus_power()
652 } else if (!en && rport->vbus_enabled) { in rockchip_set_vbus_power()
653 ret = regulator_disable(rport->vbus); in rockchip_set_vbus_power()
657 rport->vbus_enabled = en; in rockchip_set_vbus_power()
666 struct rockchip_usb2phy *rphy = dev_get_drvdata(phy->dev.parent); in rockchip_usb2phy_set_mode()
669 if (rport->port_id != USB2PHY_PORT_OTG) in rockchip_usb2phy_set_mode()
678 extcon_set_state_sync(rphy->edev, EXTCON_USB_VBUS_EN, false); in rockchip_usb2phy_set_mode()
684 dev_err(&rport->phy->dev, in rockchip_usb2phy_set_mode()
689 extcon_set_state_sync(rphy->edev, EXTCON_USB_VBUS_EN, true); in rockchip_usb2phy_set_mode()
692 dev_info(&rport->phy->dev, "illegal mode\n"); in rockchip_usb2phy_set_mode()
707 switch (rphy->cal_state) { in rv1126_wait_timer_fn()
710 writel(0x5d, rphy->base + 0x20); in rv1126_wait_timer_fn()
712 reg = readl(rphy->base + 0x10); in rv1126_wait_timer_fn()
714 /* open the pull-up resistor */ in rv1126_wait_timer_fn()
715 gpiod_set_value(rphy->vup_gpio, 1); in rv1126_wait_timer_fn()
717 writel(0x08, rphy->base + 0x00); in rv1126_wait_timer_fn()
722 writel(0x7c, rphy->base + 0x10); in rv1126_wait_timer_fn()
725 hrtimer_forward_now(&rphy->wait_timer, delay); in rv1126_wait_timer_fn()
726 rphy->cal_state = CURRENT_COMPENSATION; in rv1126_wait_timer_fn()
730 /* close the pull-up resistor */ in rv1126_wait_timer_fn()
731 gpiod_set_value(rphy->vup_gpio, 0); in rv1126_wait_timer_fn()
734 * correct the effect of pull-up resistor in rv1126_wait_timer_fn()
736 writel(0xe8, rphy->base + 0x00); in rv1126_wait_timer_fn()
738 writel(reg, rphy->base + 0x10); in rv1126_wait_timer_fn()
741 hrtimer_forward_now(&rphy->wait_timer, delay); in rv1126_wait_timer_fn()
742 rphy->cal_state = CALIBRATION_DONE; in rv1126_wait_timer_fn()
747 writel(0x4d, rphy->base + 0x20); in rv1126_wait_timer_fn()
760 struct rockchip_usb2phy *rphy = dev_get_drvdata(phy->dev.parent); in rv1126_usb2phy_calibrate()
763 if (rport->port_id != USB2PHY_PORT_OTG) in rv1126_usb2phy_calibrate()
767 rphy->cal_state = SWING_CALIBRATION; in rv1126_usb2phy_calibrate()
768 hrtimer_start(&rphy->wait_timer, delay, HRTIMER_MODE_REL); in rv1126_usb2phy_calibrate()
803 mutex_lock(&rport->mutex); in rockchip_chg_detect()
805 reset_control_assert(rphy->reset); in rockchip_chg_detect()
808 property_enable(rphy->grf, &rphy->phy_cfg->chg_det.chg_en, true); in rockchip_chg_detect()
809 property_enable(rphy->grf, &rphy->phy_cfg->chg_det.chg_rst, false); in rockchip_chg_detect()
814 chg_valid = property_enabled(rphy->grf, in rockchip_chg_detect()
815 &rphy->phy_cfg->chg_det.chg_valid); in rockchip_chg_detect()
817 property_enabled(rphy->grf, in rockchip_chg_detect()
818 &rphy->phy_cfg->chg_det.phy_connect); in rockchip_chg_detect()
827 rphy->chg_type = POWER_SUPPLY_TYPE_USB; in rockchip_chg_detect()
830 rphy->chg_type = POWER_SUPPLY_TYPE_USB_DCP; in rockchip_chg_detect()
833 rphy->chg_type = POWER_SUPPLY_TYPE_USB_CDP; in rockchip_chg_detect()
838 rphy->chg_type = POWER_SUPPLY_TYPE_UNKNOWN; in rockchip_chg_detect()
842 dev_info(&rport->phy->dev, "charger = %s\n", in rockchip_chg_detect()
843 chg_to_string(rphy->chg_type)); in rockchip_chg_detect()
846 reset_control_deassert(rphy->reset); in rockchip_chg_detect()
851 property_enable(rphy->grf, &rphy->phy_cfg->chg_det.chg_rst, true); in rockchip_chg_detect()
852 property_enable(rphy->grf, &rphy->phy_cfg->chg_det.chg_en, false); in rockchip_chg_detect()
854 mutex_unlock(&rport->mutex); in rockchip_chg_detect()
860 struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent); in rockchip_usb2phy_disconnect_irq()
862 if (!property_enabled(rphy->grf, &rport->port_cfg->disconrise_det_st)) in rockchip_usb2phy_disconnect_irq()
865 mutex_lock(&rport->mutex); in rockchip_usb2phy_disconnect_irq()
868 property_enable(rphy->grf, &rport->port_cfg->disconrise_det_clr, true); in rockchip_usb2phy_disconnect_irq()
870 mutex_unlock(&rport->mutex); in rockchip_usb2phy_disconnect_irq()
874 if (!property_enabled(rphy->grf, &rport->port_cfg->utmi_hostdet)) in rockchip_usb2phy_disconnect_irq()
877 mutex_lock(&rport->mutex); in rockchip_usb2phy_disconnect_irq()
882 mutex_unlock(&rport->mutex); in rockchip_usb2phy_disconnect_irq()
884 dev_dbg(&rport->phy->dev, "host disconnected\n"); in rockchip_usb2phy_disconnect_irq()
885 rockchip_usb2phy_power_off(rport->phy); in rockchip_usb2phy_disconnect_irq()
893 struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent); in rockchip_usb2phy_linestate_irq()
895 if (!property_enabled(rphy->grf, &rport->port_cfg->ls_det_st)) in rockchip_usb2phy_linestate_irq()
898 dev_dbg(&rport->phy->dev, "linestate interrupt\n"); in rockchip_usb2phy_linestate_irq()
900 mutex_lock(&rport->mutex); in rockchip_usb2phy_linestate_irq()
905 mutex_unlock(&rport->mutex); in rockchip_usb2phy_linestate_irq()
907 if (!rport->suspended) in rockchip_usb2phy_linestate_irq()
910 if (rport->port_id != USB2PHY_PORT_HOST && in rockchip_usb2phy_linestate_irq()
911 rport->mode != USB_DR_MODE_HOST) in rockchip_usb2phy_linestate_irq()
914 dev_dbg(&rport->phy->dev, "host connected\n"); in rockchip_usb2phy_linestate_irq()
915 rockchip_usb2phy_power_on(rport->phy); in rockchip_usb2phy_linestate_irq()
926 struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent); in rockchip_usb2phy_otg_sm_work()
928 if (rport->vbus_attached) { in rockchip_usb2phy_otg_sm_work()
929 if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) || in rockchip_usb2phy_otg_sm_work()
930 extcon_get_state(rphy->edev, EXTCON_USB_VBUS_EN) || in rockchip_usb2phy_otg_sm_work()
931 !property_enabled(rphy->grf, &rport->port_cfg->utmi_iddig)) in rockchip_usb2phy_otg_sm_work()
934 if (rport->perip_connected) in rockchip_usb2phy_otg_sm_work()
939 switch (rphy->chg_type) { in rockchip_usb2phy_otg_sm_work()
941 dev_dbg(&rport->phy->dev, "sdp cable is connected\n"); in rockchip_usb2phy_otg_sm_work()
942 wake_lock(&rport->wakelock); in rockchip_usb2phy_otg_sm_work()
944 rport->perip_connected = true; in rockchip_usb2phy_otg_sm_work()
947 dev_dbg(&rport->phy->dev, "dcp cable is connected\n"); in rockchip_usb2phy_otg_sm_work()
951 dev_dbg(&rport->phy->dev, "cdp cable is connected\n"); in rockchip_usb2phy_otg_sm_work()
952 wake_lock(&rport->wakelock); in rockchip_usb2phy_otg_sm_work()
954 rport->perip_connected = true; in rockchip_usb2phy_otg_sm_work()
960 if (!rport->perip_connected) { in rockchip_usb2phy_otg_sm_work()
961 if (extcon_get_state(rphy->edev, EXTCON_CHG_USB_DCP) > 0) in rockchip_usb2phy_otg_sm_work()
962 extcon_set_state_sync(rphy->edev, EXTCON_CHG_USB_DCP, 0); in rockchip_usb2phy_otg_sm_work()
966 dev_dbg(&rport->phy->dev, "usb peripheral disconnect\n"); in rockchip_usb2phy_otg_sm_work()
967 wake_unlock(&rport->wakelock); in rockchip_usb2phy_otg_sm_work()
968 rport->perip_connected = false; in rockchip_usb2phy_otg_sm_work()
969 rphy->chg_type = POWER_SUPPLY_TYPE_UNKNOWN; in rockchip_usb2phy_otg_sm_work()
972 if (extcon_get_state(rphy->edev, cable) != rport->vbus_attached) { in rockchip_usb2phy_otg_sm_work()
973 extcon_set_state(rphy->edev, cable, rport->vbus_attached); in rockchip_usb2phy_otg_sm_work()
974 extcon_sync(rphy->edev, cable); in rockchip_usb2phy_otg_sm_work()
977 if (rphy->edev_self && (extcon_get_state(rphy->edev, EXTCON_USB) != in rockchip_usb2phy_otg_sm_work()
978 rport->perip_connected)) { in rockchip_usb2phy_otg_sm_work()
979 extcon_set_state(rphy->edev, EXTCON_USB, in rockchip_usb2phy_otg_sm_work()
980 rport->perip_connected); in rockchip_usb2phy_otg_sm_work()
982 extcon_sync(rphy->edev, EXTCON_USB); in rockchip_usb2phy_otg_sm_work()
983 extcon_sync(rphy->edev, EXTCON_USB_HOST); in rockchip_usb2phy_otg_sm_work()
996 for (index = 0; index < rphy->phy_cfg->num_ports; index++) { in otg_mode_show()
997 rport = &rphy->ports[index]; in otg_mode_show()
998 if (rport->port_id == USB2PHY_PORT_OTG) in otg_mode_show()
1003 dev_err(rphy->dev, "Fail to get otg port\n"); in otg_mode_show()
1004 return -EINVAL; in otg_mode_show()
1005 } else if (rport->port_id != USB2PHY_PORT_OTG) { in otg_mode_show()
1006 dev_err(rphy->dev, "No support otg\n"); in otg_mode_show()
1007 return -EINVAL; in otg_mode_show()
1010 switch (rport->mode) { in otg_mode_show()
1023 return -EINVAL; in otg_mode_show()
1036 for (index = 0; index < rphy->phy_cfg->num_ports; index++) { in otg_mode_store()
1037 rport = &rphy->ports[index]; in otg_mode_store()
1038 if (rport->port_id == USB2PHY_PORT_OTG) in otg_mode_store()
1043 dev_err(rphy->dev, "Fail to get otg port!\n"); in otg_mode_store()
1044 rc = -EINVAL; in otg_mode_store()
1046 } else if (rport->port_id != USB2PHY_PORT_OTG || in otg_mode_store()
1047 rport->mode == USB_DR_MODE_UNKNOWN) { in otg_mode_store()
1048 dev_err(rphy->dev, "No support otg!\n"); in otg_mode_store()
1049 rc = -EINVAL; in otg_mode_store()
1053 mutex_lock(&rport->mutex); in otg_mode_store()
1062 dev_err(rphy->dev, "Error mode! Input 'otg' or 'host' or 'peripheral'\n"); in otg_mode_store()
1063 rc = -EINVAL; in otg_mode_store()
1067 if (rport->mode == new_dr_mode) { in otg_mode_store()
1068 dev_warn(rphy->dev, "Same as current mode\n"); in otg_mode_store()
1072 rport->mode = new_dr_mode; in otg_mode_store()
1074 switch (rport->mode) { in otg_mode_store()
1076 rport->perip_connected = false; in otg_mode_store()
1077 extcon_set_state(rphy->edev, EXTCON_USB, false); in otg_mode_store()
1078 extcon_set_state(rphy->edev, EXTCON_USB_HOST, true); in otg_mode_store()
1079 extcon_sync(rphy->edev, EXTCON_USB); in otg_mode_store()
1080 extcon_sync(rphy->edev, EXTCON_USB_HOST); in otg_mode_store()
1081 rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_HOST, 0); in otg_mode_store()
1082 property_enable(rphy->grf, &rport->port_cfg->idpullup, in otg_mode_store()
1084 property_enable(rphy->grf, &rport->port_cfg->iddig_output, in otg_mode_store()
1086 property_enable(rphy->grf, &rport->port_cfg->iddig_en, in otg_mode_store()
1090 rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_DEVICE, 0); in otg_mode_store()
1091 property_enable(rphy->grf, &rport->port_cfg->idpullup, in otg_mode_store()
1093 property_enable(rphy->grf, &rport->port_cfg->iddig_output, in otg_mode_store()
1095 property_enable(rphy->grf, &rport->port_cfg->iddig_en, in otg_mode_store()
1099 rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_OTG, 0); in otg_mode_store()
1100 property_enable(rphy->grf, &rport->port_cfg->iddig_output, in otg_mode_store()
1102 property_enable(rphy->grf, &rport->port_cfg->iddig_en, in otg_mode_store()
1110 if ((rport->mode == USB_DR_MODE_PERIPHERAL || in otg_mode_store()
1111 rport->mode == USB_DR_MODE_OTG) && property_enabled(rphy->grf, in otg_mode_store()
1112 &rport->port_cfg->utmi_bvalid)) { in otg_mode_store()
1113 rport->vbus_attached = true; in otg_mode_store()
1114 cancel_delayed_work_sync(&rport->otg_sm_work); in otg_mode_store()
1115 schedule_delayed_work(&rport->otg_sm_work, OTG_SCHEDULE_DELAY); in otg_mode_store()
1118 mutex_unlock(&rport->mutex); in otg_mode_store()
1139 struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent); in rockchip_usb2phy_bvalid_irq()
1141 if (!property_enabled(rphy->grf, &rport->port_cfg->bvalidfall_det_st) && in rockchip_usb2phy_bvalid_irq()
1142 !property_enabled(rphy->grf, &rport->port_cfg->bvalidrise_det_st)) in rockchip_usb2phy_bvalid_irq()
1145 mutex_lock(&rport->mutex); in rockchip_usb2phy_bvalid_irq()
1148 if (property_enabled(rphy->grf, &rport->port_cfg->bvalidfall_det_st)) { in rockchip_usb2phy_bvalid_irq()
1149 property_enable(rphy->grf, &rport->port_cfg->bvalidfall_det_clr, in rockchip_usb2phy_bvalid_irq()
1151 rport->vbus_attached = false; in rockchip_usb2phy_bvalid_irq()
1152 } else if (property_enabled(rphy->grf, in rockchip_usb2phy_bvalid_irq()
1153 &rport->port_cfg->bvalidrise_det_st)) { in rockchip_usb2phy_bvalid_irq()
1154 property_enable(rphy->grf, &rport->port_cfg->bvalidrise_det_clr, in rockchip_usb2phy_bvalid_irq()
1156 rport->vbus_attached = true; in rockchip_usb2phy_bvalid_irq()
1159 mutex_unlock(&rport->mutex); in rockchip_usb2phy_bvalid_irq()
1161 cancel_delayed_work_sync(&rport->otg_sm_work); in rockchip_usb2phy_bvalid_irq()
1162 rockchip_usb2phy_otg_sm_work(&rport->otg_sm_work.work); in rockchip_usb2phy_bvalid_irq()
1170 struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent); in rockchip_usb2phy_id_irq()
1173 if (!property_enabled(rphy->grf, &rport->port_cfg->idfall_det_st) && in rockchip_usb2phy_id_irq()
1174 !property_enabled(rphy->grf, &rport->port_cfg->idrise_det_st)) in rockchip_usb2phy_id_irq()
1177 mutex_lock(&rport->mutex); in rockchip_usb2phy_id_irq()
1180 if (property_enabled(rphy->grf, &rport->port_cfg->idfall_det_st)) { in rockchip_usb2phy_id_irq()
1181 property_enable(rphy->grf, &rport->port_cfg->idfall_det_clr, in rockchip_usb2phy_id_irq()
1184 } else if (property_enabled(rphy->grf, in rockchip_usb2phy_id_irq()
1185 &rport->port_cfg->idrise_det_st)) { in rockchip_usb2phy_id_irq()
1186 property_enable(rphy->grf, &rport->port_cfg->idrise_det_clr, in rockchip_usb2phy_id_irq()
1191 dev_dbg(&rport->phy->dev, "id %s interrupt\n", in rockchip_usb2phy_id_irq()
1193 extcon_set_state(rphy->edev, EXTCON_USB_HOST, cable_vbus_state); in rockchip_usb2phy_id_irq()
1194 extcon_set_state(rphy->edev, EXTCON_USB_VBUS_EN, cable_vbus_state); in rockchip_usb2phy_id_irq()
1196 extcon_sync(rphy->edev, EXTCON_USB_HOST); in rockchip_usb2phy_id_irq()
1197 extcon_sync(rphy->edev, EXTCON_USB_VBUS_EN); in rockchip_usb2phy_id_irq()
1201 mutex_unlock(&rport->mutex); in rockchip_usb2phy_id_irq()
1213 mutex_init(&rport->mutex); in rockchip_usb2phy_otg_port_init()
1215 rport->port_id = USB2PHY_PORT_OTG; in rockchip_usb2phy_otg_port_init()
1216 rport->port_cfg = &rphy->phy_cfg->port_cfgs[USB2PHY_PORT_OTG]; in rockchip_usb2phy_otg_port_init()
1217 rport->vbus_attached = false; in rockchip_usb2phy_otg_port_init()
1218 rport->vbus_enabled = false; in rockchip_usb2phy_otg_port_init()
1219 rport->prev_iddig = true; in rockchip_usb2phy_otg_port_init()
1221 rport->vbus_always_on = in rockchip_usb2phy_otg_port_init()
1222 of_property_read_bool(child_np, "rockchip,vbus-always-on"); in rockchip_usb2phy_otg_port_init()
1229 rport->vbus = devm_regulator_get_optional(&rport->phy->dev, "vbus"); in rockchip_usb2phy_otg_port_init()
1230 if (IS_ERR(rport->vbus)) { in rockchip_usb2phy_otg_port_init()
1231 if (PTR_ERR(rport->vbus) == -EPROBE_DEFER) in rockchip_usb2phy_otg_port_init()
1232 return -EPROBE_DEFER; in rockchip_usb2phy_otg_port_init()
1234 dev_warn(&rport->phy->dev, in rockchip_usb2phy_otg_port_init()
1236 rport->vbus = NULL; in rockchip_usb2phy_otg_port_init()
1242 * So we disable the otg_suspend_bypass to let hardware auto-switch in rockchip_usb2phy_otg_port_init()
1245 property_enable(rphy->grf, &rport->port_cfg->bypass_otgsuspendm, in rockchip_usb2phy_otg_port_init()
1249 rport->ls_irq = of_irq_get_byname(child_np, "linestate"); in rockchip_usb2phy_otg_port_init()
1250 if (rport->ls_irq <= 0) { in rockchip_usb2phy_otg_port_init()
1251 dev_err(rphy->dev, "no linestate irq provided\n"); in rockchip_usb2phy_otg_port_init()
1252 return -EINVAL; in rockchip_usb2phy_otg_port_init()
1255 ret = devm_request_threaded_irq(rphy->dev, rport->ls_irq, NULL, in rockchip_usb2phy_otg_port_init()
1260 dev_err(rphy->dev, "failed to request linestate irq handle\n"); in rockchip_usb2phy_otg_port_init()
1264 rport->mode = of_usb_get_dr_mode_by_phy(child_np, -1); in rockchip_usb2phy_otg_port_init()
1265 if (rport->mode == USB_DR_MODE_HOST) { in rockchip_usb2phy_otg_port_init()
1266 if (rphy->edev_self) { in rockchip_usb2phy_otg_port_init()
1267 extcon_set_state(rphy->edev, EXTCON_USB, false); in rockchip_usb2phy_otg_port_init()
1268 extcon_set_state(rphy->edev, EXTCON_USB_HOST, true); in rockchip_usb2phy_otg_port_init()
1270 rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_HOST, 0); in rockchip_usb2phy_otg_port_init()
1277 property_enable(rphy->grf, &rport->port_cfg->idpullup, false); in rockchip_usb2phy_otg_port_init()
1280 rport->disconnect_irq = of_irq_get_byname(child_np, in rockchip_usb2phy_otg_port_init()
1282 if (rport->disconnect_irq <= 0) { in rockchip_usb2phy_otg_port_init()
1283 dev_err(rphy->dev, "no disconnect irq provided\n"); in rockchip_usb2phy_otg_port_init()
1284 return -EINVAL; in rockchip_usb2phy_otg_port_init()
1287 ret = devm_request_threaded_irq(rphy->dev, in rockchip_usb2phy_otg_port_init()
1288 rport->disconnect_irq, NULL, in rockchip_usb2phy_otg_port_init()
1293 dev_err(rphy->dev, in rockchip_usb2phy_otg_port_init()
1301 if (rphy->edev_self) { in rockchip_usb2phy_otg_port_init()
1302 rport->id_irq = of_irq_get_byname(child_np, "otg-id"); in rockchip_usb2phy_otg_port_init()
1303 if (rport->id_irq <= 0) { in rockchip_usb2phy_otg_port_init()
1304 dev_err(rphy->dev, "no otg id irq provided\n"); in rockchip_usb2phy_otg_port_init()
1305 return -EINVAL; in rockchip_usb2phy_otg_port_init()
1308 ret = devm_request_threaded_irq(rphy->dev, in rockchip_usb2phy_otg_port_init()
1309 rport->id_irq, NULL, in rockchip_usb2phy_otg_port_init()
1315 dev_err(rphy->dev, in rockchip_usb2phy_otg_port_init()
1316 "failed to request otg-id irq handle\n"); in rockchip_usb2phy_otg_port_init()
1320 iddig = property_enabled(rphy->grf, in rockchip_usb2phy_otg_port_init()
1321 &rport->port_cfg->utmi_iddig); in rockchip_usb2phy_otg_port_init()
1323 extcon_set_state(rphy->edev, EXTCON_USB, false); in rockchip_usb2phy_otg_port_init()
1324 extcon_set_state(rphy->edev, EXTCON_USB_HOST, true); in rockchip_usb2phy_otg_port_init()
1325 extcon_set_state(rphy->edev, EXTCON_USB_VBUS_EN, true); in rockchip_usb2phy_otg_port_init()
1333 if (rport->vbus_always_on) in rockchip_usb2phy_otg_port_init()
1337 rport->bvalid_irq = of_irq_get_byname(child_np, "otg-bvalid"); in rockchip_usb2phy_otg_port_init()
1338 if (rport->bvalid_irq <= 0) { in rockchip_usb2phy_otg_port_init()
1339 dev_err(rphy->dev, "no vbus valid irq provided\n"); in rockchip_usb2phy_otg_port_init()
1340 return -EINVAL; in rockchip_usb2phy_otg_port_init()
1343 ret = devm_request_threaded_irq(rphy->dev, rport->bvalid_irq, in rockchip_usb2phy_otg_port_init()
1350 dev_err(rphy->dev, in rockchip_usb2phy_otg_port_init()
1351 "failed to request otg-bvalid irq handle\n"); in rockchip_usb2phy_otg_port_init()
1355 INIT_DELAYED_WORK(&rport->otg_sm_work, rockchip_usb2phy_otg_sm_work); in rockchip_usb2phy_otg_port_init()
1359 * Let us put phy-port into suspend mode here for saving power in rockchip_usb2phy_otg_port_init()
1360 * consumption, and usb controller will resume it during probe in rockchip_usb2phy_otg_port_init()
1363 ret = property_enable(rphy->grf, &rport->port_cfg->phy_sus, true); in rockchip_usb2phy_otg_port_init()
1367 rport->suspended = true; in rockchip_usb2phy_otg_port_init()
1369 wake_lock_init(&rport->wakelock, WAKE_LOCK_SUSPEND, "rockchip_otg"); in rockchip_usb2phy_otg_port_init()
1380 mutex_init(&rport->mutex); in rockchip_usb2phy_host_port_init()
1382 rport->port_id = USB2PHY_PORT_HOST; in rockchip_usb2phy_host_port_init()
1383 rport->port_cfg = &rphy->phy_cfg->port_cfgs[USB2PHY_PORT_HOST]; in rockchip_usb2phy_host_port_init()
1386 rport->disconnect_irq = of_irq_get_byname(child_np, "disconnect"); in rockchip_usb2phy_host_port_init()
1387 if (rport->disconnect_irq <= 0) { in rockchip_usb2phy_host_port_init()
1388 dev_err(rphy->dev, "no disconnect irq provided\n"); in rockchip_usb2phy_host_port_init()
1389 return -EINVAL; in rockchip_usb2phy_host_port_init()
1392 ret = devm_request_threaded_irq(rphy->dev, rport->disconnect_irq, NULL, in rockchip_usb2phy_host_port_init()
1397 dev_err(rphy->dev, "failed to request disconnect irq handle\n"); in rockchip_usb2phy_host_port_init()
1402 rport->ls_irq = of_irq_get_byname(child_np, "linestate"); in rockchip_usb2phy_host_port_init()
1403 if (rport->ls_irq <= 0) { in rockchip_usb2phy_host_port_init()
1404 dev_err(rphy->dev, "no linestate irq provided\n"); in rockchip_usb2phy_host_port_init()
1405 return -EINVAL; in rockchip_usb2phy_host_port_init()
1408 ret = devm_request_threaded_irq(rphy->dev, rport->ls_irq, NULL, in rockchip_usb2phy_host_port_init()
1413 dev_err(rphy->dev, "failed to request linestate irq handle\n"); in rockchip_usb2phy_host_port_init()
1418 * Let us put phy-port into suspend mode here for saving power in rockchip_usb2phy_host_port_init()
1419 * consumption, and usb controller will resume it during probe in rockchip_usb2phy_host_port_init()
1422 ret = property_enable(rphy->grf, &rport->port_cfg->phy_sus, true); in rockchip_usb2phy_host_port_init()
1426 rport->suspended = true; in rockchip_usb2phy_host_port_init()
1433 struct device *dev = &pdev->dev; in rockchip_usb2phy_probe()
1434 struct device_node *np = dev->of_node; in rockchip_usb2phy_probe()
1447 return -ENOMEM; in rockchip_usb2phy_probe()
1452 return -ENODEV; in rockchip_usb2phy_probe()
1455 rphy->base = devm_ioremap_resource(dev, res); in rockchip_usb2phy_probe()
1456 if (IS_ERR(rphy->base)) { in rockchip_usb2phy_probe()
1458 return PTR_ERR(rphy->base); in rockchip_usb2phy_probe()
1461 rphy->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); in rockchip_usb2phy_probe()
1462 if (IS_ERR(rphy->grf)) in rockchip_usb2phy_probe()
1463 return PTR_ERR(rphy->grf); in rockchip_usb2phy_probe()
1466 rphy->reset = devm_reset_control_get(dev, "u2phy"); in rockchip_usb2phy_probe()
1467 if (IS_ERR(rphy->reset)) in rockchip_usb2phy_probe()
1468 return PTR_ERR(rphy->reset); in rockchip_usb2phy_probe()
1470 rphy->vup_gpio = devm_gpiod_get_optional(dev, "vup", GPIOD_OUT_LOW); in rockchip_usb2phy_probe()
1471 if (IS_ERR(rphy->vup_gpio)) { in rockchip_usb2phy_probe()
1472 ret = PTR_ERR(rphy->vup_gpio); in rockchip_usb2phy_probe()
1477 reset_control_assert(rphy->reset); in rockchip_usb2phy_probe()
1479 reset_control_deassert(rphy->reset); in rockchip_usb2phy_probe()
1481 match = of_match_device(dev->driver->of_match_table, dev); in rockchip_usb2phy_probe()
1482 if (!match || !match->data) { in rockchip_usb2phy_probe()
1484 return -EINVAL; in rockchip_usb2phy_probe()
1489 np->name); in rockchip_usb2phy_probe()
1490 return -EINVAL; in rockchip_usb2phy_probe()
1493 rphy->dev = dev; in rockchip_usb2phy_probe()
1494 phy_cfgs = match->data; in rockchip_usb2phy_probe()
1500 rphy->phy_cfg = &phy_cfgs[index]; in rockchip_usb2phy_probe()
1505 if (!rphy->phy_cfg) { in rockchip_usb2phy_probe()
1506 dev_err(dev, "no phy-config can be matched with %s node\n", in rockchip_usb2phy_probe()
1507 np->name); in rockchip_usb2phy_probe()
1508 return -EINVAL; in rockchip_usb2phy_probe()
1511 rphy->num_clks = rphy->phy_cfg->num_clks; in rockchip_usb2phy_probe()
1513 rphy->clks = devm_kmemdup(dev, rphy->phy_cfg->clks, in rockchip_usb2phy_probe()
1514 rphy->num_clks * sizeof(struct clk_bulk_data), in rockchip_usb2phy_probe()
1517 if (!rphy->clks) in rockchip_usb2phy_probe()
1518 return -ENOMEM; in rockchip_usb2phy_probe()
1520 ret = devm_clk_bulk_get(dev, rphy->num_clks, rphy->clks); in rockchip_usb2phy_probe()
1521 if (ret == -EPROBE_DEFER) in rockchip_usb2phy_probe()
1522 return -EPROBE_DEFER; in rockchip_usb2phy_probe()
1524 rphy->num_clks = 0; in rockchip_usb2phy_probe()
1526 ret = clk_bulk_prepare_enable(rphy->num_clks, rphy->clks); in rockchip_usb2phy_probe()
1532 if (rphy->phy_cfg->phy_tuning) { in rockchip_usb2phy_probe()
1533 ret = rphy->phy_cfg->phy_tuning(rphy); in rockchip_usb2phy_probe()
1540 struct rockchip_usb2phy_port *rport = &rphy->ports[index]; in rockchip_usb2phy_probe()
1543 /* This driver aims to support both otg-port and host-port */ in rockchip_usb2phy_probe()
1544 if (of_node_cmp(child_np->name, "host-port") && in rockchip_usb2phy_probe()
1545 of_node_cmp(child_np->name, "otg-port")) in rockchip_usb2phy_probe()
1548 if (rphy->vup_gpio && in rockchip_usb2phy_probe()
1549 of_device_is_compatible(np, "rockchip,rv1126-usb2phy")) { in rockchip_usb2phy_probe()
1552 hrtimer_init(&rphy->wait_timer, CLOCK_MONOTONIC, in rockchip_usb2phy_probe()
1554 rphy->wait_timer.function = &rv1126_wait_timer_fn; in rockchip_usb2phy_probe()
1564 rport->phy = phy; in rockchip_usb2phy_probe()
1565 phy_set_drvdata(rport->phy, rport); in rockchip_usb2phy_probe()
1568 if (!of_node_cmp(child_np->name, "host-port")) { in rockchip_usb2phy_probe()
1582 if (++index >= rphy->phy_cfg->num_ports) in rockchip_usb2phy_probe()
1591 ret = sysfs_create_group(&dev->kobj, &usb2_phy_attr_group); in rockchip_usb2phy_probe()
1603 if (of_property_read_bool(np, "wakeup-source")) in rockchip_usb2phy_probe()
1604 device_init_wakeup(rphy->dev, true); in rockchip_usb2phy_probe()
1606 device_init_wakeup(rphy->dev, false); in rockchip_usb2phy_probe()
1613 clk_bulk_disable_unprepare(rphy->num_clks, rphy->clks); in rockchip_usb2phy_probe()
1620 struct device_node *np = pdev->dev.of_node; in rockchip_usb2phy_remove()
1623 if (rphy->vup_gpio && in rockchip_usb2phy_remove()
1624 of_device_is_compatible(np, "rockchip,rv1126-usb2phy")) in rockchip_usb2phy_remove()
1625 hrtimer_cancel(&rphy->wait_timer); in rockchip_usb2phy_remove()
1635 if (rphy->phy_cfg->reg == 0xff4c0000) { in rv1126_usb2phy_tuning()
1637 ret = regmap_write(rphy->grf, 0x1031c, 0x000f4240); in rv1126_usb2phy_tuning()
1642 ret = regmap_write(rphy->grf, 0x1027c, 0x0f0f0100); in rv1126_usb2phy_tuning()
1646 reg = readl(rphy->base + 0x10); in rv1126_usb2phy_tuning()
1648 writel(reg & ~BIT(2), rphy->base + 0x10); in rv1126_usb2phy_tuning()
1654 if (readl(rphy->base + 0x34) & BIT(4)) { in rv1126_usb2phy_tuning()
1655 dev_dbg(rphy->dev, "Rterm disconnected"); in rv1126_usb2phy_tuning()
1657 ret = readl_poll_timeout(rphy->base + 0x34, rcal, in rv1126_usb2phy_tuning()
1660 if (ret == -ETIMEDOUT) in rv1126_usb2phy_tuning()
1661 dev_err(rphy->dev, "Rterm calibration timeout"); in rv1126_usb2phy_tuning()
1668 writel(reg | BIT(2), rphy->base + 0x10); in rv1126_usb2phy_tuning()
1671 if (rphy->phy_cfg->reg == 0xff4c8000) { in rv1126_usb2phy_tuning()
1673 ret = regmap_write(rphy->grf, 0x1028c, 0x0f0f0100); in rv1126_usb2phy_tuning()
1678 ret = regmap_write(rphy->grf, 0x0000, 0x00040004); in rv1126_usb2phy_tuning()
1687 static int rv1126_usb2phy_low_power(struct rockchip_usb2phy *rphy, bool en) in rv1126_usb2phy_low_power() argument
1691 reg = readl(rphy->base + 0x20); in rv1126_usb2phy_low_power()
1693 reg = en ? reg | BIT(5) : reg & ~BIT(5); in rv1126_usb2phy_low_power()
1694 writel(reg, rphy->base + 0x20); in rv1126_usb2phy_low_power()
1713 if (device_may_wakeup(rphy->dev)) in rockchip_usb2phy_pm_suspend()
1716 for (index = 0; index < rphy->phy_cfg->num_ports; index++) { in rockchip_usb2phy_pm_suspend()
1717 rport = &rphy->ports[index]; in rockchip_usb2phy_pm_suspend()
1718 if (!rport->phy) in rockchip_usb2phy_pm_suspend()
1721 if (rport->port_id == USB2PHY_PORT_OTG && in rockchip_usb2phy_pm_suspend()
1722 rport->id_irq > 0) { in rockchip_usb2phy_pm_suspend()
1723 mutex_lock(&rport->mutex); in rockchip_usb2phy_pm_suspend()
1724 rport->prev_iddig = in rockchip_usb2phy_pm_suspend()
1725 property_enabled(rphy->grf, in rockchip_usb2phy_pm_suspend()
1726 &rport->port_cfg->utmi_iddig); in rockchip_usb2phy_pm_suspend()
1729 mutex_unlock(&rport->mutex); in rockchip_usb2phy_pm_suspend()
1731 dev_err(rphy->dev, in rockchip_usb2phy_pm_suspend()
1737 if (rport->port_id == USB2PHY_PORT_OTG && wakeup_enable && in rockchip_usb2phy_pm_suspend()
1738 rport->bvalid_irq > 0) in rockchip_usb2phy_pm_suspend()
1739 enable_irq_wake(rport->bvalid_irq); in rockchip_usb2phy_pm_suspend()
1742 mutex_lock(&rport->mutex); in rockchip_usb2phy_pm_suspend()
1744 mutex_unlock(&rport->mutex); in rockchip_usb2phy_pm_suspend()
1746 dev_err(rphy->dev, "failed to enable linestate irq\n"); in rockchip_usb2phy_pm_suspend()
1750 if (wakeup_enable && rport->ls_irq > 0) in rockchip_usb2phy_pm_suspend()
1751 enable_irq_wake(rport->ls_irq); in rockchip_usb2phy_pm_suspend()
1755 if (rphy->phy_cfg->phy_lowpower) in rockchip_usb2phy_pm_suspend()
1756 ret = rphy->phy_cfg->phy_lowpower(rphy, true); in rockchip_usb2phy_pm_suspend()
1770 if (device_may_wakeup(rphy->dev)) in rockchip_usb2phy_pm_resume()
1774 if (rphy->phy_cfg->phy_lowpower) in rockchip_usb2phy_pm_resume()
1775 ret = rphy->phy_cfg->phy_lowpower(rphy, false); in rockchip_usb2phy_pm_resume()
1777 for (index = 0; index < rphy->phy_cfg->num_ports; index++) { in rockchip_usb2phy_pm_resume()
1778 rport = &rphy->ports[index]; in rockchip_usb2phy_pm_resume()
1779 if (!rport->phy) in rockchip_usb2phy_pm_resume()
1782 if (rport->port_id == USB2PHY_PORT_OTG && in rockchip_usb2phy_pm_resume()
1783 rport->id_irq > 0) { in rockchip_usb2phy_pm_resume()
1784 mutex_lock(&rport->mutex); in rockchip_usb2phy_pm_resume()
1785 iddig = property_enabled(rphy->grf, in rockchip_usb2phy_pm_resume()
1786 &rport->port_cfg->utmi_iddig); in rockchip_usb2phy_pm_resume()
1789 mutex_unlock(&rport->mutex); in rockchip_usb2phy_pm_resume()
1791 dev_err(rphy->dev, in rockchip_usb2phy_pm_resume()
1796 if (iddig != rport->prev_iddig) { in rockchip_usb2phy_pm_resume()
1797 dev_dbg(&rport->phy->dev, in rockchip_usb2phy_pm_resume()
1799 rport->prev_iddig = iddig; in rockchip_usb2phy_pm_resume()
1800 extcon_set_state_sync(rphy->edev, in rockchip_usb2phy_pm_resume()
1803 extcon_set_state_sync(rphy->edev, in rockchip_usb2phy_pm_resume()
1812 if (rport->port_id == USB2PHY_PORT_OTG && wakeup_enable && in rockchip_usb2phy_pm_resume()
1813 rport->bvalid_irq > 0) in rockchip_usb2phy_pm_resume()
1814 disable_irq_wake(rport->bvalid_irq); in rockchip_usb2phy_pm_resume()
1816 if (wakeup_enable && rport->ls_irq > 0) in rockchip_usb2phy_pm_resume()
1817 disable_irq_wake(rport->ls_irq); in rockchip_usb2phy_pm_resume()
1916 { .compatible = "rockchip,rv1126-usb2phy", .data = &rv1126_phy_cfgs },
1925 .name = "rockchip-usb2phy-naneng",
1932 MODULE_AUTHOR("Jianing Ren <jianing.ren@rock-chips.com>");