Commit 7ed855e6 authored by Ivan T. Ivanov's avatar Ivan T. Ivanov Committed by Felipe Balbi

usb: phy: qcom: Switch to new extcon framework API

[un]register_interest and reading cable state by
name have been deprecated. Switch to new API.
Signed-off-by: default avatarIvan T. Ivanov <ivan.ivanov@linaro.org>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 41932b9b
...@@ -71,7 +71,7 @@ struct phy_8x16 { ...@@ -71,7 +71,7 @@ struct phy_8x16 {
struct reset_control *phy_reset; struct reset_control *phy_reset;
struct extcon_specific_cable_nb vbus_cable; struct extcon_dev *vbus_edev;
struct notifier_block vbus_notify; struct notifier_block vbus_notify;
struct gpio_desc *switch_gpio; struct gpio_desc *switch_gpio;
...@@ -234,7 +234,7 @@ static int phy_8x16_init(struct usb_phy *phy) ...@@ -234,7 +234,7 @@ static int phy_8x16_init(struct usb_phy *phy)
val = ULPI_PWR_OTG_COMP_DISABLE; val = ULPI_PWR_OTG_COMP_DISABLE;
usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG)); usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG));
state = extcon_get_cable_state(qphy->vbus_cable.edev, "USB"); state = extcon_get_cable_state_(qphy->vbus_edev, EXTCON_USB);
if (state) if (state)
phy_8x16_vbus_on(qphy); phy_8x16_vbus_on(qphy);
else else
...@@ -314,7 +314,6 @@ static int phy_8x16_reboot_notify(struct notifier_block *this, ...@@ -314,7 +314,6 @@ static int phy_8x16_reboot_notify(struct notifier_block *this,
static int phy_8x16_probe(struct platform_device *pdev) static int phy_8x16_probe(struct platform_device *pdev)
{ {
struct extcon_dev *edev;
struct phy_8x16 *qphy; struct phy_8x16 *qphy;
struct resource *res; struct resource *res;
struct usb_phy *phy; struct usb_phy *phy;
...@@ -349,9 +348,9 @@ static int phy_8x16_probe(struct platform_device *pdev) ...@@ -349,9 +348,9 @@ static int phy_8x16_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
return ret; return ret;
edev = extcon_get_edev_by_phandle(phy->dev, 0); qphy->vbus_edev = extcon_get_edev_by_phandle(phy->dev, 0);
if (IS_ERR(edev)) if (IS_ERR(qphy->vbus_edev))
return PTR_ERR(edev); return PTR_ERR(qphy->vbus_edev);
ret = clk_set_rate(qphy->core_clk, INT_MAX); ret = clk_set_rate(qphy->core_clk, INT_MAX);
if (ret < 0) if (ret < 0)
...@@ -370,8 +369,8 @@ static int phy_8x16_probe(struct platform_device *pdev) ...@@ -370,8 +369,8 @@ static int phy_8x16_probe(struct platform_device *pdev)
goto off_clks; goto off_clks;
qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify; qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify;
ret = extcon_register_interest(&qphy->vbus_cable, edev->name, ret = extcon_register_notifier(qphy->vbus_edev, EXTCON_USB,
"USB", &qphy->vbus_notify); &qphy->vbus_notify);
if (ret < 0) if (ret < 0)
goto off_power; goto off_power;
...@@ -385,7 +384,8 @@ static int phy_8x16_probe(struct platform_device *pdev) ...@@ -385,7 +384,8 @@ static int phy_8x16_probe(struct platform_device *pdev)
return 0; return 0;
off_extcon: off_extcon:
extcon_unregister_interest(&qphy->vbus_cable); extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB,
&qphy->vbus_notify);
off_power: off_power:
phy_8x16_regulators_disable(qphy); phy_8x16_regulators_disable(qphy);
off_clks: off_clks:
...@@ -400,7 +400,8 @@ static int phy_8x16_remove(struct platform_device *pdev) ...@@ -400,7 +400,8 @@ static int phy_8x16_remove(struct platform_device *pdev)
struct phy_8x16 *qphy = platform_get_drvdata(pdev); struct phy_8x16 *qphy = platform_get_drvdata(pdev);
unregister_reboot_notifier(&qphy->reboot_notify); unregister_reboot_notifier(&qphy->reboot_notify);
extcon_unregister_interest(&qphy->vbus_cable); extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB,
&qphy->vbus_notify);
/* /*
* Ensure that D+/D- lines are routed to uB connector, so * Ensure that D+/D- lines are routed to uB connector, so
......
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