Commit 583d233f authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

greybus: use little-endian in PWM requests

The PWM config request defines two 32-bit values using u32. All
over-the-wire values have to be in little-endian format.  Fix this.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Acked-by: default avatarMatt Porter <mporter@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 82e26f73
...@@ -62,8 +62,8 @@ struct gb_pwm_deactivate_request { ...@@ -62,8 +62,8 @@ struct gb_pwm_deactivate_request {
struct gb_pwm_config_request { struct gb_pwm_config_request {
__u8 which; __u8 which;
__u32 duty; __le32 duty;
__u32 period; __le32 period;
}; };
struct gb_pwm_polarity_request { struct gb_pwm_polarity_request {
...@@ -152,8 +152,8 @@ static int gb_pwm_config_operation(struct gb_pwm_chip *pwmc, ...@@ -152,8 +152,8 @@ static int gb_pwm_config_operation(struct gb_pwm_chip *pwmc,
return -EINVAL; return -EINVAL;
request.which = which; request.which = which;
request.duty = duty; request.duty = cpu_to_le32(duty);
request.period = period; request.period = cpu_to_le32(period);
return gb_operation_sync(pwmc->connection, GB_PWM_TYPE_CONFIG, return gb_operation_sync(pwmc->connection, GB_PWM_TYPE_CONFIG,
&request, sizeof(request), NULL, 0); &request, sizeof(request), NULL, 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment