diff mbox series

[V2] pwm: Add MediaTek MT8183 display PWM driver support

Message ID 20190122090243.27304-1-jitao.shi@mediatek.com
State Accepted
Headers show
Series [V2] pwm: Add MediaTek MT8183 display PWM driver support | expand

Commit Message

Jitao Shi Jan. 22, 2019, 9:02 a.m. UTC
Use the mtk_pwm_data struction to define different registers
and add MT8183 specific register operations, such as MT8183
doesn't have commit register, needs to disable double buffer
before writing register, and needs to select commit mode
and use PWM_PERIOD/PWM_HIGH_WIDTH.

Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
---
 drivers/pwm/pwm-mtk-disp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Uwe Kleine-König Jan. 22, 2019, 9:16 a.m. UTC | #1
On Tue, Jan 22, 2019 at 05:02:43PM +0800, Jitao Shi wrote:
> Use the mtk_pwm_data struction to define different registers
> and add MT8183 specific register operations, such as MT8183
> doesn't have commit register, needs to disable double buffer
> before writing register, and needs to select commit mode
> and use PWM_PERIOD/PWM_HIGH_WIDTH.
> 
> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>

There is no difference compared to (implicit) v1 sent a few minutes
earlier, right? There was another patch sent with the same Subject last
week, so I assume the mail from today without "v2" in the Subject was a
mistake?

> ---
Adding a paragraph below the tripple dash that points out what was
changed compared to the previous submission is a good idea to help
reviewers to more easily see what was changed. I guess you only adapted
the commit log as a reaction to Matthias Burgger's review?

Best regards
Uwe
Jitao Shi Jan. 22, 2019, 9:37 a.m. UTC | #2
On Tue, 2019-01-22 at 10:16 +0100, Uwe Kleine-König wrote:
> On Tue, Jan 22, 2019 at 05:02:43PM +0800, Jitao Shi wrote:
> > Use the mtk_pwm_data struction to define different registers
> > and add MT8183 specific register operations, such as MT8183
> > doesn't have commit register, needs to disable double buffer
> > before writing register, and needs to select commit mode
> > and use PWM_PERIOD/PWM_HIGH_WIDTH.
> > 
> > Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
> 
> There is no difference compared to (implicit) v1 sent a few minutes
> earlier, right? There was another patch sent with the same Subject last
> week, so I assume the mail from today without "v2" in the Subject was a
> mistake?
> 
> > ---
> Adding a paragraph below the tripple dash that points out what was
> changed compared to the previous submission is a good idea to help
> reviewers to more easily see what was changed. I guess you only adapted
> the commit log as a reaction to Matthias Burgger's review?
> 
> Best regards
> Uwe
> 

Yes, I miss the "V2" and fine tune the commit message.

Best Regards
Jitao
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c
index 893940d45f0d..15803c71fe80 100644
--- a/drivers/pwm/pwm-mtk-disp.c
+++ b/drivers/pwm/pwm-mtk-disp.c
@@ -277,10 +277,21 @@  static const struct mtk_pwm_data mt8173_pwm_data = {
 	.commit_mask = 0x1,
 };
 
+static const struct mtk_pwm_data mt8183_pwm_data = {
+	.enable_mask = BIT(0),
+	.con0 = 0x18,
+	.con0_sel = 0x0,
+	.con1 = 0x1c,
+	.has_commit = false,
+	.bls_debug = 0x80,
+	.bls_debug_mask = 0x3,
+};
+
 static const struct of_device_id mtk_disp_pwm_of_match[] = {
 	{ .compatible = "mediatek,mt2701-disp-pwm", .data = &mt2701_pwm_data},
 	{ .compatible = "mediatek,mt6595-disp-pwm", .data = &mt8173_pwm_data},
 	{ .compatible = "mediatek,mt8173-disp-pwm", .data = &mt8173_pwm_data},
+	{ .compatible = "mediatek,mt8183-disp-pwm", .data = &mt8183_pwm_data},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mtk_disp_pwm_of_match);