Skip to content

Commit

Permalink
Merge pull request #17 from OnionIoT/Issue-51-enable-pwm
Browse files Browse the repository at this point in the history
[Issue-51]: enable pwm from device tree
  • Loading branch information
greenbreakfast authored Jun 23, 2023
2 parents b682f30 + 2cb7095 commit 16c4470
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ apply_patches() {

cd "$OPENWRT_DIR"

for file in $(find $PATCH_DIR -type f -name '*.patch'); do
for file in $(ls -1 $PATCH_DIR/*.patch); do
echo "Applying patch: $file"
if patch -p1 -f --dry-run < $file; then
patch -p1 -f < $file || return 1
Expand Down
22 changes: 22 additions & 0 deletions onion/patches/003-enable-pwm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -221,9 +221,6 @@
resets = <&rstctrl 31>;
reset-names = "pwm";

- pinctrl-names = "default";
- pinctrl-0 = <&pwm0_pins>, <&pwm1_pins>;
-
status = "disabled";
};

--- a/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi
+++ b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi
@@ -176,3 +176,7 @@
reg = <0x28 0x6>;
};
};
+
+&pwm {
+ status = "okay";
+};

0 comments on commit 16c4470

Please sign in to comment.