]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.51/soc-rockchip-set-the-proper-pwm-for-rk3288.patch
Linux 4.19.51
[thirdparty/kernel/stable-queue.git] / releases / 4.19.51 / soc-rockchip-set-the-proper-pwm-for-rk3288.patch
CommitLineData
37554d48
SL
1From 64cffee13379c02c1e0f90f30dda7a5b7d9c6606 Mon Sep 17 00:00:00 2001
2From: Douglas Anderson <dianders@chromium.org>
3Date: Tue, 9 Apr 2019 13:49:05 -0700
4Subject: soc: rockchip: Set the proper PWM for rk3288
5
6[ Upstream commit bbdc00a7de24cc90315b1775fb74841373fe12f7 ]
7
8The rk3288 SoC has two PWM implementations available, the "old"
9implementation and the "new" one. You can switch between the two of
10them by flipping a bit in the grf.
11
12The "old" implementation is the default at chip power up but isn't the
13one that's officially supposed to be used. ...and, in fact, the
14driver that gets selected in Linux using the rk3288 device tree only
15supports the "new" implementation.
16
17Long ago I tried to get a switch to the right IP block landed in the
18PWM driver (search for "rk3288: Switch to use the proper PWM IP") but
19that got rejected. In the mean time the grf has grown a full-fledged
20driver that already sets other random bits like this. That means we
21can now get the fix landed.
22
23For those wondering how things could have possibly worked for the last
244.5 years, folks have mostly been relying on the bootloader to set
25this bit. ...but occasionally folks have pointed back to my old patch
26series [1] in downstream kernels.
27
28[1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1391597.html
29
30Signed-off-by: Douglas Anderson <dianders@chromium.org>
31Signed-off-by: Heiko Stuebner <heiko@sntech.de>
32Signed-off-by: Sasha Levin <sashal@kernel.org>
33---
34 drivers/soc/rockchip/grf.c | 2 ++
35 1 file changed, 2 insertions(+)
36
37diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
38index 96882ffde67e..3b81e1d75a97 100644
39--- a/drivers/soc/rockchip/grf.c
40+++ b/drivers/soc/rockchip/grf.c
41@@ -66,9 +66,11 @@ static const struct rockchip_grf_info rk3228_grf __initconst = {
42 };
43
44 #define RK3288_GRF_SOC_CON0 0x244
45+#define RK3288_GRF_SOC_CON2 0x24c
46
47 static const struct rockchip_grf_value rk3288_defaults[] __initconst = {
48 { "jtag switching", RK3288_GRF_SOC_CON0, HIWORD_UPDATE(0, 1, 12) },
49+ { "pwm select", RK3288_GRF_SOC_CON2, HIWORD_UPDATE(1, 1, 0) },
50 };
51
52 static const struct rockchip_grf_info rk3288_grf __initconst = {
53--
542.20.1
55