summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/Kconfig.battery14
-rw-r--r--zephyr/projects/trogdor/lazor/prj.conf2
-rw-r--r--zephyr/projects/volteer/volteer/prj.conf2
-rw-r--r--zephyr/shim/include/config_chip.h16
4 files changed, 30 insertions, 4 deletions
diff --git a/zephyr/Kconfig.battery b/zephyr/Kconfig.battery
index a7ad8d74aa..4a41f7f60e 100644
--- a/zephyr/Kconfig.battery
+++ b/zephyr/Kconfig.battery
@@ -218,6 +218,20 @@ config PLATFORM_EC_CHARGER_NARROW_VDC
This should be enabled by charger drivers which need it. It cannot
be set otherwise, even in prj.conf
+config PLATFORM_EC_CHARGER_SENSE_RESISTOR
+ int "Value of the charge sense-resistor, in mOhms"
+ help
+ The charge sense-resistor is used to detect the charge current to the
+ battery. Its value must be known for the calculation to be correct.
+ The value is typically around 10 mOhms.
+
+config PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC
+ int "Value of the input sense-resistor, in mOhms"
+ help
+ The input sense-resistor is used to detect the input current from the
+ external AC power supply. Its value must be known for the calculation
+ to be correct. The value is typically around 10 mOhms.
+
config PLATFORM_EC_BATTERY_FUEL_GAUGE
bool "Board supplies battery info"
help
diff --git a/zephyr/projects/trogdor/lazor/prj.conf b/zephyr/projects/trogdor/lazor/prj.conf
index 25dcae5e4a..ec9cc78c66 100644
--- a/zephyr/projects/trogdor/lazor/prj.conf
+++ b/zephyr/projects/trogdor/lazor/prj.conf
@@ -60,6 +60,8 @@ CONFIG_PLATFORM_EC_BATTERY_CUT_OFF=y
CONFIG_PLATFORM_EC_BATTERY_PRESENT_GPIO=y
CONFIG_PLATFORM_EC_CHARGER_ISL9238=y
CONFIG_PLATFORM_EC_CHARGE_RAMP_HW=y
+CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR=10
+CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC=20
# USB-A
CONFIG_PLATFORM_EC_USB_A_PORT_COUNT=1
diff --git a/zephyr/projects/volteer/volteer/prj.conf b/zephyr/projects/volteer/volteer/prj.conf
index c1b8bc73c7..571f4fb66e 100644
--- a/zephyr/projects/volteer/volteer/prj.conf
+++ b/zephyr/projects/volteer/volteer/prj.conf
@@ -109,6 +109,8 @@ CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON=3
CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC=1
CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT=15000
CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON=15001
+CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR=10
+CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC=10
CONFIG_HAS_TASK_USB_CHG_P1=y
CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201=y
CONFIG_PLATFORM_EC_USB_PID=0x503e
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index e4d792f8b6..dc73ceae97 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -191,10 +191,6 @@
#undef CONFIG_CHARGER_ISL9241
#ifdef CONFIG_PLATFORM_EC_CHARGER_ISL9241
#define CONFIG_CHARGER_ISL9241
-
-/* TODO(b/175881762): Move to devicetree? */
-#define CONFIG_CHARGER_SENSE_RESISTOR 10
-#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
#endif
/*
@@ -1373,4 +1369,16 @@
#define CONFIG_CHARGER_DISCHARGE_ON_AC_CUSTOM
#endif
+#undef CONFIG_CHARGER_SENSE_RESISTOR
+#ifdef CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR
+#define CONFIG_CHARGER_SENSE_RESISTOR \
+ CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR
+#endif
+
+#undef CONFIG_CHARGER_SENSE_RESISTOR_AC
+#ifdef CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC
+#define CONFIG_CHARGER_SENSE_RESISTOR_AC \
+ CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC
+#endif
+
#endif /* __CROS_EC_CONFIG_CHIP_H */