summaryrefslogtreecommitdiff
path: root/test/charge_ramp.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/charge_ramp.c')
-rw-r--r--test/charge_ramp.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/test/charge_ramp.c b/test/charge_ramp.c
index 4c5c01b64c..e3dce7a860 100644
--- a/test/charge_ramp.c
+++ b/test/charge_ramp.c
@@ -36,12 +36,34 @@ static int charge_limit_ma;
/* Mock functions */
-int board_is_ramp_allowed(int supplier)
+/* Override test_mockable implementations in charge_ramp module */
+int chg_ramp_allowed(int supplier)
{
/* Ramp for TEST4-TEST8 */
return supplier > CHARGE_SUPPLIER_TEST3;
}
+int chg_ramp_max(int supplier, int sup_curr)
+{
+ if (supplier == CHARGE_SUPPLIER_TEST7)
+ return 1600;
+ else if (supplier == CHARGE_SUPPLIER_TEST8)
+ return 2400;
+ else
+ return 3000;
+}
+
+/* These usb_charger functions are unused, but necessary to link */
+int usb_charger_ramp_allowed(int supplier)
+{
+ return 0;
+}
+
+int usb_charger_ramp_max(int supplier, int sup_curr)
+{
+ return 0;
+}
+
int board_is_consuming_full_charge(void)
{
return charge_limit_ma <= system_load_current_ma;
@@ -61,16 +83,6 @@ void board_set_charge_limit(int port, int supplier, int limit_ma,
task_set_event(TASK_ID_TEST_RUNNER, TASK_EVENT_OVERCURRENT, 0);
}
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- if (supplier == CHARGE_SUPPLIER_TEST7)
- return 1600;
- else if (supplier == CHARGE_SUPPLIER_TEST8)
- return 2400;
- else
- return 3000;
-}
-
/* Test utilities */
static void plug_charger_with_ts(int supplier_type, int port, int min_current,