Commit 86f44c88 authored by Chanwoo Choi's avatar Chanwoo Choi

phy: rockchip-inno-usb2: Replace the extcon API

This patch uses the resource-managed extcon API for extcon_register_notifier()
and replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
- extcon_set_cable_state_() -> extcon_set_state_sync()
Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent f0b5c2c9
...@@ -545,7 +545,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work) ...@@ -545,7 +545,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
rockchip_usb2phy_power_off(rport->phy); rockchip_usb2phy_power_off(rport->phy);
/* fall through */ /* fall through */
case OTG_STATE_B_IDLE: case OTG_STATE_B_IDLE:
if (extcon_get_cable_state_(rphy->edev, EXTCON_USB_HOST) > 0) { if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) > 0) {
dev_dbg(&rport->phy->dev, "usb otg host connect\n"); dev_dbg(&rport->phy->dev, "usb otg host connect\n");
rport->state = OTG_STATE_A_HOST; rport->state = OTG_STATE_A_HOST;
rockchip_usb2phy_power_on(rport->phy); rockchip_usb2phy_power_on(rport->phy);
...@@ -598,7 +598,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work) ...@@ -598,7 +598,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
rport->vbus_attached = vbus_attach; rport->vbus_attached = vbus_attach;
if (notify_charger && rphy->edev) { if (notify_charger && rphy->edev) {
extcon_set_cable_state_(rphy->edev, extcon_set_state_sync(rphy->edev,
cable, vbus_attach); cable, vbus_attach);
if (cable == EXTCON_CHG_USB_SDP) if (cable == EXTCON_CHG_USB_SDP)
extcon_set_state_sync(rphy->edev, extcon_set_state_sync(rphy->edev,
...@@ -619,7 +619,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work) ...@@ -619,7 +619,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
sch_work = true; sch_work = true;
break; break;
case OTG_STATE_A_HOST: case OTG_STATE_A_HOST:
if (extcon_get_cable_state_(rphy->edev, EXTCON_USB_HOST) == 0) { if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) == 0) {
dev_dbg(&rport->phy->dev, "usb otg host disconnect\n"); dev_dbg(&rport->phy->dev, "usb otg host disconnect\n");
rport->state = OTG_STATE_B_IDLE; rport->state = OTG_STATE_B_IDLE;
rockchip_usb2phy_power_off(rport->phy); rockchip_usb2phy_power_off(rport->phy);
...@@ -1006,8 +1006,8 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, ...@@ -1006,8 +1006,8 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
if (!IS_ERR(rphy->edev)) { if (!IS_ERR(rphy->edev)) {
rport->event_nb.notifier_call = rockchip_otg_event; rport->event_nb.notifier_call = rockchip_otg_event;
ret = extcon_register_notifier(rphy->edev, EXTCON_USB_HOST, ret = devm_extcon_register_notifier(rphy->dev, rphy->edev,
&rport->event_nb); EXTCON_USB_HOST, &rport->event_nb);
if (ret) if (ret)
dev_err(rphy->dev, "register USB HOST notifier failed\n"); dev_err(rphy->dev, "register USB HOST notifier failed\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment