summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/pwm_hc.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 15:38:45 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-28 21:04:34 +0000
commita2bc3f0f3f778b568599bff0e0ba2183aec143fe (patch)
tree289b9b9c97e3c36e642d0f3be1b7f4f901e80e8e /zephyr/shim/src/pwm_hc.c
parent609a0ddc8ca50efd82359475212a3c2c081c3ae8 (diff)
downloadchrome-ec-a2bc3f0f3f778b568599bff0e0ba2183aec143fe.tar.gz
zephyr/shim/src/pwm_hc.c: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I556fa6be82d650b90f72a137014c3da016235982 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730898 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/shim/src/pwm_hc.c')
-rw-r--r--zephyr/shim/src/pwm_hc.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/zephyr/shim/src/pwm_hc.c b/zephyr/shim/src/pwm_hc.c
index 00c8ddf69b..15e924f0d0 100644
--- a/zephyr/shim/src/pwm_hc.c
+++ b/zephyr/shim/src/pwm_hc.c
@@ -19,17 +19,15 @@
LOG_MODULE_REGISTER(pwm_shim, LOG_LEVEL_ERR);
-#define PWM_RAW_TO_PERCENT(v) \
- DIV_ROUND_NEAREST((uint32_t)(v) * 100, UINT16_MAX)
-#define PWM_PERCENT_TO_RAW(v) ((uint32_t)(v) * UINT16_MAX / 100)
+#define PWM_RAW_TO_PERCENT(v) DIV_ROUND_NEAREST((uint32_t)(v)*100, UINT16_MAX)
+#define PWM_PERCENT_TO_RAW(v) ((uint32_t)(v)*UINT16_MAX / 100)
-#define HAS_PWM_GENERIC_CHANNEL(compat) \
+#define HAS_PWM_GENERIC_CHANNEL(compat) \
DT_NODE_HAS_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(compat), \
generic_pwm_channel)
#define PWM_GENERIC_CHANNEL_ID(compat) \
- DT_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(compat), \
- generic_pwm_channel)
+ DT_PROP(DT_COMPAT_GET_ANY_STATUS_OKAY(compat), generic_pwm_channel)
#ifdef CONFIG_PWM_KBLIGHT
static bool pwm_is_kblight(int type, int index)
@@ -63,9 +61,8 @@ static bool pwm_is_displight(int type, int index)
}
#endif /* CONFIG_PLATFORM_EC_PWM_DISPLIGHT */
-
-static enum ec_status host_command_pwm_set_duty(
- struct host_cmd_handler_args *args)
+static enum ec_status
+host_command_pwm_set_duty(struct host_cmd_handler_args *args)
{
__maybe_unused const struct ec_params_pwm_set_duty *p = args->params;
@@ -85,12 +82,11 @@ static enum ec_status host_command_pwm_set_duty(
return EC_RES_INVALID_PARAM;
}
-DECLARE_HOST_COMMAND(EC_CMD_PWM_SET_DUTY,
- host_command_pwm_set_duty,
+DECLARE_HOST_COMMAND(EC_CMD_PWM_SET_DUTY, host_command_pwm_set_duty,
EC_VER_MASK(0));
-static enum ec_status host_command_pwm_get_duty(
- struct host_cmd_handler_args *args)
+static enum ec_status
+host_command_pwm_get_duty(struct host_cmd_handler_args *args)
{
__maybe_unused const struct ec_params_pwm_get_duty *p = args->params;
__maybe_unused struct ec_response_pwm_get_duty *r = args->response;
@@ -112,6 +108,5 @@ static enum ec_status host_command_pwm_get_duty(
return EC_RES_INVALID_PARAM;
}
-DECLARE_HOST_COMMAND(EC_CMD_PWM_GET_DUTY,
- host_command_pwm_get_duty,
+DECLARE_HOST_COMMAND(EC_CMD_PWM_GET_DUTY, host_command_pwm_get_duty,
EC_VER_MASK(0));