From 642f9ee90eb39b0426d374f160fd894a0fce3f72 Mon Sep 17 00:00:00 2001 From: Daniel Fullmer Date: Fri, 23 Oct 2020 16:26:33 -0700 Subject: [PATCH] Fix IR LED ACTIVE_HIGH --- README.md | 2 -- configuration.nix | 3 +- ...M-dts-sun8i-s3l-fix-Pinecube-IR-LEDs.patch | 32 +++++++++++++++++++ .../Pine64-PineCube-support.patch | 0 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 kernel/0001-ARM-dts-sun8i-s3l-fix-Pinecube-IR-LEDs.patch rename Pine64-PineCube-support.patch => kernel/Pine64-PineCube-support.patch (100%) diff --git a/README.md b/README.md index 4cef160..f749ca1 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,6 @@ $ mpv "rtmp://192.168.1.200/live/pinecube" --profile=low-latency --cache-secs=1 $ echo 1 > /sys/class/leds/pine64\:ir\:led1/brightness $ echo 1 > /sys/class/leds/pine64\:ir\:led2/brightness ``` -(Except they seem to be reversed. Setting 0 brightness turns them on, setting 1 turns them off) -Change it to `ACTIVE_HIGH` in dtb? ## GPIO: https://linux-sunxi.org/GPIO diff --git a/configuration.nix b/configuration.nix index 5b887ad..2c9f089 100644 --- a/configuration.nix +++ b/configuration.nix @@ -33,7 +33,7 @@ in boot.kernelPackages = pkgs.linuxPackages_5_9; boot.kernelPatches = [ { name = "pine64-pinecube"; - patch = ./Pine64-PineCube-support.patch; + patch = ./kernel/Pine64-PineCube-support.patch; # sunxi_defconfig is missing wireless support # TODO: Are all of these options needed here? extraConfig = '' @@ -45,6 +45,7 @@ in RFKILL_GPIO y ''; } + { name = "pinecube-ir-leds"; patch = ./kernel/0001-ARM-dts-sun8i-s3l-fix-Pinecube-IR-LEDs.patch; } ]; boot.extraModulePackages = [ config.boot.kernelPackages.rtl8189es ]; diff --git a/kernel/0001-ARM-dts-sun8i-s3l-fix-Pinecube-IR-LEDs.patch b/kernel/0001-ARM-dts-sun8i-s3l-fix-Pinecube-IR-LEDs.patch new file mode 100644 index 0000000..e66ee59 --- /dev/null +++ b/kernel/0001-ARM-dts-sun8i-s3l-fix-Pinecube-IR-LEDs.patch @@ -0,0 +1,32 @@ +From 7ad2976267f04f3b29327e470c9698bd689775d8 Mon Sep 17 00:00:00 2001 +From: Daniel Fullmer +Date: Fri, 23 Oct 2020 16:04:15 -0700 +Subject: [PATCH 1/2] ARM: dts: sun8i: s3l: fix Pinecube IR LEDs + +Signed-off-by: Daniel Fullmer +--- + arch/arm/boot/dts/sun8i-s3-pinecube.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/sun8i-s3-pinecube.dts b/arch/arm/boot/dts/sun8i-s3-pinecube.dts +index 9bab6b7f4014..a4adf52ef406 100644 +--- a/arch/arm/boot/dts/sun8i-s3-pinecube.dts ++++ b/arch/arm/boot/dts/sun8i-s3-pinecube.dts +@@ -25,12 +25,12 @@ leds { + + led1 { + label = "pine64:ir:led1"; +- gpios = <&pio 1 10 GPIO_ACTIVE_LOW>; /* PB10 */ ++ gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */ + }; + + led2 { + label = "pine64:ir:led2"; +- gpios = <&pio 1 12 GPIO_ACTIVE_LOW>; /* PB12 */ ++ gpios = <&pio 1 12 GPIO_ACTIVE_HIGH>; /* PB12 */ + }; + }; + +-- +2.28.0 + diff --git a/Pine64-PineCube-support.patch b/kernel/Pine64-PineCube-support.patch similarity index 100% rename from Pine64-PineCube-support.patch rename to kernel/Pine64-PineCube-support.patch