build/patch/kernel/archive/meson64-6.4/meson-g12b-pinctrl-Add-missing-pinmux-for-pwm.patch

126 lines
3.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yuntian Zhang <yt@radxa.com>
Date: Thu, 13 Jan 2022 21:34:10 +0800
Subject: pinctrl: meson: Add several missing pinmux for pwm functions
The following pin definitions are mentioned in A311D Quick
Reference Manual and S922X Public Datasheet, but not in S905Y2
Quick Reference Manual, so adding them to meson-g12b family.
They are currently exposed in Radxa Zero 2's GPIO header.
Signed-off-by: Yuntian Zhang <yt@radxa.com>
---
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 34 ++++++++++
drivers/pinctrl/meson/pinctrl-meson-g12a.c | 14 +++-
2 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
index 431572b384db..3ef1982ba218 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
@@ -148,3 +148,37 @@ &pmu {
&npu {
power-domains = <&pwrc PWRC_G12A_NNA_ID>;
};
+
+&periphs_pinctrl {
+ pwm_b_h_pins: pwm-b-h {
+ mux {
+ groups = "pwm_b_h";
+ function = "pwm_b";
+ bias-disable;
+ };
+ };
+
+ pwm_b_z_pins: pwm-b-z {
+ mux {
+ groups = "pwm_b_z";
+ function = "pwm_b";
+ bias-disable;
+ };
+ };
+
+ pwm_c_z_pins: pwm-c-z {
+ mux {
+ groups = "pwm_c_z";
+ function = "pwm_c";
+ bias-disable;
+ };
+ };
+
+ pwm_d_z_pins: pwm-d-z {
+ mux {
+ groups = "pwm_d_z";
+ function = "pwm_d";
+ bias-disable;
+ };
+ };
+};
diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
index 74c0fd368586..bcf8b92d0c6f 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
@@ -270,17 +270,21 @@ static const unsigned int eth_act_led_pins[] = { GPIOZ_15 };
static const unsigned int pwm_a_pins[] = { GPIOX_6 };
/* pwm_b */
+static const unsigned int pwm_b_h_pins[] = { GPIOH_7 };
static const unsigned int pwm_b_x7_pins[] = { GPIOX_7 };
static const unsigned int pwm_b_x19_pins[] = { GPIOX_19 };
+static const unsigned int pwm_b_z_pins[] = { GPIOZ_0 };
/* pwm_c */
static const unsigned int pwm_c_c_pins[] = { GPIOC_4 };
static const unsigned int pwm_c_x5_pins[] = { GPIOX_5 };
static const unsigned int pwm_c_x8_pins[] = { GPIOX_8 };
+static const unsigned int pwm_c_z_pins[] = { GPIOZ_1 };
/* pwm_d */
static const unsigned int pwm_d_x3_pins[] = { GPIOX_3 };
static const unsigned int pwm_d_x6_pins[] = { GPIOX_6 };
+static const unsigned int pwm_d_z_pins[] = { GPIOZ_2 };
/* pwm_e */
static const unsigned int pwm_e_pins[] = { GPIOX_16 };
@@ -593,6 +597,9 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(bt565_a_din5, 2),
GROUP(bt565_a_din6, 2),
GROUP(bt565_a_din7, 2),
+ GROUP(pwm_b_z, 5),
+ GROUP(pwm_c_z, 5),
+ GROUP(pwm_d_z, 2),
GROUP(tsin_b_valid_z, 3),
GROUP(tsin_b_sop_z, 3),
GROUP(tsin_b_din0_z, 3),
@@ -725,6 +732,7 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(uart_c_rts, 2),
GROUP(iso7816_clk_h, 1),
GROUP(iso7816_data_h, 1),
+ GROUP(pwm_b_h, 5),
GROUP(pwm_f_h, 4),
GROUP(cec_ao_a_h, 4),
GROUP(cec_ao_b_h, 5),
@@ -1065,15 +1073,15 @@ static const char * const pwm_a_groups[] = {
};
static const char * const pwm_b_groups[] = {
- "pwm_b_x7", "pwm_b_x19",
+ "pwm_b_h", "pwm_b_x7", "pwm_b_x19", "pwm_b_z",
};
static const char * const pwm_c_groups[] = {
- "pwm_c_c", "pwm_c_x5", "pwm_c_x8",
+ "pwm_c_c", "pwm_c_x5", "pwm_c_x8", "pwm_c_z",
};
static const char * const pwm_d_groups[] = {
- "pwm_d_x3", "pwm_d_x6",
+ "pwm_d_x3", "pwm_d_x6", "pwm_d_z",
};
static const char * const pwm_e_groups[] = {
--
Armbian