Skip to content

Commit

Permalink
dts64: mt7622: enable all pwm
Browse files Browse the repository at this point in the history
http://forum.banana-pi.org/t/bpi-r64-pwm-support/11140/13

based on
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/pinctrl/mediatek/pinctrl-mt7622.c?h=linux-5.4.y#n401

pwm1 (pins 9+11 on gpio-header on bpi-r64):

cd /sys/class/pwm/pwmchip0
echo "0" > export
cd pwm0
echo 10000 > period
echo 5000 > duty_cycle    #half brightness
echo 1 > enable
echo 1000 > duty_cycle    #darker ~ 1/10

mt7622 only supports 6 pwm-channels so drop pwm7
  • Loading branch information
frank-w committed Oct 5, 2020
1 parent a4957c7 commit 5546ea0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
Expand Up @@ -414,10 +414,15 @@
};
};

pwm7_pins: pwm1-2-pins {
pwm_pins: pwm-pins {
mux {
function = "pwm";
groups = "pwm_ch7_2";
groups = "pwm_ch1_0", /* mt7622_pwm_ch1_0_pins[] = { 51, }; */
"pwm_ch2_0", /* mt7622_pwm_ch2_0_pins[] = { 52, }; */
"pwm_ch3_2", /* mt7622_pwm_ch3_2_pins[] = { 97, }; */
"pwm_ch4_1", /* mt7622_pwm_ch4_1_pins[] = { 67, }; */
"pwm_ch5_0", /* mt7622_pwm_ch5_0_pins[] = { 68, }; */
"pwm_ch6_0"; /* mt7622_pwm_ch6_0_pins[] = { 69, }; */
};
};

Expand Down Expand Up @@ -537,7 +542,7 @@

&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm7_pins>;
pinctrl-0 = <&pwm_pins>;
status = "okay";
};

Expand Down

0 comments on commit 5546ea0

Please sign in to comment.