summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2014-05-08 07:28:05 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:47:47 +0900
commitc64e71681d0fbeb17ed665446dcf7c20bcbe8fa5 (patch)
tree9c85a5621231e8784f3443f7a15dbec05df67328 /drivers/phy
parentd689b1bdb10b692f9006252acf6f277097cbb7c5 (diff)
downloadlinux-3.10-c64e71681d0fbeb17ed665446dcf7c20bcbe8fa5.tar.gz
linux-3.10-c64e71681d0fbeb17ed665446dcf7c20bcbe8fa5.tar.bz2
linux-3.10-c64e71681d0fbeb17ed665446dcf7c20bcbe8fa5.zip
Revert "phy: exynos: Change order of initialization of phy in power_on"
This reverts commit dbd99235197ce37b37f5e0c04fe7465a655f9c47. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I010965a1deb88f01b8a8c07e2c56910f5d73b9d2
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-exynos4210-usb.c24
-rw-r--r--drivers/phy/phy-exynos4212-usb.c2
2 files changed, 23 insertions, 3 deletions
diff --git a/drivers/phy/phy-exynos4210-usb.c b/drivers/phy/phy-exynos4210-usb.c
index 6102aac2447..d75a5546327 100644
--- a/drivers/phy/phy-exynos4210-usb.c
+++ b/drivers/phy/phy-exynos4210-usb.c
@@ -222,9 +222,19 @@ static int exynos4210_power_on(struct uphy_instance *inst)
if (inst->ref_cnt > 1)
return 0;
- /* Order of initialisation is important - first power then isolation */
- exynos4210_phy_pwr(inst, 1);
exynos4210_isol(inst, 0);
+ exynos4210_phy_pwr(inst, 1);
+
+ /* Power on the device, as it is necessary for HSIC to work */
+ if (inst->cfg->id == EXYNOS4210_HOST) {
+ struct uphy_instance *device =
+ &drv->uphy_instances[EXYNOS4210_DEVICE];
+ device->ref_cnt++;
+ if (device->ref_cnt > 1)
+ return 0;
+ exynos4210_phy_pwr(device, 1);
+ exynos4210_isol(device, 0);
+ }
return 0;
}
@@ -247,6 +257,16 @@ static int exynos4210_power_off(struct uphy_instance *inst)
exynos4210_phy_pwr(inst, 0);
exynos4210_isol(inst, 1);
+ if (inst->cfg->id == EXYNOS4210_HOST) {
+ struct uphy_instance *device =
+ &drv->uphy_instances[EXYNOS4210_DEVICE];
+ device->ref_cnt--;
+ if (device->ref_cnt > 0)
+ return 0;
+ exynos4210_phy_pwr(device, 0);
+ exynos4210_isol(device, 1);
+ }
+
return 0;
}
diff --git a/drivers/phy/phy-exynos4212-usb.c b/drivers/phy/phy-exynos4212-usb.c
index b7de33f6324..80480a4facf 100644
--- a/drivers/phy/phy-exynos4212-usb.c
+++ b/drivers/phy/phy-exynos4212-usb.c
@@ -255,8 +255,8 @@ static int exynos4212_power_on(struct uphy_instance *inst)
if (inst->ref_cnt > 1)
return 0;
- exynos4212_phy_pwr(inst, 1);
exynos4212_isol(inst, 0);
+ exynos4212_phy_pwr(inst, 1);
/* Power on the device, as it is necessary for HSIC to work */
if (inst->cfg->id == EXYNOS4212_HSIC0) {