All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-16  7:52 ` Jitao Shi
  0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-01-16  7:52 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	David Airlie, Matthias Brugger
  Cc: Jitao Shi, Thierry Reding, Ajay Kumar, Inki Dae, Rahul Sharma,
	Sean Paul, Vincent Palatin, Andy Yan, Philipp Zabel,
	Russell King, linux-kernel, dri-devel, linux-arm-kernel,
	linux-mediatek, srv_heupstream, Sascha Hauer, yingjoe.chen,
	eddie.huang, sj.huang, bibby.hsieh, ck.hu

Use the mtk_pwm_data struction to define different registers
and add MT8183 specific register operations, such as MT8183
have commit register, needs to enable 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(+)

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);
-- 
2.12.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-16  7:52 ` Jitao Shi
  0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-01-16  7:52 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	David Airlie, Matthias Brugger
  Cc: Jitao Shi, Thierry Reding, Ajay Kumar, Inki Dae, Rahul Sharma,
	Sean Paul, Vincent Palatin, Andy Yan, Philipp Zabel,
	Russell King, linux-kernel, dri-devel, linux-arm-kernel,
	linux-mediatek, srv_heupstream, Sascha Hauer, yingjoe.chen,
	eddie.huang, sj.huang, bibby.hsieh, ck.hu

Use the mtk_pwm_data struction to define different registers
and add MT8183 specific register operations, such as MT8183
have commit register, needs to enable 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(+)

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);
-- 
2.12.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-16  7:52 ` Jitao Shi
  0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-01-16  7:52 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	David Airlie, Matthias Brugger
  Cc: eddie.huang, Jitao Shi, Sascha Hauer, srv_heupstream,
	bibby.hsieh, linux-mediatek, Russell King, dri-devel,
	linux-kernel, Inki Dae, yingjoe.chen, sj.huang, Sean Paul,
	Philipp Zabel, Andy Yan, ck.hu, Vincent Palatin, Thierry Reding,
	Ajay Kumar, linux-arm-kernel, Rahul Sharma

Use the mtk_pwm_data struction to define different registers
and add MT8183 specific register operations, such as MT8183
have commit register, needs to enable 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(+)

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);
-- 
2.12.5


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
  2019-01-16  7:52 ` Jitao Shi
@ 2019-01-16 10:25   ` Matthias Brugger
  -1 siblings, 0 replies; 11+ messages in thread
From: Matthias Brugger @ 2019-01-16 10:25 UTC (permalink / raw)
  To: Jitao Shi, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, David Airlie
  Cc: Thierry Reding, Ajay Kumar, Inki Dae, Rahul Sharma, Sean Paul,
	Vincent Palatin, Andy Yan, Philipp Zabel, Russell King,
	linux-kernel, dri-devel, linux-arm-kernel, linux-mediatek,
	srv_heupstream, Sascha Hauer, yingjoe.chen, eddie.huang,
	sj.huang, bibby.hsieh, ck.hu



On 16/01/2019 08:52, Jitao Shi wrote:
> Use the mtk_pwm_data struction to define different registers
> and add MT8183 specific register operations, such as MT8183
> have commit register, needs to enable double buffer

has_commit is set to false, so I suppose you mean that MT8183 does not have a
commit register.

Regards,
Matthias

> 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(+)
> 
> 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);
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-16 10:25   ` Matthias Brugger
  0 siblings, 0 replies; 11+ messages in thread
From: Matthias Brugger @ 2019-01-16 10:25 UTC (permalink / raw)
  To: Jitao Shi, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, David Airlie
  Cc: eddie.huang, Vincent Palatin, Sascha Hauer, srv_heupstream,
	bibby.hsieh, linux-mediatek, linux-kernel, dri-devel, Inki Dae,
	yingjoe.chen, sj.huang, Sean Paul, Philipp Zabel, Russell King,
	ck.hu, Andy Yan, Thierry Reding, Ajay Kumar, linux-arm-kernel,
	Rahul Sharma



On 16/01/2019 08:52, Jitao Shi wrote:
> Use the mtk_pwm_data struction to define different registers
> and add MT8183 specific register operations, such as MT8183
> have commit register, needs to enable double buffer

has_commit is set to false, so I suppose you mean that MT8183 does not have a
commit register.

Regards,
Matthias

> 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(+)
> 
> 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);
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
  2019-01-16  7:52 ` Jitao Shi
  (?)
@ 2019-01-17 13:00   ` Uwe Kleine-König
  -1 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2019-01-17 13:00 UTC (permalink / raw)
  To: Jitao Shi
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	David Airlie, Matthias Brugger, eddie.huang, Sascha Hauer,
	srv_heupstream, bibby.hsieh, linux-mediatek, Russell King,
	dri-devel, linux-kernel, Inki Dae, yingjoe.chen, sj.huang,
	Sean Paul, Philipp Zabel, Andy Yan, ck.hu, Vincent Palatin,
	Thierry Reding, Ajay Kumar, linux-arm-kernel, Rahul Sharma

