summaryrefslogtreecommitdiff
path: root/driver/ppc/sn5s330.h
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/ppc/sn5s330.h
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/ppc/sn5s330.h')
-rw-r--r--driver/ppc/sn5s330.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/driver/ppc/sn5s330.h b/driver/ppc/sn5s330.h
index c5b16ea73b..6c79aa46ed 100644
--- a/driver/ppc/sn5s330.h
+++ b/driver/ppc/sn5s330.h
@@ -86,44 +86,44 @@ enum sn5s330_pp_idx {
#define SN5S330_ILIM_3_30 12
/* FUNC_SET_2 */
-#define SN5S330_SBU_EN (1 << 4)
+#define SN5S330_SBU_EN BIT(4)
/* FUNC_SET_3 */
-#define SN5S330_PP1_EN (1 << 0)
-#define SN5S330_PP2_EN (1 << 1)
-#define SN5S330_VBUS_DISCH_EN (1 << 2)
-#define SN5S330_SET_RCP_MODE_PP1 (1 << 5)
-#define SN5S330_SET_RCP_MODE_PP2 (1 << 6)
+#define SN5S330_PP1_EN BIT(0)
+#define SN5S330_PP2_EN BIT(1)
+#define SN5S330_VBUS_DISCH_EN BIT(2)
+#define SN5S330_SET_RCP_MODE_PP1 BIT(5)
+#define SN5S330_SET_RCP_MODE_PP2 BIT(6)
/* FUNC_SET_4 */
-#define SN5S330_VCONN_EN (1 << 0)
-#define SN5S330_CC_POLARITY (1 << 1)
-#define SN5S330_CC_EN (1 << 4)
-#define SN5S330_VCONN_ILIM_SEL (1 << 5)
+#define SN5S330_VCONN_EN BIT(0)
+#define SN5S330_CC_POLARITY BIT(1)
+#define SN5S330_CC_EN BIT(4)
+#define SN5S330_VCONN_ILIM_SEL BIT(5)
/* FUNC_SET_8 */
#define SN5S330_VCONN_DEGLITCH_MASK (3 << 6)
#define SN5S330_VCONN_DEGLITCH_63_US (0 << 6)
-#define SN5S330_VCONN_DEGLITCH_125_US (1 << 6)
+#define SN5S330_VCONN_DEGLITCH_125_US BIT(6)
#define SN5S330_VCONN_DEGLITCH_640_US (2 << 6)
#define SN5S330_VCONN_DEGLITCH_1280_US (3 << 6)
/* FUNC_SET_9 */
-#define SN5S330_FORCE_OVP_EN_SBU (1 << 1)
-#define SN5S330_PP2_CONFIG (1 << 2)
-#define SN5S330_OVP_EN_CC (1 << 4)
-#define SN5S330_CONFIG_UVP (1 << 5)
-#define SN5S330_FORCE_ON_VBUS_OVP (1 << 6)
-#define SN5S330_FORCE_ON_VBUS_UVP (1 << 7)
+#define SN5S330_FORCE_OVP_EN_SBU BIT(1)
+#define SN5S330_PP2_CONFIG BIT(2)
+#define SN5S330_OVP_EN_CC BIT(4)
+#define SN5S330_CONFIG_UVP BIT(5)
+#define SN5S330_FORCE_ON_VBUS_OVP BIT(6)
+#define SN5S330_FORCE_ON_VBUS_UVP BIT(7)
/* INT_STATUS_REG3 */
-#define SN5S330_VBUS_GOOD (1 << 0)
+#define SN5S330_VBUS_GOOD BIT(0)
/* INT_STATUS_REG4 */
-#define SN5S330_DIG_RES (1 << 0)
-#define SN5S330_DB_BOOT (1 << 1)
-#define SN5S330_VSAFE0V_STAT (1 << 2)
-#define SN5S330_VSAFE0V_MASK (1 << 3)
+#define SN5S330_DIG_RES BIT(0)
+#define SN5S330_DB_BOOT BIT(1)
+#define SN5S330_VSAFE0V_STAT BIT(2)
+#define SN5S330_VSAFE0V_MASK BIT(3)
/*
* INT_MASK_RISE/FALL_EDGE_1
@@ -133,7 +133,7 @@ enum sn5s330_pp_idx {
* occured; similarly for falling edge, it means the overcurrent condition is no
* longer present.
*/
-#define SN5S330_ILIM_PP1_MASK (1 << 4)
+#define SN5S330_ILIM_PP1_MASK BIT(4)
/*
* INT_MASK_RISE/FALL_EDGE2
@@ -150,7 +150,7 @@ enum sn5s330_pp_idx {
* For rising edge registers, this indicates VBUS has risen above 4.0V.
* For falling edge registers, this indicates VBUS has fallen below 4.0V.
*/
-#define SN5S330_VBUS_GOOD_MASK (1 << 0)
+#define SN5S330_VBUS_GOOD_MASK BIT(0)
extern const struct ppc_drv sn5s330_drv;