forked from Minki/linux
phy: for 4.5-rc
*) Fix error handling code in phy core [phy_power_on()] *) phy-twl4030-usb fixes for unloading the module *) Restrict phy-hi6220-usb to HiSilicon arm64 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJWutjaAAoJEA5ceFyATYLZKsIQAJkmjS4Hnb6fvOiQ/K8ZzZap Z3drObZoPBedN2iuBi9i0+kPXcu0QAmLjVGOHJZwTDhV9mPxY5g0Ct5xzSGCJPH3 m+WXxrl1Y7eum2nvN2SQz1hqURpdjJwuUpzQH2Q2S/8RMK8ml7UYXJCX0wP7ZzHj Dg5pWR5f0L8K7SmpypSkAfIZ/KAJ7E1Mg8tgkzUOvjmEqc/o6oezGS3kVMZEqyIa kvvxOaJDPXa0bh52NQF8IXmE99keBx0hC9TG9+AYKTqNpl1YZeZNxxB5ooqAnJOL 4sy2bFmav7Ft0501zMxTb6mP0KC+dj+c499P+Cl8hqmMbcEy9QMgIV13Yzr8dbUI /woC/BSNUB2lNpl2oli2VqFRrhMpJl5UOPu4lPLGSplVw3ViEjvDIjutF8dDuN6L 98cFSzSKvyfzRlQ29KbFIyKog54Mo/YOGxlGmjpAm05c5dWlWi7ZriyOukKv85gb 7gKp6+UNs9lrC4yTi3V6fOnuTocr5TfwwfAAKlsHwkQaT3Mm64dig9rdfzmT/c3+ Htea2Y2lU7CCsW0mNkT3hNZ9wpFu4BNTa9fBh5oRs+UxDiGbtJlZTvcBVZ8MYfwG PCeCbCJzw0pLW0Ya5ePOSJ0VbUgqwT1SDryikmZxg/paXzpza5GDQ0/lNcBkaaDt 08nXceE2HGf/RavUmrPe =s8Mo -----END PGP SIGNATURE----- Merge tag 'phy-for-4.5-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus Kishon writes: phy: for 4.5-rc *) Fix error handling code in phy core [phy_power_on()] *) phy-twl4030-usb fixes for unloading the module *) Restrict phy-hi6220-usb to HiSilicon arm64 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
commit
6b44d1e9bf
@ -224,6 +224,7 @@ config PHY_MT65XX_USB3
|
||||
|
||||
config PHY_HI6220_USB
|
||||
tristate "hi6220 USB PHY support"
|
||||
depends on (ARCH_HISI && ARM64) || COMPILE_TEST
|
||||
select GENERIC_PHY
|
||||
select MFD_SYSCON
|
||||
help
|
||||
|
@ -275,20 +275,21 @@ EXPORT_SYMBOL_GPL(phy_exit);
|
||||
|
||||
int phy_power_on(struct phy *phy)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (!phy)
|
||||
return 0;
|
||||
goto out;
|
||||
|
||||
if (phy->pwr) {
|
||||
ret = regulator_enable(phy->pwr);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = phy_pm_runtime_get_sync(phy);
|
||||
if (ret < 0 && ret != -ENOTSUPP)
|
||||
return ret;
|
||||
goto err_pm_sync;
|
||||
|
||||
ret = 0; /* Override possible ret == -ENOTSUPP */
|
||||
|
||||
mutex_lock(&phy->mutex);
|
||||
@ -296,19 +297,20 @@ int phy_power_on(struct phy *phy)
|
||||
ret = phy->ops->power_on(phy);
|
||||
if (ret < 0) {
|
||||
dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
|
||||
goto out;
|
||||
goto err_pwr_on;
|
||||
}
|
||||
}
|
||||
++phy->power_count;
|
||||
mutex_unlock(&phy->mutex);
|
||||
return 0;
|
||||
|
||||
out:
|
||||
err_pwr_on:
|
||||
mutex_unlock(&phy->mutex);
|
||||
phy_pm_runtime_put_sync(phy);
|
||||
err_pm_sync:
|
||||
if (phy->pwr)
|
||||
regulator_disable(phy->pwr);
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(phy_power_on);
|
||||
|
@ -715,6 +715,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
|
||||
pm_runtime_use_autosuspend(&pdev->dev);
|
||||
pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
|
||||
/* Our job is to use irqs and status from the power module
|
||||
* to keep the transceiver disabled when nothing's connected.
|
||||
@ -750,6 +751,7 @@ static int twl4030_usb_remove(struct platform_device *pdev)
|
||||
struct twl4030_usb *twl = platform_get_drvdata(pdev);
|
||||
int val;
|
||||
|
||||
usb_remove_phy(&twl->phy);
|
||||
pm_runtime_get_sync(twl->dev);
|
||||
cancel_delayed_work(&twl->id_workaround_work);
|
||||
device_remove_file(twl->dev, &dev_attr_vbus);
|
||||
@ -757,6 +759,13 @@ static int twl4030_usb_remove(struct platform_device *pdev)
|
||||
/* set transceiver mode to power on defaults */
|
||||
twl4030_usb_set_mode(twl, -1);
|
||||
|
||||
/* idle ulpi before powering off */
|
||||
if (cable_present(twl->linkstat))
|
||||
pm_runtime_put_noidle(twl->dev);
|
||||
pm_runtime_mark_last_busy(twl->dev);
|
||||
pm_runtime_put_sync_suspend(twl->dev);
|
||||
pm_runtime_disable(twl->dev);
|
||||
|
||||
/* autogate 60MHz ULPI clock,
|
||||
* clear dpll clock request for i2c access,
|
||||
* disable 32KHz
|
||||
@ -771,11 +780,6 @@ static int twl4030_usb_remove(struct platform_device *pdev)
|
||||
/* disable complete OTG block */
|
||||
twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB);
|
||||
|
||||
if (cable_present(twl->linkstat))
|
||||
pm_runtime_put_noidle(twl->dev);
|
||||
pm_runtime_mark_last_busy(twl->dev);
|
||||
pm_runtime_put(twl->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user