On Wed, Jan 16, 2019 at 03:52:52PM +0800, Jitao Shi wrote:
> Use the mtk_pwm_data struction to define different registers
> and add MT8183 specific register operations, such as MT8183
> have commit register, needs to enable double buffer
> before writing register, and needs to select commit mode
> and use PWM_PERIOD/PWM_HIGH_WIDTH.

You forgot to add linux-pwm to the recipents.

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-17 13:00   ` Uwe Kleine-König
  0 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2019-01-17 13:00 UTC (permalink / raw)
  To: Jitao Shi
  Cc: Mark Rutland, David Airlie, dri-devel, Ajay Kumar,
	Vincent Palatin, yingjoe.chen, Thierry Reding, Sean Paul,
	Sascha Hauer, Pawel Moll, Ian Campbell, sj.huang, Rob Herring,
	linux-mediatek, Russell King, Matthias Brugger, eddie.huang,
	linux-arm-kernel, Rahul Sharma, srv_heupstream, linux-kernel,
	Kumar Gala, Andy Yan

On Wed, Jan 16, 2019 at 03:52:52PM +0800, Jitao Shi wrote:
> Use the mtk_pwm_data struction to define different registers
> and add MT8183 specific register operations, such as MT8183
> have commit register, needs to enable double buffer
> before writing register, and needs to select commit mode
> and use PWM_PERIOD/PWM_HIGH_WIDTH.

You forgot to add linux-pwm to the recipents.

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-17 13:00   ` Uwe Kleine-König
  0 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2019-01-17 13:00 UTC (permalink / raw)
  To: Jitao Shi
  Cc: Mark Rutland, David Airlie, dri-devel, Ajay Kumar,
	Vincent Palatin, bibby.hsieh, ck.hu, yingjoe.chen,
	Thierry Reding, Sean Paul, Sascha Hauer, Pawel Moll,
	Ian Campbell, Inki Dae, sj.huang, Rob Herring, linux-mediatek,
	Russell King, Matthias Brugger, eddie.huang, linux-arm-kernel,
	Rahul Sharma, srv_heupstream, linux-kernel, Philipp Zabel,
	Kumar Gala, Andy Yan

On Wed, Jan 16, 2019 at 03:52:52PM +0800, Jitao Shi wrote:
> Use the mtk_pwm_data struction to define different registers
> and add MT8183 specific register operations, such as MT8183
> have commit register, needs to enable double buffer
> before writing register, and needs to select commit mode
> and use PWM_PERIOD/PWM_HIGH_WIDTH.

You forgot to add linux-pwm to the recipents.

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-22  8:58 ` Jitao Shi
  0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-01-22  8:58 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	linux-pwm, David Airlie, Matthias Brugger
  Cc: Jitao Shi, Thierry Reding, Ajay Kumar, Inki Dae, Rahul Sharma,
	Sean Paul, Vincent Palatin, Andy Yan, Philipp Zabel,
	Russell King, devicetree, linux-kernel, dri-devel,
	linux-arm-kernel, linux-mediatek, srv_heupstream, Sascha Hauer,
	yingjoe.chen, eddie.huang, cawa.cheng, bibby.hsieh, ck.hu,
	stonea168

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(+)

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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-22  8:58 ` Jitao Shi
  0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-01-22  8:58 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	linux-pwm, David Airlie, Matthias Brugger
  Cc: stonea168, dri-devel, Andy Yan, Ajay Kumar, Vincent Palatin,
	cawa.cheng, Russell King, Thierry Reding, devicetree, Jitao Shi,
	linux-mediatek, yingjoe.chen, eddie.huang, linux-arm-kernel,
	Rahul Sharma, srv_heupstream, linux-kernel, Sascha Hauer,
	Sean Paul

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(+)

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);
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] pwm: Add MediaTek MT8183 display PWM driver support
@ 2019-01-22  8:58 ` Jitao Shi
  0 siblings, 0 replies; 11+ messages in thread
From: Jitao Shi @ 2019-01-22  8:58 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	linux-pwm, David Airlie, Matthias Brugger
  Cc: stonea168, dri-devel, Andy Yan, Ajay Kumar, Vincent Palatin,
	cawa.cheng, bibby.hsieh, ck.hu, Russell King, Thierry Reding,
	devicetree, Jitao Shi, Philipp Zabel, Inki Dae, linux-mediatek,
	yingjoe.chen, eddie.huang, linux-arm-kernel, Rahul Sharma,
	srv_heupstream, linux-kernel, Sascha Hauer, Sean Paul

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(+)

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);
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-01-22  8:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16  7:52 [PATCH] pwm: Add MediaTek MT8183 display PWM driver support Jitao Shi
2019-01-16  7:52 ` Jitao Shi
2019-01-16  7:52 ` Jitao Shi
2019-01-16 10:25 ` Matthias Brugger
2019-01-16 10:25   ` Matthias Brugger
2019-01-17 13:00 ` Uwe Kleine-König
2019-01-17 13:00   ` Uwe Kleine-König
2019-01-17 13:00   ` Uwe Kleine-König
2019-01-22  8:58 Jitao Shi
2019-01-22  8:58 ` Jitao Shi
2019-01-22  8:58 ` Jitao Shi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.