summaryrefslogtreecommitdiff
path: root/driver/bc12
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-03-11 15:57:52 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-03-26 04:42:55 -0700
commitbb266fc26fc05d4ab22de6ad7bce5b477c9f9140 (patch)
treef6ada087f62246c3a9547e649ac8846b0ed6d5ab /driver/bc12
parent0bfc511527cf2aebfa163c63a1d028419ca0b0c3 (diff)
downloadchrome-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/bc12')
-rw-r--r--driver/bc12/max14637.h4
-rw-r--r--driver/bc12/pi3usb9201.h12
2 files changed, 8 insertions, 8 deletions
diff --git a/driver/bc12/max14637.h b/driver/bc12/max14637.h
index 7013e46fb1..38e88b4ee2 100644
--- a/driver/bc12/max14637.h
+++ b/driver/bc12/max14637.h
@@ -7,8 +7,8 @@
#include "gpio.h"
-#define MAX14637_FLAGS_ENABLE_ACTIVE_LOW (1 << 0)
-#define MAX14637_FLAGS_CHG_DET_ACTIVE_LOW (1 << 1)
+#define MAX14637_FLAGS_ENABLE_ACTIVE_LOW BIT(0)
+#define MAX14637_FLAGS_CHG_DET_ACTIVE_LOW BIT(1)
struct max14637_config_t {
/*
diff --git a/driver/bc12/pi3usb9201.h b/driver/bc12/pi3usb9201.h
index 71b235c8d1..1e60e63c47 100644
--- a/driver/bc12/pi3usb9201.h
+++ b/driver/bc12/pi3usb9201.h
@@ -17,19 +17,19 @@
#define PI3USB9201_REG_HOST_STS 0x3
/* Control_1 regiter bit definitions */
-#define PI3USB9201_REG_CTRL_1_INT_MASK (1 << 0)
+#define PI3USB9201_REG_CTRL_1_INT_MASK BIT(0)
#define PI3USB9201_REG_CTRL_1_MODE_SHIFT 1
#define PI3USB9201_REG_CTRL_1_MODE_MASK (0x7 << \
PI3USB9201_REG_CTRL_1_MODE_SHIFT)
/* Control_2 regiter bit definitions */
-#define PI3USB9201_REG_CTRL_2_AUTO_SW (1 << 1)
-#define PI3USB9201_REG_CTRL_2_START_DET (1 << 3)
+#define PI3USB9201_REG_CTRL_2_AUTO_SW BIT(1)
+#define PI3USB9201_REG_CTRL_2_START_DET BIT(3)
/* Host status register bit definitions */
-#define PI3USB9201_REG_HOST_STS_BC12_DET (1 << 0)
-#define PI3USB9201_REG_HOST_STS_DEV_PLUG (1 << 1)
-#define PI3USB9201_REG_HOST_STS_DEV_UNPLUG (1 << 2)
+#define PI3USB9201_REG_HOST_STS_BC12_DET BIT(0)
+#define PI3USB9201_REG_HOST_STS_DEV_PLUG BIT(1)
+#define PI3USB9201_REG_HOST_STS_DEV_UNPLUG BIT(2)
struct pi3usb2901_config_t {
const int i2c_port;