summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2014-04-24 13:25:34 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:47:30 +0900
commit3d9d0681f245f141c89aa0daf6a549788a1388f7 (patch)
tree1922d215b12f10cb9e676c3b5087f8611ddf012d /drivers
parent96a5c528f7dd4aa85024593f232e4de64d811b98 (diff)
downloadlinux-3.10-3d9d0681f245f141c89aa0daf6a549788a1388f7.tar.gz
linux-3.10-3d9d0681f245f141c89aa0daf6a549788a1388f7.tar.bz2
linux-3.10-3d9d0681f245f141c89aa0daf6a549788a1388f7.zip
phy: exynos4212-usb: Use refcount to power device PHY for HSIC0
HSIC0 requires device PHY to be powered up and the driver handles that already, but there is no reference counting of device PHY power state, so unplugging USB cable powers it down, breaking modem IF operation. This patch fixes the issue by adding handling of reference counting of device PHY to HSIC0 power-down/-up. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Change-Id: I14b1825fec3cd9c1b2652b89f275a50c73359ad6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/phy/phy-exynos4212-usb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/phy/phy-exynos4212-usb.c b/drivers/phy/phy-exynos4212-usb.c
index c6af66d489d..6d426a4e92f 100644
--- a/drivers/phy/phy-exynos4212-usb.c
+++ b/drivers/phy/phy-exynos4212-usb.c
@@ -263,6 +263,11 @@ static int exynos4212_power_on(struct uphy_instance *inst)
if (inst->cfg->id == EXYNOS4212_HSIC0) {
struct uphy_instance *device =
&drv->uphy_instances[EXYNOS4212_DEVICE];
+
+ device->ref_cnt++;
+ if (device->ref_cnt > 1)
+ return 0;
+
exynos4212_phy_pwr(device, 1);
exynos4212_isol(device, 0);
}
@@ -292,6 +297,11 @@ static int exynos4212_power_off(struct uphy_instance *inst)
if (inst->cfg->id == EXYNOS4212_HSIC0) {
struct uphy_instance *device =
&drv->uphy_instances[EXYNOS4212_DEVICE];
+
+ device->ref_cnt--;
+ if (device->ref_cnt > 0)
+ return 0;
+
exynos4212_phy_pwr(device, 0);
exynos4212_isol(device, 1);
}