phhusson / treble_experimentations

Notes about tinkering with Android Project Treble
3.4k stars 660 forks source link

[Lenovo K5 Pro L38041] leds doesnt work in charging #1061

Open wirtal opened 4 years ago

wirtal commented 4 years ago

Device: Lenovo K5 Pro L38041 Treble-enabled: Yes Support: Arm64 a Vendor: stock 8.1 / 9.0 vendor LEDs doesnt work in charging.

I have /sys/class/leds :

root@kunlun:/ # find /sys/class/
/sys/class/leds
/sys/class/leds/red
/sys/class/leds/blue
/sys/class/leds/wled
/sys/class/leds/green
/sys/class/leds/led:flash_0
/sys/class/leds/led:flash_1
/sys/class/leds/led:flash_2
/sys/class/leds/lcd-backlight
/sys/class/leds/led:torch_0
/sys/class/leds/led:torch_1
/sys/class/leds/led:torch_2
/sys/class/leds/led:switch_0
/sys/class/leds/led:switch_1
/sys/class/leds/mmc0::
/sys/class/leds/mmc1::
/sys/class/leds/torch-light0_1
/sys/class/leds/torch-light0
/sys/class/leds/torch-light1

init.rc contains:

chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/jogball-backlight/brightness
chown system system /sys/class/leds/red/brightness
chmod 0660 /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/red/device/grpfreq
chown system system /sys/class/leds/red/device/grppwm
chown system system /sys/class/leds/red/device/blink

Turning on / off LED indicator manually works:

echo 255 > /sys/class/leds/red/brightness
echo 255 > /sys/class/leds/green/brightness
echo 255 > /sys/class/leds/blue/brightness

echo 0 > /sys/class/leds/red/brightness
echo 0 > /sys/class/leds/green/brightness
echo 0 > /sys/class/leds/blue/brightness

logcat.txt

phhusson commented 4 years ago

Does the led as notification led?

Please give ls -lZ /sys/class/leds/blue/brightness /sys/class/leds/green/brightness /sys/class/leds/red/brightness

Le jeu. 9 janv. 2020 à 09:20, wirtal notifications@github.com a écrit :

Device: Lenovo K5 Pro L38041 Treble-enabled: Yes Support: Arm64 a Vendor: stock 8.1 / 9.0 vendor LEDs doesnt work in charging.

I have /sys/class/leds :

root@kunlun:/ # find /sys/class/ /sys/class/leds /sys/class/leds/red /sys/class/leds/blue /sys/class/leds/wled /sys/class/leds/green /sys/class/leds/led:flash_0 /sys/class/leds/led:flash_1 /sys/class/leds/led:flash_2 /sys/class/leds/lcd-backlight /sys/class/leds/led:torch_0 /sys/class/leds/led:torch_1 /sys/class/leds/led:torch_2 /sys/class/leds/led:switch_0 /sys/class/leds/led:switch_1 /sys/class/leds/mmc0:: /sys/class/leds/mmc1:: /sys/class/leds/torch-light0_1 /sys/class/leds/torch-light0 /sys/class/leds/torch-light1

init.rc contains:

chown system system /sys/class/leds/keyboard-backlight/brightness chown system system /sys/class/leds/lcd-backlight/brightness chown system system /sys/class/leds/button-backlight/brightness chown system system /sys/class/leds/jogball-backlight/brightness chown system system /sys/class/leds/red/brightness chmod 0660 /sys/class/leds/red/brightness chown system system /sys/class/leds/green/brightness chown system system /sys/class/leds/blue/brightness chown system system /sys/class/leds/red/device/grpfreq chown system system /sys/class/leds/red/device/grppwm chown system system /sys/class/leds/red/device/blink

Turning on / off LED indicator manually works:

echo 255 > /sys/class/leds/red/brightness echo 255 > /sys/class/leds/green/brightness echo 255 > /sys/class/leds/blue/brightness

echo 0 > /sys/class/leds/red/brightness echo 0 > /sys/class/leds/green/brightness echo 0 > /sys/class/leds/blue/brightness

logcat.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

wirtal commented 4 years ago

Does the led as notification led? Please give ls -lZ /sys/class/leds/blue/brightness /sys/class/leds/green/brightness /sys/class/leds/red/brightness

Yes, the blue LED only works on notification

root@kunlun:/ # ls -lZ /sys/class/leds/blue/brightness /sys/class/leds/green/brightness /sys/class/leds/red/brightness
-rw-r--r-- 1 system system u:object_r:sysfs_graphics:s0 4096 1970-02-01 21:28 /sys/class/leds/blue/brightness
-rw-r--r-- 1 system system u:object_r:sysfs_graphics:s0 4096 1970-02-01 21:28 /sys/class/leds/green/brightness
-rw-rw---- 1 system system u:object_r:sysfs_graphics:s0 4096 1970-02-01 21:28 /sys/class/leds/red/brightness
wirtal commented 4 years ago

lshal.txt

Vendor backup: https://drive.google.com/open?id=1jg4X_jMd4dSJSTT1bjAAVHz0TE6OnYib

kwjxqy commented 4 years ago

Lenovo-K5P-Brightness-LED-Patch.zip K5P-Brightness-LED-Patch.zip

use twrp flash it

wirtal commented 4 years ago

Lenovo-K5P-Brightness-LED-Patch.zip K5P-Brightness-LED-Patch.zip

use twrp flash it

Thanks! After installation, I was able to correctly adjust colors using app - Light Flow Legacy: Led Control I noticed that minimum brightness level is higher than it used to be. Maximum brightness level reaches already at 40% adjustment.

kwjxqy commented 4 years ago

K5P-Brightness-LED-Patch.zip