summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2016-10-10 12:49:27 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-11 01:47:52 -0700
commitbc34c98edd0e303617ce0dae7b283b18d290b0e7 (patch)
tree1e976119b4b276212df23d0a3cdd6ba0ed1e364a /driver
parent7bfcb41d2cad36c220eee89576e41dacea870adb (diff)
downloadchrome-ec-bc34c98edd0e303617ce0dae7b283b18d290b0e7.tar.gz
smart_battery: Remove smart charger unreachable code
Smart battery code has I2C read/write code for smart chargers which is an unreachable code for few boards hence removed it. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I79933f61893c66447c686a81073c92f6a16e2d48 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/396279 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/battery/smart.c10
-rw-r--r--driver/charger/bq24707a.c11
-rw-r--r--driver/charger/bq24715.c11
-rw-r--r--driver/charger/bq24735.c11
4 files changed, 33 insertions, 10 deletions
diff --git a/driver/battery/smart.c b/driver/battery/smart.c
index 9e7e9f3ec6..15dd72ff29 100644
--- a/driver/battery/smart.c
+++ b/driver/battery/smart.c
@@ -22,16 +22,6 @@
static int fake_state_of_charge = -1;
-test_mockable int sbc_read(int cmd, int *param)
-{
- return i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
-}
-
-test_mockable int sbc_write(int cmd, int param)
-{
- return i2c_write16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
-}
-
test_mockable int sb_read(int cmd, int *param)
{
#ifdef CONFIG_BATTERY_CUT_OFF
diff --git a/driver/charger/bq24707a.c b/driver/charger/bq24707a.c
index 67467610df..ce49478d67 100644
--- a/driver/charger/bq24707a.c
+++ b/driver/charger/bq24707a.c
@@ -10,6 +10,7 @@
#include "charger.h"
#include "console.h"
#include "common.h"
+#include "i2c.h"
#include "util.h"
/* Sense resistor configurations and macros */
@@ -39,6 +40,16 @@ static const struct charger_info bq24707a_charger_info = {
/* bq24707a specific interfaces */
+static inline int sbc_read(int cmd, int *param)
+{
+ return i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
+}
+
+static inline int sbc_write(int cmd, int param)
+{
+ return i2c_write16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
+}
+
int charger_set_input_current(int input_current)
{
return sbc_write(BQ24707_INPUT_CURRENT,
diff --git a/driver/charger/bq24715.c b/driver/charger/bq24715.c
index 4386c3a17d..507c44e7da 100644
--- a/driver/charger/bq24715.c
+++ b/driver/charger/bq24715.c
@@ -10,6 +10,7 @@
#include "charger.h"
#include "console.h"
#include "common.h"
+#include "i2c.h"
#include "util.h"
/* Sense resistor configurations and macros */
@@ -34,6 +35,16 @@ static const struct charger_info bq24725_charger_info = {
.input_current_step = REG_TO_CURRENT(INPUT_I_STEP, R_AC),
};
+static inline int sbc_read(int cmd, int *param)
+{
+ return i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
+}
+
+static inline int sbc_write(int cmd, int param)
+{
+ return i2c_write16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
+}
+
int charger_set_input_current(int input_current)
{
return sbc_write(BQ24715_INPUT_CURRENT,
diff --git a/driver/charger/bq24735.c b/driver/charger/bq24735.c
index 3c40d674f2..24a71c1deb 100644
--- a/driver/charger/bq24735.c
+++ b/driver/charger/bq24735.c
@@ -10,6 +10,7 @@
#include "charger.h"
#include "console.h"
#include "common.h"
+#include "i2c.h"
#include "util.h"
/* Sense resistor configurations and macros */
@@ -39,6 +40,16 @@ static const struct charger_info bq24735_charger_info = {
/* bq24735 specific interfaces */
+static inline int sbc_read(int cmd, int *param)
+{
+ return i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
+}
+
+static inline int sbc_write(int cmd, int param)
+{
+ return i2c_write16(I2C_PORT_CHARGER, CHARGER_ADDR, cmd, param);
+}
+
int charger_set_input_current(int input_current)
{
return sbc_write(BQ24735_INPUT_CURRENT,