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>
This commit is contained in:
Vijay Hiremath
2016-10-10 12:49:27 -07:00
committed by chrome-bot
parent 7bfcb41d2c
commit bc34c98edd
5 changed files with 33 additions and 16 deletions

View File

@@ -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

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -137,12 +137,6 @@
#define BATTERY_DISCHARGING_DISABLED 0x20
#define BATTERY_CHARGING_DISABLED 0x40
/* Read from charger */
int sbc_read(int cmd, int *param);
/* Write to charger */
int sbc_write(int cmd, int param);
/* Read from battery */
int sb_read(int cmd, int *param);