diff options
-rw-r--r-- | driver/charger/bq25703.c | 24 | ||||
-rw-r--r-- | driver/charger/bq25703.h | 14 |
2 files changed, 19 insertions, 19 deletions
diff --git a/driver/charger/bq25703.c b/driver/charger/bq25703.c index 9f378e21ab..4a80f21e40 100644 --- a/driver/charger/bq25703.c +++ b/driver/charger/bq25703.c @@ -99,7 +99,7 @@ int charger_get_status(int *status) /* Default status */ *status = CHARGER_LEVEL_2; - if (option & BQ25793_CHARGE_OPTION_0_CHRG_INHIBIT) + if (option & BQ25703_CHARGE_OPTION_0_CHRG_INHIBIT) *status |= CHARGER_CHARGE_INHIBITED; return EC_SUCCESS; @@ -115,9 +115,9 @@ int charger_set_mode(int mode) return rv; if (mode & CHARGER_CHARGE_INHIBITED) - option |= BQ25793_CHARGE_OPTION_0_CHRG_INHIBIT; + option |= BQ25703_CHARGE_OPTION_0_CHRG_INHIBIT; else - option &= ~BQ25793_CHARGE_OPTION_0_CHRG_INHIBIT; + option &= ~BQ25703_CHARGE_OPTION_0_CHRG_INHIBIT; return charger_set_option(option); } @@ -177,9 +177,9 @@ int charger_discharge_on_ac(int enable) return rv; if (enable) - option |= BQ25793_CHARGE_OPTION_0_EN_LEARN; + option |= BQ25703_CHARGE_OPTION_0_EN_LEARN; else - option &= ~BQ25793_CHARGE_OPTION_0_EN_LEARN; + option &= ~BQ25703_CHARGE_OPTION_0_EN_LEARN; return charger_set_option(option); } @@ -232,9 +232,9 @@ int charger_set_hw_ramp(int enable) return rv; if (enable) - reg |= BQ25793_CHARGE_OPTION_3_EN_ICO_MODE; + reg |= BQ25703_CHARGE_OPTION_3_EN_ICO_MODE; else - reg &= ~BQ25793_CHARGE_OPTION_3_EN_ICO_MODE; + reg &= ~BQ25703_CHARGE_OPTION_3_EN_ICO_MODE; return raw_write16(BQ25703_REG_CHARGE_OPTION_3, reg); } @@ -246,7 +246,7 @@ int chg_ramp_is_stable(void) if (raw_read16(BQ25703_REG_CHARGER_STATUS, ®)) return 0; - return reg & BQ25793_CHARGE_STATUS_ICO_DONE; + return reg & BQ25703_CHARGE_STATUS_ICO_DONE; } int chg_ramp_is_detected(void) @@ -260,7 +260,7 @@ int chg_ramp_get_current_limit(void) int tries_left = 8; /* Turn on the ADC for one reading */ - reg = BQ25793_ADC_OPTION_ADC_START | BQ25793_ADC_OPTION_EN_ADC_IIN; + reg = BQ25703_ADC_OPTION_ADC_START | BQ25703_ADC_OPTION_EN_ADC_IIN; if (raw_write16(BQ25703_REG_ADC_OPTION, reg)) goto error; @@ -268,10 +268,10 @@ int chg_ramp_get_current_limit(void) do { msleep(2); raw_read16(BQ25703_REG_ADC_OPTION, ®); - } while (--tries_left && (reg & BQ25793_ADC_OPTION_ADC_START)); + } while (--tries_left && (reg & BQ25703_ADC_OPTION_ADC_START)); /* Could not complete read */ - if (reg & BQ25793_ADC_OPTION_ADC_START) + if (reg & BQ25703_ADC_OPTION_ADC_START) goto error; /* Read ADC value */ @@ -279,7 +279,7 @@ int chg_ramp_get_current_limit(void) goto error; /* LSB => 50mA */ - return reg * BQ25793_ADC_IIN_STEP_MA; + return reg * BQ25703_ADC_IIN_STEP_MA; error: CPRINTF("Could not read input current limit ADC!"); diff --git a/driver/charger/bq25703.h b/driver/charger/bq25703.h index 5e87d9330b..ecb6131511 100644 --- a/driver/charger/bq25703.h +++ b/driver/charger/bq25703.h @@ -39,20 +39,20 @@ #define BQ25703_REG_DEVICE_ADDRESS 0x2F /* ChargeOption0 Register */ -#define BQ25793_CHARGE_OPTION_0_EN_LEARN (1 << 5) -#define BQ25793_CHARGE_OPTION_0_CHRG_INHIBIT (1 << 0) +#define BQ25703_CHARGE_OPTION_0_EN_LEARN (1 << 5) +#define BQ25703_CHARGE_OPTION_0_CHRG_INHIBIT (1 << 0) /* ChargeOption3 Register */ -#define BQ25793_CHARGE_OPTION_3_EN_ICO_MODE (1 << 11) +#define BQ25703_CHARGE_OPTION_3_EN_ICO_MODE (1 << 11) /* ChargeStatus Register */ -#define BQ25793_CHARGE_STATUS_ICO_DONE (1 << 14) +#define BQ25703_CHARGE_STATUS_ICO_DONE (1 << 14) /* ADCOption Register */ -#define BQ25793_ADC_OPTION_ADC_START (1 << 14) -#define BQ25793_ADC_OPTION_EN_ADC_IIN (1 << 4) +#define BQ25703_ADC_OPTION_ADC_START (1 << 14) +#define BQ25703_ADC_OPTION_EN_ADC_IIN (1 << 4) /* ADCIIN Register */ -#define BQ25793_ADC_IIN_STEP_MA 50 +#define BQ25703_ADC_IIN_STEP_MA 50 #endif /* __CROS_EC_BQ25703_H */ |