mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
phy: qcom-usb-hs: Replace the extcon API
This patch uses the resource-managed extcon API for extcon_register_notifier() and replaces the deprecated extcon API as following: - (deprecated) extcon_get_cable_state_() -> extcon_get_state() Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
This commit is contained in:
parent
5771a8c088
commit
f0b5c2c963
1 changed files with 3 additions and 11 deletions
|
@ -155,12 +155,12 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uphy->vbus_edev) {
|
if (uphy->vbus_edev) {
|
||||||
state = extcon_get_cable_state_(uphy->vbus_edev, EXTCON_USB);
|
state = extcon_get_state(uphy->vbus_edev, EXTCON_USB);
|
||||||
/* setup initial state */
|
/* setup initial state */
|
||||||
qcom_usb_hs_phy_vbus_notifier(&uphy->vbus_notify, state,
|
qcom_usb_hs_phy_vbus_notifier(&uphy->vbus_notify, state,
|
||||||
uphy->vbus_edev);
|
uphy->vbus_edev);
|
||||||
ret = extcon_register_notifier(uphy->vbus_edev, EXTCON_USB,
|
ret = devm_extcon_register_notifier(&ulpi->dev, uphy->vbus_edev,
|
||||||
&uphy->vbus_notify);
|
EXTCON_USB, &uphy->vbus_notify);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_ulpi;
|
goto err_ulpi;
|
||||||
}
|
}
|
||||||
|
@ -179,16 +179,8 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy)
|
||||||
|
|
||||||
static int qcom_usb_hs_phy_power_off(struct phy *phy)
|
static int qcom_usb_hs_phy_power_off(struct phy *phy)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy);
|
struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy);
|
||||||
|
|
||||||
if (uphy->vbus_edev) {
|
|
||||||
ret = extcon_unregister_notifier(uphy->vbus_edev, EXTCON_USB,
|
|
||||||
&uphy->vbus_notify);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
regulator_disable(uphy->v3p3);
|
regulator_disable(uphy->v3p3);
|
||||||
regulator_disable(uphy->v1p8);
|
regulator_disable(uphy->v1p8);
|
||||||
clk_disable_unprepare(uphy->sleep_clk);
|
clk_disable_unprepare(uphy->sleep_clk);
|
||||||
|
|
Loading…
Reference in a new issue