summaryrefslogtreecommitdiff
path: root/driver/charger/bq24715.c
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/charger/bq24715.c
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/charger/bq24715.c')
-rw-r--r--driver/charger/bq24715.c11
1 files changed, 11 insertions, 0 deletions
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,