From e291e34b83779251ecc4a6f0f567c7b47c9e2a8e Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 28 Sep 2020 15:10:52 +0200 Subject: [PATCH] patch sto set bat charge current in dts --- ...atch => 0025_TE_irq_no_more_tearing.patch} | 0 .../0026_set_bat_charge_current_in_dts.patch | 45 +++++++++++++++++++ .../usr/local/sbin/low_bat_check | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) rename FunKey/board/funkey/patches/linux/{0024_TE_irq_no_more_tearing.patch => 0025_TE_irq_no_more_tearing.patch} (100%) create mode 100644 FunKey/board/funkey/patches/linux/0026_set_bat_charge_current_in_dts.patch diff --git a/FunKey/board/funkey/patches/linux/0024_TE_irq_no_more_tearing.patch b/FunKey/board/funkey/patches/linux/0025_TE_irq_no_more_tearing.patch similarity index 100% rename from FunKey/board/funkey/patches/linux/0024_TE_irq_no_more_tearing.patch rename to FunKey/board/funkey/patches/linux/0025_TE_irq_no_more_tearing.patch diff --git a/FunKey/board/funkey/patches/linux/0026_set_bat_charge_current_in_dts.patch b/FunKey/board/funkey/patches/linux/0026_set_bat_charge_current_in_dts.patch new file mode 100644 index 0000000..13a4ae0 --- /dev/null +++ b/FunKey/board/funkey/patches/linux/0026_set_bat_charge_current_in_dts.patch @@ -0,0 +1,45 @@ +From 709159a6428f696915df4ff9795af86ddc328740 Mon Sep 17 00:00:00 2001 +From: vincent +Date: Mon, 28 Sep 2020 15:05:59 +0200 +Subject: [PATCH] battery charge current set to 400mA + +--- + arch/arm/boot/dts/sun8i-v3s-funkey.dts | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/sun8i-v3s-funkey.dts b/arch/arm/boot/dts/sun8i-v3s-funkey.dts +index 24e26b2..ffff865 100644 +--- a/arch/arm/boot/dts/sun8i-v3s-funkey.dts ++++ b/arch/arm/boot/dts/sun8i-v3s-funkey.dts +@@ -63,6 +63,11 @@ + default-brightness-level = <11>; + power-supply = <®_vcc5v0>; + }; ++ ++ bat: battery { ++ compatible = "simple-battery"; ++ constant_charge_current_max_microamp = <400000>; ++ }; + }; + + &codec { +@@ -121,6 +126,7 @@ + + &battery_power_supply { + status = "okay"; ++ monitored-battery = <&bat>; + }; + + &usb_power_supply { +@@ -177,7 +183,7 @@ + reg = <0>; + spi-max-frequency = <50000000>; + txbuflen = <115202>; +-// txbuflen = <0>; ++ //txbuflen = <0>; + spi_async_mode = "true"; + //interlacing = "true"; + rotate = <0>; +-- +1.9.1 + diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/low_bat_check b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/low_bat_check index cc43a09..142646c 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/low_bat_check +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/low_bat_check @@ -5,7 +5,7 @@ THRESHOLD_PERCENT_LOW_BAT=5 THRESHOLD_PERCENT_EXTREMELY_LOW_BAT=2 MAX_EXTREMELY_LOW_BAT_BEFORE_SHUTDOWN=5 SLEEP_SECS=2 -RESCALE_MAX_PERCENTAGE=112 +RESCALE_MAX_PERCENTAGE=120 # Blink Low bat constants declaration BLINK_ICON=0