summaryrefslogtreecommitdiff
path: root/driver/charger/bq24735.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/charger/bq24735.c')
-rw-r--r--driver/charger/bq24735.c11
1 files changed, 11 insertions, 0 deletions
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,