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/bq24707a.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/bq24707a.h')
-rw-r--r-- | driver/charger/bq24707a.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/driver/charger/bq24707a.h b/driver/charger/bq24707a.h index 14e89ed136..ac3293e04d 100644 --- a/driver/charger/bq24707a.h +++ b/driver/charger/bq24707a.h @@ -15,28 +15,28 @@ #define BQ24707_DEVICE_ID 0xff /* ChargeOption 0x12 */ -#define OPTION_CHARGE_INHIBIT (1 << 0) +#define OPTION_CHARGE_INHIBIT BIT(0) #define OPTION_ACOC_THRESHOLD (3 << 1) -#define OPTION_COMPARATOR_THRESHOLD (1 << 4) -#define OPTION_IOUT_SELECTION (1 << 5) +#define OPTION_COMPARATOR_THRESHOLD BIT(4) +#define OPTION_IOUT_SELECTION BIT(5) #define OPTION_IFAULT_HI_THRESHOLD (3 << 7) -#define OPTION_EMI_FREQ_ENABLE (1 << 9) -#define OPTION_EMI_FREQ_ADJ (1 << 10) +#define OPTION_EMI_FREQ_ENABLE BIT(9) +#define OPTION_EMI_FREQ_ADJ BIT(10) #define OPTION_WATCHDOG_TIMER (3 << 13) -#define OPTION_AOC_DELITCH_TIME (1 << 15) +#define OPTION_AOC_DELITCH_TIME BIT(15) /* OPTION_ACOC_THRESHOLD */ #define ACOC_THRESHOLD_DISABLE (0 << 1) -#define ACOC_THRESHOLD_133X (1 << 1) +#define ACOC_THRESHOLD_133X BIT(1) #define ACOC_THRESHOLD_166X_DEFAULT (2 << 1) #define ACOC_THRESHOLD_222X (3 << 1) /* OPTION_IFAULT_HI_THRESHOLD */ #define IFAULT_THRESHOLD_300MV (0 << 7) -#define IFAULT_THRESHOLD_500MV (1 << 7) +#define IFAULT_THRESHOLD_500MV BIT(7) #define IFAULT_THRESHOLD_700MV_DEFAULT (2 << 7) #define IFAULT_THRESHOLD_900MV (3 << 7) /* OPTION_WATCHDOG_TIMER */ #define CHARGE_WATCHDOG_DISABLE (0 << 13) -#define CHARGE_WATCHDOG_44SEC (1 << 13) +#define CHARGE_WATCHDOG_44SEC BIT(13) #define CHARGE_WATCHDOG_88SEC (2 << 13) #define CHARGE_WATCHDOG_175SEC_DEFAULT (3 << 13) |