linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: mediatek: always use bus clock for PWM on MT7622
@ 2022-10-26  0:56 Daniel Golle
  2022-10-28  8:39 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Golle @ 2022-10-26  0:56 UTC (permalink / raw)
  To: linux-pwm, linux-kernel, linux-arm-kernel, linux-mediatek,
	Thierry Reding, Uwe Kleine-König, Matthias Brugger
  Cc: Fabien Parent, Zhi Mao, Sam Shih

According to MT7622 Reference Manual for Development Board v1.0 the PWM
unit found in the MT7622 SoC also comes with the PWM_CK_26M_SEL register
at offset 0x210 just like other modern MediaTek ARM64 SoCs.
And also MT7622 sets that register to 0x00000001 on reset which is
described as 'Select 26M fix CLK as BCLK' in the datasheet.
Hence set has_ck_26m_sel to true also for MT7622 which results in the
driver writing 0 to the PWM_CK_26M_SEL register which is described as
'Select bus CLK as BCLK'.

Fixes: 0c0ead76235db0 ("pwm: mediatek: Always use bus clock")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/pwm/pwm-mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index 2219cba033e348..5b5eeaff35da67 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -296,7 +296,7 @@ static const struct pwm_mediatek_of_data mt6795_pwm_data = {
 static const struct pwm_mediatek_of_data mt7622_pwm_data = {
 	.num_pwms = 6,
 	.pwm45_fixup = false,
-	.has_ck_26m_sel = false,
+	.has_ck_26m_sel = true,
 };
 
 static const struct pwm_mediatek_of_data mt7623_pwm_data = {
-- 
2.38.1


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

* Re: [PATCH] pwm: mediatek: always use bus clock for PWM on MT7622
  2022-10-26  0:56 [PATCH] pwm: mediatek: always use bus clock for PWM on MT7622 Daniel Golle
@ 2022-10-28  8:39 ` AngeloGioacchino Del Regno
  2022-11-17 11:57   ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-10-28  8:39 UTC (permalink / raw)
  To: Daniel Golle, linux-pwm, linux-kernel, linux-arm-kernel,
	linux-mediatek, Thierry Reding, Uwe Kleine-König,
	Matthias Brugger
  Cc: Fabien Parent, Zhi Mao, Sam Shih

Il 26/10/22 02:56, Daniel Golle ha scritto:
> According to MT7622 Reference Manual for Development Board v1.0 the PWM
> unit found in the MT7622 SoC also comes with the PWM_CK_26M_SEL register
> at offset 0x210 just like other modern MediaTek ARM64 SoCs.
> And also MT7622 sets that register to 0x00000001 on reset which is
> described as 'Select 26M fix CLK as BCLK' in the datasheet.
> Hence set has_ck_26m_sel to true also for MT7622 which results in the
> driver writing 0 to the PWM_CK_26M_SEL register which is described as
> 'Select bus CLK as BCLK'.
> 
> Fixes: 0c0ead76235db0 ("pwm: mediatek: Always use bus clock")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



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

* Re: [PATCH] pwm: mediatek: always use bus clock for PWM on MT7622
  2022-10-28  8:39 ` AngeloGioacchino Del Regno
@ 2022-11-17 11:57   ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2022-11-17 11:57 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Daniel Golle, linux-pwm, linux-kernel, linux-arm-kernel,
	linux-mediatek, Thierry Reding, Matthias Brugger, Fabien Parent,
	Zhi Mao, Sam Shih

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

On Fri, Oct 28, 2022 at 10:39:31AM +0200, AngeloGioacchino Del Regno wrote:
> Il 26/10/22 02:56, Daniel Golle ha scritto:
> > According to MT7622 Reference Manual for Development Board v1.0 the PWM
> > unit found in the MT7622 SoC also comes with the PWM_CK_26M_SEL register
> > at offset 0x210 just like other modern MediaTek ARM64 SoCs.
> > And also MT7622 sets that register to 0x00000001 on reset which is
> > described as 'Select 26M fix CLK as BCLK' in the datasheet.
> > Hence set has_ck_26m_sel to true also for MT7622 which results in the
> > driver writing 0 to the PWM_CK_26M_SEL register which is described as
> > 'Select bus CLK as BCLK'.
> > 
> > Fixes: 0c0ead76235db0 ("pwm: mediatek: Always use bus clock")
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2022-11-17 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26  0:56 [PATCH] pwm: mediatek: always use bus clock for PWM on MT7622 Daniel Golle
2022-10-28  8:39 ` AngeloGioacchino Del Regno
2022-11-17 11:57   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).