summaryrefslogtreecommitdiff
path: root/board/casta/battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/casta/battery.c')
-rw-r--r--board/casta/battery.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/board/casta/battery.c b/board/casta/battery.c
index 81e2d98e40..846165ff13 100644
--- a/board/casta/battery.c
+++ b/board/casta/battery.c
@@ -14,7 +14,8 @@
#define CHARGING_VOLTAGE_MV_SAFE 8400
#define CHARGING_CURRENT_MA_SAFE 1500
-
+#define CHARGING_VOLTAGE_MV_ADJUST 8600
+#define CHARGING_CURRENT_MA_ADJUST 3200
/*
* Battery info for all casta battery types. Note that the fields
* start_charging_min/max and charging_min/max are not used for the charger.
@@ -103,7 +104,11 @@ int charger_profile_override(struct charge_state_data *curr)
return 0;
current = curr->requested_current;
+ if (current > CHARGING_CURRENT_MA_ADJUST)
+ current = CHARGING_CURRENT_MA_ADJUST;
voltage = curr->requested_voltage;
+ if (voltage > CHARGING_VOLTAGE_MV_ADJUST)
+ voltage = CHARGING_VOLTAGE_MV_ADJUST;
bat_temp_c = curr->batt.temperature - 2731;
batt_info = battery_get_info();