Revert "phy: exynos: Change order of initialization of phy in power_on"
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 8 May 2014 05:28:05 +0000 (07:28 +0200)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:47 +0000 (11:47 +0900)
This reverts commit dbd99235197ce37b37f5e0c04fe7465a655f9c47.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I010965a1deb88f01b8a8c07e2c56910f5d73b9d2

drivers/phy/phy-exynos4210-usb.c
drivers/phy/phy-exynos4212-usb.c

index 6102aac..d75a554 100644 (file)
@@ -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;
 }
 
index b7de33f..80480a4 100644 (file)
@@ -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) {