Skip to content

Commit fc3d701

Browse files
ieiaommind
authored andcommitted
soc: rockchip: grf: Set pwm2/xin32k pad default to xin32k for rk3368
PWM2 and xin32k share the same pad, but some peripheral need the xin32k clock to run properly, such as tsadc. I have observed that this pad is used as xin32k by default on some existing board [1], so it maybe more appropriate to set it to xin32k by default. I also tested it on another rk3368 based board [2], without this adjust, tsadc does not work properly. [1] https://rockchip.fr/geekbox/Geekbox_V1.23.pdf [2] https://ieiao.github.io/wiki/embedded-dev/rockchip/rk3368 Signed-off-by: WeiHao Li <cn.liweihao@gmail.com> Link: https://patch.msgid.link/20250906142125.7602-1-cn.liweihao@gmail.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 3a86608 commit fc3d701

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • drivers/soc/rockchip

drivers/soc/rockchip/grf.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ static const struct rockchip_grf_info rk3368_grf __initconst = {
9898
.num_values = ARRAY_SIZE(rk3368_defaults),
9999
};
100100

101+
#define RK3368_PMUGRF_SOC_CON0 0x100
102+
103+
static const struct rockchip_grf_value rk3368_pmugrf_defaults[] __initconst = {
104+
{ "pwm2 select", RK3368_PMUGRF_SOC_CON0, FIELD_PREP_WM16_CONST(BIT(7), 0) },
105+
};
106+
107+
static const struct rockchip_grf_info rk3368_pmugrf __initconst = {
108+
.values = rk3368_pmugrf_defaults,
109+
.num_values = ARRAY_SIZE(rk3368_pmugrf_defaults),
110+
};
111+
101112
#define RK3399_GRF_SOC_CON7 0xe21c
102113

103114
static const struct rockchip_grf_value rk3399_defaults[] __initconst = {
@@ -175,6 +186,9 @@ static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
175186
}, {
176187
.compatible = "rockchip,rk3368-grf",
177188
.data = (void *)&rk3368_grf,
189+
}, {
190+
.compatible = "rockchip,rk3368-pmugrf",
191+
.data = (void *)&rk3368_pmugrf,
178192
}, {
179193
.compatible = "rockchip,rk3399-grf",
180194
.data = (void *)&rk3399_grf,

0 commit comments

Comments
 (0)