summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-05-15 17:36:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-17 19:35:00 -0700
commit0579bf584ccd0e9aeea51c3435b2bca114dacdb2 (patch)
treeaa83a4d4b892bd64c152aada6768f74f89e719fe
parentda9d652117a541843824dce6708b589bb3f45808 (diff)
downloadchrome-ec-0579bf584ccd0e9aeea51c3435b2bca114dacdb2.tar.gz
bq25703: correct define names
The register values used BQ25793 as the prefix and they should use BQ25703 instead BRANCH=none BUG=none TEST=none Change-Id: I1955ff075c4e95ed901a5f265340ee01d60e1739 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1060590 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
-rw-r--r--driver/charger/bq25703.c24
-rw-r--r--driver/charger/bq25703.h14
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, &reg))
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, &reg);
- } 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 */