Revert "phy: exynos-usb: Remove ref counting for additional reset for Exynos4212"
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 8 May 2014 05:27:55 +0000 (07:27 +0200)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:47 +0000 (11:47 +0900)
This reverts commit f600e05157a6d3d38f87260f5caa88918cac129e.

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

drivers/phy/phy-exynos4212-usb.c

index a9fa15d..b7de33f 100644 (file)
@@ -262,6 +262,9 @@ 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);
        }
@@ -291,6 +294,9 @@ 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);
        }