sm7250-common: Add support for smart charging and battery health

Signed-off-by: Sandeep-FED <sandymankara11@gmail.com>
This commit is contained in:
spkal01
2022-10-25 12:11:58 +05:30
committed by Sandeep-FED
parent e936225bf0
commit 5267f316f7
5 changed files with 36 additions and 0 deletions

View File

@@ -401,4 +401,16 @@
<!-- Path to fast charging status file to detect whether an oem fast charger is active --> <!-- Path to fast charging status file to detect whether an oem fast charger is active -->
<string name="config_oemFastChargerStatusPath" translatable="false">/sys/class/power_supply/battery/fastchg_status</string> <string name="config_oemFastChargerStatusPath" translatable="false">/sys/class/power_supply/battery/fastchg_status</string>
<!-- Smart charging -->
<bool name="config_smartChargingAvailable">true</bool>
<string name="config_smartChargingSysfsNode" translatable="false">/sys/class/power_supply/battery/input_suspend</string>
<string name="config_smartChargingSuspendValue" translatable="false">1</string>
<string name="config_smartChargingResumeValue" translatable="false">0</string>
<!-- Battery Health -->
<string name="config_batChargeCycle">/sys/class/power_supply/bms/cycle_count</string>
<string name="config_batDesCap">/sys/class/power_supply/bms/charge_full_design</string>
<string name="config_batCurCap">/sys/class/power_supply/bms/charge_full</string>
<bool name="config_supportBatteryHealth">true</bool>
</resources> </resources>

View File

@@ -17,4 +17,14 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Whether to show Smooth Display feature in Settings Options --> <!-- Whether to show Smooth Display feature in Settings Options -->
<bool name="config_show_smooth_display">true</bool> <bool name="config_show_smooth_display">true</bool>
<!-- Smart Charging -->
<bool name="config_supportSmartCharging">true</bool>
<!-- Battery Health -->
<bool name="config_supportBatteryHealth">true</bool>
<string name="config_batChargeCycle">/sys/class/power_supply/bms/cycle_count</string>
<string name="config_batDesCap">/sys/class/power_supply/bms/charge_full_design</string>
<string name="config_batCurCap">/sys/class/power_supply/bms/charge_full</string>
</resources> </resources>

View File

@@ -4,3 +4,7 @@ allow init platform_app:binder call;
allow init per_boot_file:file ioctl; allow init per_boot_file:file ioctl;
allowxperm init per_boot_file:file ioctl { F2FS_IOC_SET_PIN_FILE }; allowxperm init per_boot_file:file ioctl { F2FS_IOC_SET_PIN_FILE };
# Allow init to wrtie to sysfs_battery_supply
allow init sysfs_battery_supply:file { setattr };

View File

@@ -2,6 +2,7 @@ allow system_app sysfs_zram:dir search;
allow system_app proc_pagetypeinfo:file read; allow system_app proc_pagetypeinfo:file read;
allow system_app sysfs_dm:file rw_file_perms; allow system_app sysfs_dm:file rw_file_perms;
allow system_app sysfs_vibrator:file rw_file_perms; allow system_app sysfs_vibrator:file rw_file_perms;
allow system_app sysfs_vibrator:dir r_dir_perms; allow system_app sysfs_vibrator:dir r_dir_perms;
allow system_app sysfs_leds:dir search; allow system_app sysfs_leds:dir search;
@@ -9,3 +10,9 @@ allow system_app proc_pagetypeinfo:file r_file_perms;
allow system_app sysfs_zram:dir search; allow system_app sysfs_zram:dir search;
allow system_app sysfs_zram:file r_file_perms; allow system_app sysfs_zram:file r_file_perms;
allow system_app sysfs:file { getattr };
allow system_app vendor_sysfs_battery_supply:dir search;
allow system_app vendor_sysfs_battery_supply:file r_file_perms;

View File

@@ -1,2 +1,5 @@
# Allow system_server to read Fast Charging status # Allow system_server to read Fast Charging status
allow system_server vendor_sysfs_battery_supply:file { getattr open read }; allow system_server vendor_sysfs_battery_supply:file { getattr open read };
#Smart charging
allow system_server sysfs_battery_supply:file { getattr open read write };