summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-11-01 09:59:08 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-11-01 16:47:21 -0700
commit7bf1696711c37d829b4663fa4dfce5e35b4d237e (patch)
treeead615c45021e6f986c7d4bcb744e3c4c53beaf4 /board
parent030e44309461552a18427ef1924e193bfc660106 (diff)
downloadchrome-ec-7bf1696711c37d829b4663fa4dfce5e35b4d237e.tar.gz
chg_ramp: Add charge_is_consuming_full_input_current().
Most boards had an identical implementation for this function, previously known as board_is_consuming_full_charge(). To reduce copy paste, let's just move it to common code. Boards that charge ramp without a battery will have to define their own implementation, but there probably won't be any boards like that in the near future. BUG=None BRANCH=None TEST=make -j buildall Change-Id: Ic99a378ac26dfd35d7d718bf9376eacfa8609166 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/748919 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/coral/board.c10
-rw-r--r--board/eve/board.c10
-rw-r--r--board/grunt/board.c10
-rw-r--r--board/kahlee/board.c10
-rw-r--r--board/kevin/charge_ramp.c10
-rw-r--r--board/nautilus/board.c11
-rw-r--r--board/poppy/board.c11
-rw-r--r--board/reef/board.c10
-rw-r--r--board/reef_it8320/board.c10
-rw-r--r--board/samus_pd/board.c2
10 files changed, 1 insertions, 93 deletions
diff --git a/board/coral/board.c b/board/coral/board.c
index 9fe3aaae78..650b89d317 100644
--- a/board/coral/board.c
+++ b/board/coral/board.c
@@ -663,16 +663,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-/**
* Return if VBUS is sagging too low
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
diff --git a/board/eve/board.c b/board/eve/board.c
index e0f168fca4..ca5b43d63c 100644
--- a/board/eve/board.c
+++ b/board/eve/board.c
@@ -542,16 +542,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-/**
* Return if VBUS is sagging too low
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
diff --git a/board/grunt/board.c b/board/grunt/board.c
index d08843dfb6..cd2ebcd215 100644
--- a/board/grunt/board.c
+++ b/board/grunt/board.c
@@ -417,16 +417,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-/**
* Return if VBUS is sagging too low
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
diff --git a/board/kahlee/board.c b/board/kahlee/board.c
index dd57f8edcd..3826d4a181 100644
--- a/board/kahlee/board.c
+++ b/board/kahlee/board.c
@@ -417,16 +417,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-/**
* Return if VBUS is sagging too low
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
diff --git a/board/kevin/charge_ramp.c b/board/kevin/charge_ramp.c
index 350c58924b..134f2e62de 100644
--- a/board/kevin/charge_ramp.c
+++ b/board/kevin/charge_ramp.c
@@ -20,13 +20,3 @@ int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
{
return charger_get_vbus_voltage(port) < BD9995X_BC12_MIN_VOLTAGE;
}
-
-/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_pct = charge_get_percent();
-
- return chg_pct > 2 && chg_pct < 95;
-}
diff --git a/board/nautilus/board.c b/board/nautilus/board.c
index 84f5684739..a8e1a7d630 100644
--- a/board/nautilus/board.c
+++ b/board/nautilus/board.c
@@ -795,17 +795,6 @@ int board_get_ramp_current_limit(int supplier, int sup_curr)
}
}
-/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-
void board_hibernate(void)
{
CPRINTS("Triggering PMIC shutdown.");
diff --git a/board/poppy/board.c b/board/poppy/board.c
index d13361c108..b80be0b7dd 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -802,17 +802,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
}
-/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-
void board_hibernate(void)
{
CPRINTS("Triggering PMIC shutdown.");
diff --git a/board/reef/board.c b/board/reef/board.c
index f4696b8ce2..cff56b7657 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -655,16 +655,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-/**
* Return if VBUS is sagging too low
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
diff --git a/board/reef_it8320/board.c b/board/reef_it8320/board.c
index 1c33c2ec65..a7f275a9f4 100644
--- a/board/reef_it8320/board.c
+++ b/board/reef_it8320/board.c
@@ -440,16 +440,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
}
/**
- * Return if board is consuming full amount of input current
- */
-int board_is_consuming_full_charge(void)
-{
- int chg_perc = charge_get_percent();
-
- return chg_perc > 2 && chg_perc < 95;
-}
-
-/**
* Return if VBUS is sagging too low
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c
index fc4c22d207..4a617ede97 100644
--- a/board/samus_pd/board.c
+++ b/board/samus_pd/board.c
@@ -363,7 +363,7 @@ int pd_is_max_request_allowed(void)
/**
* Return if board is consuming full amount of input current
*/
-int board_is_consuming_full_charge(void)
+int charge_is_consuming_full_input_current(void)
{
return batt_soc >= 1 && batt_soc < HIGH_BATT_THRESHOLD;
}