Skip to content

Commit

Permalink
soong: Add TARGET_HEALTH_CHARGING_CONTROL related configs
Browse files Browse the repository at this point in the history
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
Signed-off-by: Mohammad Hasan Keramat J <ikeramat@protonmail.com>
  • Loading branch information
hellobbn authored and bheatleyyy committed Sep 28, 2023
1 parent ff10696 commit 26e5fbf
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
45 changes: 45 additions & 0 deletions build/soong/Android.bp
Expand Up @@ -215,6 +215,51 @@ egl_display_array {
},
}

soong_config_module_type {
name: "health_charging_control",
module_type: "cc_defaults",
config_namespace: "customGlobalVars",
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",
Expand Down
19 changes: 19 additions & 0 deletions config/BoardConfigSoong.mk
Expand Up @@ -33,6 +33,13 @@ SOONG_CONFIG_customGlobalVars += \
bootloader_message_offset \
gralloc_handle_has_custom_content_md_reserved_size \
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 \
Expand Down Expand Up @@ -70,6 +77,11 @@ BOOTLOADER_MESSAGE_OFFSET ?= 0
TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS ?= 0
TARGET_GRALLOC_HANDLE_HAS_CUSTOM_CONTENT_MD_RESERVED_SIZE ?= false
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

Expand All @@ -80,6 +92,13 @@ SOONG_CONFIG_customGlobalVars_bootloader_message_offset := $(BOOTLOADER_MESSAGE_
SOONG_CONFIG_customGlobalVars_target_init_vendor_lib := $(TARGET_INIT_VENDOR_LIB)
SOONG_CONFIG_customGlobalVars_target_ld_shim_libs := $(subst $(space),:,$(TARGET_LD_SHIM_LIBS))
SOONG_CONFIG_customGlobalVars_target_surfaceflinger_udfps_lib := $(TARGET_SURFACEFLINGER_UDFPS_LIB)
SOONG_CONFIG_customGlobalVars_target_health_charging_control_charging_path := $(TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH)
SOONG_CONFIG_customGlobalVars_target_health_charging_control_charging_enabled := $(TARGET_HEALTH_CHARGING_CONTROL_CHARGING_ENABLED)
SOONG_CONFIG_customGlobalVars_target_health_charging_control_charging_disabled := $(TARGET_HEALTH_CHARGING_CONTROL_CHARGING_DISABLED)
SOONG_CONFIG_customGlobalVars_target_health_charging_control_deadline_path := $(TARGET_HEALTH_CHARGING_CONTROL_DEADLINE_PATH)
SOONG_CONFIG_customGlobalVars_target_health_charging_control_supports_bypass := $(TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS)
SOONG_CONFIG_customGlobalVars_target_health_charging_control_supports_deadline := $(TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_DEADLINE)
SOONG_CONFIG_customGlobalVars_target_health_charging_control_supports_toggle := $(TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_TOGGLE)
ifneq ($(filter $(QSSI_SUPPORTED_PLATFORMS),$(TARGET_BOARD_PLATFORM)),)
SOONG_CONFIG_customQcomVars_qcom_display_headers_namespace := vendor/qcom/opensource/commonsys-intf/display
else
Expand Down

0 comments on commit 26e5fbf

Please sign in to comment.