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/temp_sensor/adt7481.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/temp_sensor/adt7481.h')
-rw-r--r-- | driver/temp_sensor/adt7481.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/driver/temp_sensor/adt7481.h b/driver/temp_sensor/adt7481.h index 11e9856b9c..45da88560e 100644 --- a/driver/temp_sensor/adt7481.h +++ b/driver/temp_sensor/adt7481.h @@ -55,18 +55,18 @@ #define ADT7481_MANUFACTURER_ID 0x3e /* Config1 register bits */ -#define ADT7481_CONFIG1_REMOTE1_ALERT_MASK (1 << 0) -#define ADT7481_CONFIG1_REMOTE2_ALERT_MASK (1 << 1) -#define ADT7481_CONFIG1_TEMP_RANGE (1 << 2) -#define ADT7481_CONFIG1_SEL_REMOTE2 (1 << 3) +#define ADT7481_CONFIG1_REMOTE1_ALERT_MASK BIT(0) +#define ADT7481_CONFIG1_REMOTE2_ALERT_MASK BIT(1) +#define ADT7481_CONFIG1_TEMP_RANGE BIT(2) +#define ADT7481_CONFIG1_SEL_REMOTE2 BIT(3) /* ADT7481_CONFIG1_MODE bit is use to enable THERM mode */ -#define ADT7481_CONFIG1_MODE (1 << 5) -#define ADT7481_CONFIG1_RUN_L (1 << 6) +#define ADT7481_CONFIG1_MODE BIT(5) +#define ADT7481_CONFIG1_RUN_L BIT(6) /* mask all alerts on ALERT# pin */ -#define ADT7481_CONFIG1_ALERT_MASK_L (1 << 7) +#define ADT7481_CONFIG1_ALERT_MASK_L BIT(7) /* Config2 register bits */ -#define ADT7481_CONFIG2_LOCK (1 << 7) +#define ADT7481_CONFIG2_LOCK BIT(7) /* Conversion Rate/Channel Select Register */ #define ADT7481_CONV_RATE_MASK (0x0f) @@ -85,28 +85,28 @@ #define ADT7481_CONV_RATE_73MS_AVE (0x0b) #define ADT7481_CONV_CHAN_SELECT_MASK (0x30) #define ADT7481_CONV_CHAN_SEL_ROUND_ROBIN (0 << 4) -#define ADT7481_CONV_CHAN_SEL_LOCAL (1 << 4) +#define ADT7481_CONV_CHAN_SEL_LOCAL BIT(4) #define ADT7481_CONV_CHAN_SEL_REMOTE1 (2 << 4) #define ADT7481_CONV_CHAN_SEL_REMOTE2 (3 << 4) -#define ADT7481_CONV_AVERAGING_L (1 << 7) +#define ADT7481_CONV_AVERAGING_L BIT(7) /* Status1 register bits */ -#define ADT7481_STATUS1_LOCAL_THERM_ALARM (1 << 0) -#define ADT7481_STATUS1_REMOTE1_THERM_ALARM (1 << 1) -#define ADT7481_STATUS1_REMOTE1_OPEN (1 << 2) -#define ADT7481_STATUS1_REMOTE1_LOW_ALARM (1 << 3) -#define ADT7481_STATUS1_REMOTE1_HIGH_ALARM (1 << 4) -#define ADT7481_STATUS1_LOCAL_LOW_ALARM (1 << 5) -#define ADT7481_STATUS1_LOCAL_HIGH_ALARM (1 << 6) -#define ADT7481_STATUS1_BUSY (1 << 7) +#define ADT7481_STATUS1_LOCAL_THERM_ALARM BIT(0) +#define ADT7481_STATUS1_REMOTE1_THERM_ALARM BIT(1) +#define ADT7481_STATUS1_REMOTE1_OPEN BIT(2) +#define ADT7481_STATUS1_REMOTE1_LOW_ALARM BIT(3) +#define ADT7481_STATUS1_REMOTE1_HIGH_ALARM BIT(4) +#define ADT7481_STATUS1_LOCAL_LOW_ALARM BIT(5) +#define ADT7481_STATUS1_LOCAL_HIGH_ALARM BIT(6) +#define ADT7481_STATUS1_BUSY BIT(7) /* Status2 register bits */ -#define ADT7481_STATUS2_ALERT (1 << 0) -#define ADT7481_STATUS2_REMOTE2_THERM_ALARM (1 << 1) -#define ADT7481_STATUS2_REMOTE2_OPEN (1 << 2) -#define ADT7481_STATUS2_REMOTE2_LOW_ALARM (1 << 3) -#define ADT7481_STATUS2_REMOTE2_HIGH_ALARM (1 << 4) +#define ADT7481_STATUS2_ALERT BIT(0) +#define ADT7481_STATUS2_REMOTE2_THERM_ALARM BIT(1) +#define ADT7481_STATUS2_REMOTE2_OPEN BIT(2) +#define ADT7481_STATUS2_REMOTE2_LOW_ALARM BIT(3) +#define ADT7481_STATUS2_REMOTE2_HIGH_ALARM BIT(4) /* Consecutive Alert register */ #define ADT7481_CONSEC_MASK (0xf) @@ -114,9 +114,9 @@ #define ADT7481_CONSEC_2 (0x2) #define ADT7481_CONSEC_3 (0x6) #define ADT7481_CONSEC_4 (0xe) -#define ADT7481_CONSEC_EN_SCL_TIMEOUT (1 << 5) -#define ADT7481_CONSEC_EN_SDA_TIMEOUT (1 << 6) -#define ADT7481_CONSEC_MASK_LOCAL_ALERT (1 << 7) +#define ADT7481_CONSEC_EN_SCL_TIMEOUT BIT(5) +#define ADT7481_CONSEC_EN_SDA_TIMEOUT BIT(6) +#define ADT7481_CONSEC_MASK_LOCAL_ALERT BIT(7) /* Limits */ |