diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2019-03-11 15:57:52 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-26 04:42:55 -0700 |
commit | bb266fc26fc05d4ab22de6ad7bce5b477c9f9140 (patch) | |
tree | f6ada087f62246c3a9547e649ac8846b0ed6d5ab /driver/charger/bq25703.h | |
parent | 0bfc511527cf2aebfa163c63a1d028419ca0b0c3 (diff) | |
download | chrome-ec-bb266fc26fc05d4ab22de6ad7bce5b477c9f9140.tar.gz |
common: replace 1 << digits, with BIT(digits)
Requested for linux integration, use BIT instead of 1 <<
First step replace bit operation with operand containing only digits.
Fix an error in motion_lid try to set bit 31 of a signed integer.
BUG=None
BRANCH=None
TEST=compile
Change-Id: Ie843611f2f68e241f0f40d4067f7ade726951d29
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1518659
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'driver/charger/bq25703.h')
-rw-r--r-- | driver/charger/bq25703.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/driver/charger/bq25703.h b/driver/charger/bq25703.h index db2c246658..54d64a81c7 100644 --- a/driver/charger/bq25703.h +++ b/driver/charger/bq25703.h @@ -24,9 +24,9 @@ /* ChargeOption0 Register */ #define BQ25703_REG_CHARGE_OPTION_0 0x00 -#define BQ25703_CHARGE_OPTION_0_LOW_POWER_MODE (1 << 15) -#define BQ25703_CHARGE_OPTION_0_EN_LEARN (1 << 5) -#define BQ25703_CHARGE_OPTION_0_CHRG_INHIBIT (1 << 0) +#define BQ25703_CHARGE_OPTION_0_LOW_POWER_MODE BIT(15) +#define BQ25703_CHARGE_OPTION_0_EN_LEARN BIT(5) +#define BQ25703_CHARGE_OPTION_0_CHRG_INHIBIT BIT(0) #define BQ25703_REG_CHARGE_CURRENT 0x02 #define BQ25703_REG_MAX_CHARGE_VOLTAGE 0x04 @@ -34,23 +34,23 @@ /* ChargeOption2 Register */ #define BQ25703_REG_CHARGE_OPTION_2 0x32 -#define BQ25703_CHARGE_OPTION_2_EN_EXTILIM (1 << 7) +#define BQ25703_CHARGE_OPTION_2_EN_EXTILIM BIT(7) /* ChargeOption3 Register */ #define BQ25703_REG_CHARGE_OPTION_3 0x34 -#define BQ25703_CHARGE_OPTION_3_EN_ICO_MODE (1 << 11) +#define BQ25703_CHARGE_OPTION_3_EN_ICO_MODE BIT(11) #define BQ25703_REG_PROCHOT_OPTION_0 0x36 #define BQ25703_REG_PROCHOT_OPTION_1 0x38 /* ADCOption Register */ #define BQ25703_REG_ADC_OPTION 0x3A -#define BQ25703_ADC_OPTION_ADC_START (1 << 14) -#define BQ25703_ADC_OPTION_EN_ADC_IIN (1 << 4) +#define BQ25703_ADC_OPTION_ADC_START BIT(14) +#define BQ25703_ADC_OPTION_EN_ADC_IIN BIT(4) /* ChargeStatus Register */ #define BQ25703_REG_CHARGER_STATUS 0x20 -#define BQ25703_CHARGE_STATUS_ICO_DONE (1 << 14) +#define BQ25703_CHARGE_STATUS_ICO_DONE BIT(14) #define BQ25703_REG_PROCHOT_STATUS 0x22 #define BQ25703_REG_IIN_DPM 0x25 |