pwm: mediatek: add pwm3 support for mt7981
authorWeijie Gao <weijie.gao@mediatek.com>
Fri, 17 Jan 2025 09:18:06 +0000 (17:18 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 23 Jan 2025 18:11:49 +0000 (12:11 -0600)
This patch adds pwm channel 2 (pwm3) support for mt7981

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
arch/arm/dts/mt7981-emmc-rfb.dts
arch/arm/dts/mt7981-rfb.dts
arch/arm/dts/mt7981-sd-rfb.dts
arch/arm/dts/mt7981.dtsi
drivers/pwm/pwm-mtk.c

index 9aa7cd8..d6590f0 100644 (file)
                };
        };
 
+       /* pin13 as pwm0, pin15 as pwm1, pin7 as pwm2 */
+       three_pwm_pins_1: three-pwm-pins {
+               mux {
+                       function = "pwm";
+                       groups = "pwm0_0", "pwm1_1", "pwm2";
+               };
+       };
+
        mmc0_pins_default: mmc0default {
                mux {
                        function = "flash";
index 9b61373..d6ebd65 100644 (file)
                        groups = "pwm0_1", "pwm1_0", "pwm2";
                };
        };
+
+       /* pin13 as pwm0, pin15 as pwm1, pin7 as pwm2 */
+       three_pwm_pins_1: three-pwm-pins {
+               mux {
+                       function = "pwm";
+                       groups = "pwm0_0", "pwm1_1", "pwm2";
+               };
+       };
 };
 
 &spi0 {
index 7d70808..50ded1e 100644 (file)
                };
        };
 
+       /* pin13 as pwm0, pin15 as pwm1, pin7 as pwm2 */
+       three_pwm_pins_1: three-pwm-pins {
+               mux {
+                       function = "pwm";
+                       groups = "pwm0_0", "pwm1_1", "pwm2";
+               };
+       };
+
        mmc0_pins_default: mmc0default {
                mux {
                        function = "flash";
index a9991a1..43e5058 100644 (file)
                         <&infracfg CLK_INFRA_PWM1_CK>,
                         <&infracfg CLK_INFRA_PWM2_CK>,
                         <&infracfg CLK_INFRA_PWM3_CK>;
-               assigned-clocks = <&topckgen CLK_TOP_PWM_SEL>;
-               assigned-clock-parents = <&topckgen CLK_TOP_CB_CKSQ_40M>;
+               assigned-clocks = <&topckgen CLK_TOP_PWM_SEL>,
+                                 <&infracfg CLK_INFRA_PWM1_SEL>,
+                                 <&infracfg CLK_INFRA_PWM2_SEL>,
+                                 <&infracfg CLK_INFRA_PWM3_SEL>;
+               assigned-clock-parents = <&topckgen CLK_TOP_CB_CKSQ_40M>,
+                                        <&topckgen CLK_TOP_PWM_SEL>,
+                                        <&topckgen CLK_TOP_PWM_SEL>,
+                                        <&topckgen CLK_TOP_PWM_SEL>;
                clock-names = "top", "main", "pwm1", "pwm2", "pwm3";
                status = "disabled";
        };
index 9776a41..5cf2eba 100644 (file)
@@ -192,7 +192,7 @@ static const struct mtk_pwm_soc mt7629_data = {
 };
 
 static const struct mtk_pwm_soc mt7981_data = {
-       .num_pwms = 2,
+       .num_pwms = 3,
        .pwm45_fixup = false,
        .reg_ver = PWM_REG_V2,
 };