Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2decc666 authored by Luofan Chen's avatar Luofan Chen Committed by Michael Bestas
Browse files

soong: Add TARGET_HEALTH_CHARGING_CONTROL related configs

To specify the charging control allowed modes:
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_{BYPASS,DEADLINE,TOGGLE},

To specify the charging control paths:
TARGET_HEALTH_CHARGING_CONTROL_{CHARGING_PATH,DEADLINE_PATH},

To specify data written to TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH:
TARGET_HEALTH_CHARGING_CONTROL_CHARGING_{ENABLE,DISABLE}

Change-Id: I88831c84966f82648c8ca60de5abb34416140f6c
parent 97f0f8e3
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -205,6 +205,51 @@ egl_display_array {
    },
}

soong_config_module_type {
    name: "health_charging_control",
    module_type: "cc_defaults",
    config_namespace: "lineageGlobalVars",
    bool_variables: [
        "target_health_charging_control_supports_toggle",
        "target_health_charging_control_supports_bypass",
        "target_health_charging_control_supports_deadline",
    ],
    value_variables: [
        "target_health_charging_control_charging_path",
        "target_health_charging_control_charging_enabled",
        "target_health_charging_control_charging_disabled",
        "target_health_charging_control_deadline_path",
    ],
    properties: ["cppflags"],
}

health_charging_control {
    name: "health_charging_control_defaults",
    soong_config_variables: {
        target_health_charging_control_supports_toggle: {
            cppflags: ["-DHEALTH_CHARGING_CONTROL_SUPPORTS_TOGGLE"],
        },
        target_health_charging_control_supports_bypass: {
            cppflags: ["-DHEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS"],
        },
        target_health_charging_control_supports_deadline: {
            cppflags: ["-DHEALTH_CHARGING_CONTROL_SUPPORTS_DEADLINE"],
        },
        target_health_charging_control_charging_path: {
            cppflags: ["-DHEALTH_CHARGING_CONTROL_CHARGING_PATH=\"%s\""],
        },
        target_health_charging_control_charging_enabled: {
            cppflags: ["-DHEALTH_CHARGING_CONTROL_CHARGING_ENABLED=\"%s\""],
        },
        target_health_charging_control_charging_disabled: {
            cppflags: ["-DHEALTH_CHARGING_CONTROL_CHARGING_DISABLED=\"%s\""],
        },
        target_health_charging_control_deadline_path: {
            cppflags: ["-DHEALTH_CHARGING_CONTROL_DEADLINE_PATH=\"%s\""],
        },
    },
}

// NVIDIA specific config modules
soong_config_module_type {
    name: "nvidia_enhancements",
+19 −0
Original line number Diff line number Diff line
@@ -31,6 +31,13 @@ SOONG_CONFIG_lineageGlobalVars += \
    additional_gralloc_10_usage_bits \
    bootloader_message_offset \
    gralloc_handle_has_reserved_size \
    target_health_charging_control_charging_path \
    target_health_charging_control_charging_enabled \
    target_health_charging_control_charging_disabled \
    target_health_charging_control_deadline_path \
    target_health_charging_control_supports_bypass \
    target_health_charging_control_supports_deadline \
    target_health_charging_control_supports_toggle \
    target_init_vendor_lib \
    target_ld_shim_libs \
    target_surfaceflinger_udfps_lib \
@@ -65,6 +72,11 @@ SOONG_CONFIG_lineageQcomVars_uses_pre_uplink_features_netmgrd := $(TARGET_USES_P
BOOTLOADER_MESSAGE_OFFSET ?= 0
TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS ?= 0
TARGET_GRALLOC_HANDLE_HAS_RESERVED_SIZE ?= false
TARGET_HEALTH_CHARGING_CONTROL_CHARGING_ENABLED ?= 1
TARGET_HEALTH_CHARGING_CONTROL_CHARGING_DISABLED ?= 0
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS ?= true
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_DEADLINE ?= false
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_TOGGLE ?= true
TARGET_INIT_VENDOR_LIB ?= vendor_init
TARGET_SURFACEFLINGER_UDFPS_LIB ?= surfaceflinger_udfps_lib
TARGET_TRUST_USB_CONTROL_PATH ?= /proc/sys/kernel/deny_new_usb
@@ -74,6 +86,13 @@ TARGET_TRUST_USB_CONTROL_DISABLE ?= 0
# Soong value variables
SOONG_CONFIG_lineageGlobalVars_additional_gralloc_10_usage_bits := $(TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS)
SOONG_CONFIG_lineageGlobalVars_bootloader_message_offset := $(BOOTLOADER_MESSAGE_OFFSET)
SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_charging_path := $(TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH)
SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_charging_enabled := $(TARGET_HEALTH_CHARGING_CONTROL_CHARGING_ENABLED)
SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_charging_disabled := $(TARGET_HEALTH_CHARGING_CONTROL_CHARGING_DISABLED)
SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_deadline_path := $(TARGET_HEALTH_CHARGING_CONTROL_DEADLINE_PATH)
SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_supports_bypass := $(TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS)
SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_supports_deadline := $(TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_DEADLINE)
SOONG_CONFIG_lineageGlobalVars_target_health_charging_control_supports_toggle := $(TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_TOGGLE)
SOONG_CONFIG_lineageGlobalVars_target_init_vendor_lib := $(TARGET_INIT_VENDOR_LIB)
SOONG_CONFIG_lineageGlobalVars_target_ld_shim_libs := $(subst $(space),:,$(TARGET_LD_SHIM_LIBS))
SOONG_CONFIG_lineageGlobalVars_target_surfaceflinger_udfps_lib := $(TARGET_SURFACEFLINGER_UDFPS_LIB)