summaryrefslogtreecommitdiff
path: root/include/pwm.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 /include/pwm.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 'include/pwm.h')
-rw-r--r--include/pwm.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/pwm.h b/include/pwm.h
index 15413c537c..8c0c248e75 100644
--- a/include/pwm.h
+++ b/include/pwm.h
@@ -45,28 +45,28 @@ int pwm_get_duty(enum pwm_channel ch);
/**
* PWM output signal is inverted, so 100% duty means always low
*/
-#define PWM_CONFIG_ACTIVE_LOW (1 << 0)
+#define PWM_CONFIG_ACTIVE_LOW BIT(0)
/**
* PWM channel has a fan controller with a tach input and can auto-adjust
* its duty cycle to produce a given fan RPM.
*/
-#define PWM_CONFIG_HAS_RPM_MODE (1 << 1)
+#define PWM_CONFIG_HAS_RPM_MODE BIT(1)
/**
* PWM clock select alternate source. The actual clock and alternate
* source are chip dependent.
*/
-#define PWM_CONFIG_ALT_CLOCK (1 << 2)
+#define PWM_CONFIG_ALT_CLOCK BIT(2)
/**
* PWM channel has a complementary output signal which should be enabled in
* addition to the primary output.
*/
-#define PWM_CONFIG_COMPLEMENTARY_OUTPUT (1 << 3)
+#define PWM_CONFIG_COMPLEMENTARY_OUTPUT BIT(3)
/**
* PWM channel must stay active in low-power idle, if enabled.
*/
-#define PWM_CONFIG_DSLEEP (1 << 4)
+#define PWM_CONFIG_DSLEEP BIT(4)
/**
* PWM channel's IO type is open-drain, if enabled. (default IO is push-pull.)
*/
-#define PWM_CONFIG_OPEN_DRAIN (1 << 5)
+#define PWM_CONFIG_OPEN_DRAIN BIT(5)
#endif /* __CROS_EC_PWM_H */