diff --git a/README.md b/README.md index f749ca1..ce7787e 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,9 @@ Oct 19 06:11:32 nixos kernel: sunxi-mmc 1c10000.mmc: send stop command failed Is not in currently in DTB at all. Maybe use sun7i-a20 as example. It has a "codec" block. See the S3 manual, grep for I2S/PCM. + +## Power Supply +See `/sys/class/power_supply/axp20x-ac`. +See `/sys/class/power_supply/axp20x-battery/{status,capacity}`. +Green LED if power is on. +Red LED if battery is charging. diff --git a/configuration.nix b/configuration.nix index 2c9f089..fde28cf 100644 --- a/configuration.nix +++ b/configuration.nix @@ -46,6 +46,7 @@ in ''; } { name = "pinecube-ir-leds"; patch = ./kernel/0001-ARM-dts-sun8i-s3l-fix-Pinecube-IR-LEDs.patch; } + { name = "pinecube-add-battery"; patch = ./kernel/0002-ARM-dts-sun8i-s3l-add-battery-power-supply-to-pinecu.patch; } ]; boot.extraModulePackages = [ config.boot.kernelPackages.rtl8189es ]; diff --git a/kernel/0002-ARM-dts-sun8i-s3l-add-battery-power-supply-to-pinecu.patch b/kernel/0002-ARM-dts-sun8i-s3l-add-battery-power-supply-to-pinecu.patch new file mode 100644 index 0000000..5622416 --- /dev/null +++ b/kernel/0002-ARM-dts-sun8i-s3l-add-battery-power-supply-to-pinecu.patch @@ -0,0 +1,29 @@ +From 08043145ab7046e85339a9bd3221cc8ee53e64e5 Mon Sep 17 00:00:00 2001 +From: Daniel Fullmer +Date: Fri, 23 Oct 2020 16:05:10 -0700 +Subject: [PATCH 2/2] ARM: dts: sun8i: s3l: add battery power supply to + pinecube + +Signed-off-by: Daniel Fullmer +--- + arch/arm/boot/dts/sun8i-s3-pinecube.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm/boot/dts/sun8i-s3-pinecube.dts b/arch/arm/boot/dts/sun8i-s3-pinecube.dts +index a4adf52ef406..0319327dea3c 100644 +--- a/arch/arm/boot/dts/sun8i-s3-pinecube.dts ++++ b/arch/arm/boot/dts/sun8i-s3-pinecube.dts +@@ -169,6 +169,10 @@ &ac_power_supply { + status = "okay"; + }; + ++&battery_power_supply { ++ status = "okay"; ++}; ++ + ®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1250000>; +-- +2.28.0 +