]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pwm: mediatek: Always use bus clock
authorFabien Parent <fparent@baylibre.com>
Mon, 19 Oct 2020 14:07:02 +0000 (16:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:39:12 +0000 (07:39 +0200)
commita41edf64a0d17ee39bb5c0401f2ca98567cea5b6
treebb6cbea9c4ac890243ba9588cd100810d681b777
parenta570efb4d877adbf3db2dc95487f2ba6bfdd148a
pwm: mediatek: Always use bus clock

[ Upstream commit 0c0ead76235db0bcfaab83f04db546995449d002 ]

The MediaTek PWM IP can sometimes use the 26 MHz source clock to
generate the PWM signal, but the driver currently assumes that we always
use the PWM bus clock to generate the PWM signal.

This commit modifies the PWM driver in order to force the PWM IP to
always use the bus clock as source clock.

I do not have the datasheet of all the MediaTek SoC, so I don't know if
the register to choose the source clock is present in all the SoCs or
only in subset. As a consequence I made this change optional by using a
platform data paremeter to says whether this register is supported or
not. On all the SoCs I don't have the datasheet (MT2712, MT7622, MT7623,
MT7628, MT7629) I kept the behavior to be the same as before this
change.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Stable-dep-of: 7ca59947b5fc ("pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-mediatek.c