naz664 / crDroid_gsi

Script and patches for building PHH-Treble based crDroid GSI
170 stars 33 forks source link

Charging / Notification LED not working via Settings #120

Open AK-industries opened 3 weeks ago

AK-industries commented 3 weeks ago

In settings, the battery light toggle is enabled however the led does not turn on. It is not a hardware issue as I can turn the led on and off using echo > 1 /sys/class/leds/charging/brightness, which appears on the top of the front screen. In the /sys/class/leds/ folder there are folders called mt6360_pmu_led2 and 3 and 4, however changing the brightness file does not do anything. Doing echo > battery-charging triggers makes the phone reboot when unplugged. Maybe it is possible to apply a patch while building to map the led location with /sys/class/leds/charging ? I could make a magisk module to turn the led on and off however it wont work with notifications and will not be easily configurable via settings.

Device is Motorola Edge 20 Fusion / Lite Using: crDroid-10.8 v2024.09.13 crDroid-10.8-arm64_bvN-Unofficial.img.xz

does not work on any other gsi rom

https://docs.kernel.org/leds/leds-class.html

output of adb logcat | grep charging () 11-03 13:31:00.033 1565 1565 I : (3)[1565:accd.sh]mt_charger_set_property 11-03 13:31:02.581 0 0 I -(0)[0:swapper/0]mtk_charger_alarm_timer_func: not suspend, wake up charger 11-03 13:31:02.584 381 381 W -(2)[381:charger_thread]mt635x_auxadc_read_raw: 1 callbacks suppressed 11-03 13:31:02.584 381 381 I (2)[381:charger_thread]mt635x-auxadc mt635x-auxadc: name:BATADC, channel=0, adc_out=0x56ef, adc_result=4278 11-03 13:31:02.617 381 381 I (0)[381:charger_thread]mt635x-auxadc mt635x-auxadc: name:VBIF, channel=11, adc_out=0x9f6, adc_result=2801 11-03 13:31:02.618 381 381 I : (0)[381:charger_thread][CH3_DBG] bat_cur = 14282 11-03 13:31:02.619 381 381 I (0)[381:charger_thread]mt635x-auxadc mt635x-auxadc: name:BAT_TEMP, channel=3, adc_out=0x25f, adc_result=666 11-03 13:31:02.619 381 381 I (0)[381:charger_thread]Vbat=4278,Ibat=13995,I=0,VChr=4587,T=33,Soc=74: 75,CT:1:1 hv:1 pd:3:0 11-03 13:31:02.619 381 381 I (0)[381:charger_thread]mtk_charger_start_timer: alarm timer start:0, 1775 679559412 11-03 13:31:02.619 381 381 I : -(0)[381:charger_thread]alarmtimer_enqueue, 1775679559412 11-03 13:31:02.620 381 381 I (0)[381:charger_thread]mt635x-auxadc mt635x-auxadc: name:VBIF, channel=11, adc_out=0x9f5, adc_result=2800 11-03 13:31:02.620 381 381 I : (0)[381:charger_thread][CH3_DBG] bat_cur = 14331 11-03 13:31:02.621 381 381 I (1)[381:charger_thread]mt635x-auxadc mt635x-auxadc: name:BAT_TEMP, channel=3, adc_out=0x25c, adc_result=663 11-03 13:31:02.719 381 381 I : (2)[381:charger_thread][mmi_charger_check_status]batt=4273 mV, 1405 mA, 33 C, USB= 4587 mV 11-03 13:31:02.719 381 381 I : (2)[381:charger_thread]FFC temp zone 4, fv 4480 mV, chg iterm 548 mA 11-03 13:31:02.719 381 381 I : (2)[381:charger_thread][mmi_charger_check_status]FV 4480 mV, FCC 3000 mA 11-03 13:31:02.719 381 381 I : (2)[381:charger_thread][mmi_charger_check_status]Step State = MAX 11-03 13:31:02.719 381 381 I (2)[381:charger_thread][mmi_charger_check_status]EFFECTIVE: FV = 4480000, CDIS = 0, FCC = 3000000, USBICL = 3000000, DEMO_DISCHARG = 0 11-03 13:31:02.719 381 381 I (2)[381:charger_thread][mmi_charger_check_status]adaptive charging: disable_ibat = 0, disable_ichg = 0, enable HZ = 0, charging disable = 0 11-03 13:31:02.773 381 381 I (3)[381:charger_thread]mt6360_pmu_chg mt6360_pmu_chg.2.auto: mt6360_get_tchg: tchg = 35 11-03 13:31:02.903 381 381 I (2)[381:charger_thread]tmp: 33 (jeita:0 sm:0 cv:0 en:0) (sm:1) en:1 c:0 s:0 ov:0 sc:0 1 1 11-03 13:31:02.903 381 381 I : (2)[381:charger_thread]mtk_switch_charging_run [1 3], timer=0 11-03 13:31:02.904 381 381 I : (2)[381:charger_thread][CH3_DBG] bat_cur = 14959 11-03 13:31:02.907 381 381 I : (4)[381:charger_thread][CH3_DBG] bat_cur = 14837 11-03 13:31:02.909 381 381 I (4)[381:charger_thread]pe40_ready: 0 pps:0 hv:1 thermal:-1,-1 tmp:33,39,16 11-03 13:31:02.909 381 381 I (4)[381:charger_thread]type-C: aicr:3000000 11-03 13:31:02.909 381 381 I (4)[381:charger_thread]type-C: 3 current:3000 11-03 13:31:02.909 381 381 I (4)[381:charger_thread]sck: en:0 pid:0 3000000 0 3000000 -1 0 thermal.dis:0 11-03 13:31:02.909 381 381 I (4)[381:charger_thread]force: 0 thermal:-1,-1 pe4:-1,-1,0 setting:3000 3000 -1 sc:3000,0,0 type:1 usb_unlimited:0 usbif:0 usbsm:0 aicl:-1 atm:0 11-03 13:31:03.209 1640 1640 I : (6)[1640:accd.sh]mt_charger_set_property 11-03 13:31:03.215 381 381 I (7)[381:charger_thread]mt6360_pmu_chg mt6360_pmu_chg.2.auto: mt6360_dump_registers: ICHG = 3000mA, AICR = 3000mA, MIVR = 4600mV, IEOC = 200mA, CV = 4480mV 11-03 13:31:03.215 381 381 I (7)[381:charger_thread]mt6360_pmu_chg mt6360_pmu_chg.2.auto: mt6360_dump_registers: VBUS = 4587mV, IBUS = 1607mA, VSYS = 4276mV, VBAT = 4232mV, IBAT = 1357mA 11-03 13:31:03.215 381 381 I (7)[381:charger_thread]mt6360_pmu_chg mt6360_pmu_chg.2.auto: mt6360_dump_registers: CHG_EN = 1, CHG_STATUS = progress, CHG_STAT1 = 0xC0 11-03 13:31:03.215 381 381 I (7)[381:charger_thread]mt6360_pmu_chg mt6360_pmu_chg.2.auto: mt6360_dump_registers: CHG_CTRL1 = 0x00, CHG_CTRL2 = 0x1B 11-03 13:31:06.455 1702 1702 I : (7)[1702:accd.sh]mt_charger_set_property

