From e1e66c32b7a9ce7cf52922fe073c4bff40054599 Mon Sep 17 00:00:00 2001 From: Yuntian Zhang Date: Thu, 13 Jan 2022 21:34:10 +0800 Subject: [PATCH] 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 --- arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 42 +++++++++++++++++++++ drivers/pinctrl/meson/pinctrl-meson-g12a.c | 16 ++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi index 86e6ceb31..b2f9a09b2 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi @@ -149,3 +149,45 @@ &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; + }; + }; + + pwm_d_a_pins: pwm-d-a { + mux { + groups = "pwm_d_a"; + function = "pwm_d"; + bias-disable; + }; + }; +}; diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c index e2788bfc5..c94360afc 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c +++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c @@ -268,17 +268,22 @@ 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 }; +static const unsigned int pwm_d_a_pins[] = { GPIOA_4 }; /* pwm_e */ static const unsigned int pwm_e_pins[] = { GPIOX_16 }; @@ -591,6 +596,10 @@ static const 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(pwm_d_a, 3), GROUP(tsin_b_valid_z, 3), GROUP(tsin_b_sop_z, 3), GROUP(tsin_b_din0_z, 3), @@ -723,6 +732,7 @@ static const 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), @@ -1058,15 +1068,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", "pwm_d_a", }; static const char * const pwm_e_groups[] = { -- 2.49.0