summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2014-05-08 05:28:05 (GMT)
committerMarek Szyprowski <m.szyprowski@samsung.com>2014-05-15 05:29:25 (GMT)
commit2debd6b16422381bf9f4ca0ed54f100e60b22f11 (patch)
treed9f01dd7e006e2eae385f960e95db60e211d0c4e
parent08d09480ddf146f5688d48a8c397d78cb05f9747 (diff)
downloadlinux-3.10-2debd6b16422381bf9f4ca0ed54f100e60b22f11.zip
linux-3.10-2debd6b16422381bf9f4ca0ed54f100e60b22f11.tar.gz
linux-3.10-2debd6b16422381bf9f4ca0ed54f100e60b22f11.tar.bz2
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
-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 6102aac..d75a554 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 b7de33f..80480a4 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) {