output of adb logcat | grep battery 11-03 13:51:42.111 0 0 W (0)[1503:health@2.1-serv]healthd: battery l=80 v=4185 t=31.1 h=2 st=3 c=600 fc=4931000 cc=155 chg=u 11-03 13:51:51.522 332 332 I : (0)[332:battery_thread][fgauge_read_boot_battery_plug_out_status] rtc_invalid 0 plugout 0 bat_plug_out_time 0 sp3:0xc1 pl:1 1 11-03 13:51:51.588 332 332 I : (1)[332:battery_thread][CH3_DBG] bat_cur = 0 11-03 13:51:51.589 332 332 I : (1)[332:battery_thread]lbat 0 0 0 0 11-03 13:51:51.589 332 332 I (1)[332:battery_thread]car[11677,11925,11431,11909,11624, cycle_car:11678,ncar:-33462] c: 0 0 vbat:4185 vbus:5081 soc:79 80 gm3:0 0 0 0 11-03 13:51:51.589 332 332 I (1)[332:battery_thread]tmp: 31 65535 65535 hcar2:256 lcar2:54 time:3014 sw_iavg:0 -6 1 nafg_m:45 0 0 11-03 13:51:51.591 332 332 I : (3)[332:battery_thread]GM3log-nint-nafg 3014 3014 41871 41855 15 45 -1318 11-03 13:52:41.842 3017 3017 D ConstraintsHelper: construct key=battery_light_pulse available=true 11-03 13:52:41.843 3017 3017 D ConstraintsHelper: construct key=battery_light_full_charge_disabled available=true 11-03 13:52:42.110 0 0 W (7)[1503:health@2.1-serv]healthd: battery l=80 v=4185 t=31.2 h=2 st=3 c=0 fc=4931000 cc=155 chg=u 11-03 13:52:45.914 3017 3017 D ConstraintsHelper: construct key=battery_light_pulse available=true 11-03 13:52:45.915 3017 3017 D ConstraintsHelper: construct key=battery_light_full_charge_disabled available=true 11-03 13:52:51.593 332 332 I : (3)[332:battery_thread][fgauge_read_boot_battery_plug_out_status] rtc_invalid 0 plugout 0 bat_plug_out_time 0 sp3:0xc1 pl:1 1 11-03 13:52:51.595 332 332 I (4)[332:battery_thread]mt635x-auxadc mt635x-auxadc: name:BATADC, channel=0, adc_out=0x5509, adc_result=4185 11-03 13:52:51.680 332 332 I : (1)[332:battery_thread][CH3_DBG] bat_cur = 0 11-03 13:52:51.681 332 332 I : (2)[332:battery_thread]lbat 0 0 0 0 11-03 13:52:51.682 332 332 I (2)[332:battery_thread]car[11677,11925,11431,11909,11624, cycle_car:11678,ncar:-33462] c: 0 0 vbat:4185 vbus:5056 soc:79 80 gm3:0 0 0 0 11-03 13:52:51.682 332 332 I (2)[332:battery_thread]tmp: 31 65535 65535 hcar2:256 lcar2:54 time:3074 sw_iavg:0 -12 1 nafg_m:51 0 0 11-03 13:52:51.682 332 332 I : (2)[332:battery_thread]GM3log-nint-nafg 3074 3074 41871 41847 23 51 -1207

can provide more logs