[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210526024846.120838-2-jitao.shi@mediatek.com>
Date: Wed, 26 May 2021 10:48:44 +0800
From: Jitao Shi <jitao.shi@...iatek.com>
To: Thierry Reding <thierry.reding@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>
CC: <linux-pwm@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <srv_heupstream@...iatek.com>,
<yingjoe.chen@...iatek.com>, <eddie.huang@...iatek.com>,
<cawa.cheng@...iatek.com>, <bibby.hsieh@...iatek.com>,
<ck.hu@...iatek.com>, <stonea168@....com>,
<huijuan.xie@...iatek.com>, Jitao Shi <jitao.shi@...iatek.com>
Subject: [PATCH v3 1/3] pwm: mtk_disp: remove the clock operations for atomic APIs.
We have a issue that clocks aren't disabled when system is standby.
The driver uses the legacy APIs, and we want to covert them to
atomically APIs. And solve the issue at the sametime.
Change-Id: Iffcf74a488e4e6c0865fec17d8805cc8b2e58b54
Signed-off-by: Jitao Shi <jitao.shi@...iatek.com>
---
drivers/pwm/pwm-mtk-disp.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c
index 9b3ba401a3db..bc2fdbe853ba 100644
--- a/drivers/pwm/pwm-mtk-disp.c
+++ b/drivers/pwm/pwm-mtk-disp.c
@@ -192,14 +192,6 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev)
if (IS_ERR(mdp->clk_mm))
return PTR_ERR(mdp->clk_mm);
- ret = clk_prepare(mdp->clk_main);
- if (ret < 0)
- return ret;
-
- ret = clk_prepare(mdp->clk_mm);
- if (ret < 0)
- goto disable_clk_main;
-
mdp->chip.dev = &pdev->dev;
mdp->chip.ops = &mtk_disp_pwm_ops;
mdp->chip.npwm = 1;
@@ -207,7 +199,7 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev)
ret = pwmchip_add(&mdp->chip);
if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
- goto disable_clk_mm;
+ return ret;
}
platform_set_drvdata(pdev, mdp);
@@ -226,24 +218,13 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev)
}
return 0;
-
-disable_clk_mm:
- clk_unprepare(mdp->clk_mm);
-disable_clk_main:
- clk_unprepare(mdp->clk_main);
- return ret;
}
static int mtk_disp_pwm_remove(struct platform_device *pdev)
{
struct mtk_disp_pwm *mdp = platform_get_drvdata(pdev);
- int ret;
-
- ret = pwmchip_remove(&mdp->chip);
- clk_unprepare(mdp->clk_mm);
- clk_unprepare(mdp->clk_main);
- return ret;
+ return pwmchip_remove(&mdp->chip);
}
static const struct mtk_pwm_data mt2701_pwm_data = {
--
2.25.1
Powered by blists - more mailing lists