summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/chell/board.c33
-rw-r--r--board/coral/board.c23
-rw-r--r--board/coral/board.h2
-rw-r--r--board/elm/board.c33
-rw-r--r--board/eve/board.c23
-rw-r--r--board/eve/board.h2
-rw-r--r--board/glados/board.c33
-rw-r--r--board/kahlee/board.c33
-rw-r--r--board/kahlee/board.h2
-rw-r--r--board/kevin/board.h2
-rw-r--r--board/kevin/charge_ramp.c23
-rw-r--r--board/oak/board.c33
-rw-r--r--board/poppy/board.c33
-rw-r--r--board/reef/board.c23
-rw-r--r--board/reef/board.h2
-rw-r--r--board/reef_it8320/board.c23
-rw-r--r--board/reef_it8320/board.h2
-rw-r--r--board/rowan/board.c33
-rw-r--r--board/samus_pd/board.c33
-rw-r--r--board/samus_pd/board.h2
-rw-r--r--board/zoombini/board.c23
21 files changed, 7 insertions, 409 deletions
diff --git a/board/chell/board.c b/board/chell/board.c
index ca0ed3d276..5fc0a47965 100644
--- a/board/chell/board.c
+++ b/board/chell/board.c
@@ -354,39 +354,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
}
-/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_PROPRIETARY;
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
/* Called on AP S5 -> S3 transition */
static void board_chipset_startup(void)
{
diff --git a/board/coral/board.c b/board/coral/board.c
index e8d7ad537d..a99efa85ef 100644
--- a/board/coral/board.c
+++ b/board/coral/board.c
@@ -672,29 +672,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return (supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_OTHER);
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- return bd9995x_get_bc12_ilim(supplier);
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/coral/board.h b/board/coral/board.h
index b5045d5a29..59d879c690 100644
--- a/board/coral/board.h
+++ b/board/coral/board.h
@@ -48,7 +48,7 @@
/* Charger */
#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGE_RAMP
+#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_CHARGE_STATE_DEBUG
#define CONFIG_CHARGER
#define CONFIG_CHARGER_V2
diff --git a/board/elm/board.c b/board/elm/board.c
index 775960d424..6d7d9746bb 100644
--- a/board/elm/board.c
+++ b/board/elm/board.c
@@ -339,39 +339,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_PROPRIETARY;
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
-/**
* Set AP reset.
* AP_RESET_L (PC3, CPU_WARM_RESET_L) is connected to PMIC SYSRSTB
*/
diff --git a/board/eve/board.c b/board/eve/board.c
index b75281affa..0b02f79570 100644
--- a/board/eve/board.c
+++ b/board/eve/board.c
@@ -542,29 +542,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return (supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_OTHER);
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- return bd9995x_get_bc12_ilim(supplier);
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/eve/board.h b/board/eve/board.h
index 76fcde231f..33fbc07436 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -88,7 +88,7 @@
/* Charger */
#define CONFIG_CHARGE_MANAGER
#define CONFIG_CHARGE_MANAGER_EXTERNAL_POWER_LIMIT
-#define CONFIG_CHARGE_RAMP
+#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_CHARGER
#define CONFIG_CHARGER_V2
#define CONFIG_CHARGER_BD9995X
diff --git a/board/glados/board.c b/board/glados/board.c
index 26cc595de7..e435cad8eb 100644
--- a/board/glados/board.c
+++ b/board/glados/board.c
@@ -321,39 +321,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
}
-/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_PROPRIETARY;
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
/* Enable or disable input devices, based upon chipset state and tablet mode */
static void enable_input_devices(void)
{
diff --git a/board/kahlee/board.c b/board/kahlee/board.c
index 365cbb28bf..b361574e21 100644
--- a/board/kahlee/board.c
+++ b/board/kahlee/board.c
@@ -417,39 +417,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return (supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_OTHER);
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/kahlee/board.h b/board/kahlee/board.h
index 07f4d29500..7d74ab20cf 100644
--- a/board/kahlee/board.h
+++ b/board/kahlee/board.h
@@ -32,7 +32,7 @@
/* Charger */
#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGE_RAMP
+#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_CHARGER
#define CONFIG_CHARGER_V2
#define CONFIG_CHARGER_ISL9237
diff --git a/board/kevin/board.h b/board/kevin/board.h
index 1f49105386..2f09c682ee 100644
--- a/board/kevin/board.h
+++ b/board/kevin/board.h
@@ -117,7 +117,7 @@
/* USB PD config */
#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGE_RAMP
+#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_USB_POWER_DELIVERY
#define CONFIG_USB_PD_ALT_MODE
#define CONFIG_USB_PD_ALT_MODE_DFP
diff --git a/board/kevin/charge_ramp.c b/board/kevin/charge_ramp.c
index 566caa6e10..350c58924b 100644
--- a/board/kevin/charge_ramp.c
+++ b/board/kevin/charge_ramp.c
@@ -14,21 +14,6 @@
#include "system.h"
/**
- * Return true if ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_PROPRIETARY;
-}
-
-/**
* Return true if VBUS is sagging too low
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
@@ -37,14 +22,6 @@ int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
}
/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- return bd9995x_get_bc12_ilim(supplier);
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/oak/board.c b/board/oak/board.c
index c1e386a480..03a3222127 100644
--- a/board/oak/board.c
+++ b/board/oak/board.c
@@ -320,39 +320,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
pd_send_host_event(PD_EVENT_POWER_CHANGE);
}
-/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_PROPRIETARY;
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
/*
* timestamp of the next possible toggle to ensure the 2-ms spacing
* between IRQ_HPD.
diff --git a/board/poppy/board.c b/board/poppy/board.c
index 143b55176c..424e77b1b4 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -771,39 +771,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return (supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_OTHER);
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/reef/board.c b/board/reef/board.c
index 53918cd416..0e5496db52 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -655,29 +655,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return (supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_OTHER);
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- return bd9995x_get_bc12_ilim(supplier);
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/reef/board.h b/board/reef/board.h
index 7ceed4dbcb..3876c1ee45 100644
--- a/board/reef/board.h
+++ b/board/reef/board.h
@@ -46,7 +46,7 @@
/* Charger */
#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGE_RAMP
+#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_CHARGER
#define CONFIG_CHARGER_V2
#define CONFIG_CHARGER_BD9995X
diff --git a/board/reef_it8320/board.c b/board/reef_it8320/board.c
index a33431dcca..1c33c2ec65 100644
--- a/board/reef_it8320/board.c
+++ b/board/reef_it8320/board.c
@@ -440,29 +440,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return (supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_OTHER);
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- return bd9995x_get_bc12_ilim(supplier);
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/reef_it8320/board.h b/board/reef_it8320/board.h
index 952fcc63cf..69de844874 100644
--- a/board/reef_it8320/board.h
+++ b/board/reef_it8320/board.h
@@ -36,7 +36,7 @@
/* Charger */
#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGE_RAMP
+#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_CHARGER
#define CONFIG_CHARGER_V2
#define CONFIG_CHARGER_BD9995X
diff --git a/board/rowan/board.c b/board/rowan/board.c
index a27eaf858c..b3e09679bd 100644
--- a/board/rowan/board.c
+++ b/board/rowan/board.c
@@ -353,39 +353,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_PROPRIETARY;
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
-/**
* Set AP reset.
* AP_RESET_L (PC3, CPU_WARM_RESET_L) is connected to PMIC SYSRSTB
*/
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c
index bad38ed435..fc4c22d207 100644
--- a/board/samus_pd/board.c
+++ b/board/samus_pd/board.c
@@ -361,39 +361,6 @@ int pd_is_max_request_allowed(void)
}
/**
- * Return whether ramping is allowed for given supplier
- */
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
- else
- return supplier == CHARGE_SUPPLIER_BC12_DCP ||
- supplier == CHARGE_SUPPLIER_BC12_SDP ||
- supplier == CHARGE_SUPPLIER_BC12_CDP ||
- supplier == CHARGE_SUPPLIER_PROPRIETARY;
-}
-
-/**
- * Return the maximum allowed input current
- */
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- switch (supplier) {
- case CHARGE_SUPPLIER_BC12_DCP:
- return 2000;
- case CHARGE_SUPPLIER_BC12_SDP:
- return 1000;
- case CHARGE_SUPPLIER_BC12_CDP:
- case CHARGE_SUPPLIER_PROPRIETARY:
- return sup_curr;
- default:
- return 500;
- }
-}
-
-/**
* Return if board is consuming full amount of input current
*/
int board_is_consuming_full_charge(void)
diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h
index e85fb61a1b..4aaae34fcc 100644
--- a/board/samus_pd/board.h
+++ b/board/samus_pd/board.h
@@ -20,7 +20,7 @@
#undef CONFIG_ADC_WATCHDOG
#define CONFIG_BOARD_PRE_INIT
#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGE_RAMP
+#define CONFIG_CHARGE_RAMP_SW
#undef CONFIG_CMD_HASH
#undef CONFIG_CMD_HCDEBUG
#undef CONFIG_CMD_I2C_SCAN
diff --git a/board/zoombini/board.c b/board/zoombini/board.c
index f2671ff84b..4883a64d19 100644
--- a/board/zoombini/board.c
+++ b/board/zoombini/board.c
@@ -180,15 +180,6 @@ static void board_chipset_shutdown(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
-int board_get_ramp_current_limit(int supplier, int sup_curr)
-{
- /* Use the current limit that was decided by the BQ24392 driver. */
- if (supplier == CHARGE_SUPPLIER_OTHER)
- return sup_curr;
- else
- return 500;
-}
-
static void board_init(void)
{
/* Enable TCPC interrupts. */
@@ -198,20 +189,6 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-int board_is_ramp_allowed(int supplier)
-{
- /* Don't allow ramping in RO when write protected. */
- if (!system_is_in_rw() && system_is_locked())
- return 0;
-
- /*
- * Due to the limitations in the application of the BQ24392, we
- * don't quite know exactly what we're plugged into. Therefore,
- * the supplier type will be CHARGE_SUPPLIER_OTHER.
- */
- return supplier == CHARGE_SUPPLIER_OTHER;
-}
-
void board_reset_pd_mcu(void)
{
/* GPIO_USB_PD_RST_L resets all the TCPCs. */