[COMMON] drivers: pwm: Fix pwm driver to save and restore.
authorKang KyungWoo <kwoo.kang@samsung.com>
Tue, 13 Dec 2016 08:09:44 +0000 (17:09 +0900)
committerJaehyoung Choi <jkkkkk.choi@samsung.com>
Wed, 9 May 2018 11:27:48 +0000 (20:27 +0900)
This patch is for fixing pwm driver which influences pwm malfunction
after suspend & resume funtcion.
Checking Enable count is originally for LPA mode which is not
exist anymore.

Change-Id: I330362bdd10af00f15761cd9dc7613b21d107d35
Signed-off-by: Kang KyungWoo <kwoo.kang@samsung.com>
drivers/pwm/pwm-samsung.c

index 6620c73b5ad3878d76bc29ca4559ad683c86be5b..b1594ba08a251a0b47e55d20ced08cd6d92e1018 100755 (executable)
@@ -758,8 +758,7 @@ static int pwm_samsung_suspend(struct device *dev)
                chan->duty_ns = -1;
        }
        /* Save pwm registers*/
-       if (chip->enable_cnt)
-               chip->reg_tcfg0 = __raw_readl(chip->base + REG_TCFG0);
+       chip->reg_tcfg0 = __raw_readl(chip->base + REG_TCFG0);
 
        clk_disable_unprepare(chip->base_clk);
        exynos_update_ip_idle_status(chip->idle_ip_index, 1);
@@ -776,8 +775,7 @@ static int pwm_samsung_resume(struct device *dev)
        clk_prepare_enable(chip->base_clk);
 
        /* Restore pwm registers*/
-       if (chip->enable_cnt)
-               __raw_writel(chip->reg_tcfg0, chip->base + REG_TCFG0);
+       __raw_writel(chip->reg_tcfg0, chip->base + REG_TCFG0);
 
        for (chan = 0; chan < SAMSUNG_PWM_NUM; ++chan) {
                if (chip->variant.output_mask & BIT(chan)) {