Commit 6e720c27 authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by Greg Kroah-Hartman

greybus: power_supply: change property values to integer

To align with power supply core values type (integer) move the val and
previous_val to integer also.
Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: default avatarSandeep Patil <sspatil@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent fc0c38b3
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
struct gb_power_supply_prop { struct gb_power_supply_prop {
enum power_supply_property prop; enum power_supply_property prop;
u32 val; int val;
u32 previous_val; int previous_val;
bool is_writeable; bool is_writeable;
}; };
...@@ -142,8 +142,8 @@ static void check_changed(struct gb_power_supply *gbpsy, ...@@ -142,8 +142,8 @@ static void check_changed(struct gb_power_supply *gbpsy,
struct gb_power_supply_prop *prop) struct gb_power_supply_prop *prop)
{ {
const struct gb_power_supply_changes *psyc; const struct gb_power_supply_changes *psyc;
u32 val = prop->val; int val = prop->val;
u32 prev_val = prop->previous_val; int prev_val = prop->previous_val;
int i; int i;
for (i = 0; i < ARRAY_SIZE(psy_props_changes); i++) { for (i = 0; i < ARRAY_SIZE(psy_props_changes); i++) {
...@@ -317,7 +317,7 @@ static int __gb_power_supply_property_update(struct gb_power_supply *gbpsy, ...@@ -317,7 +317,7 @@ static int __gb_power_supply_property_update(struct gb_power_supply *gbpsy,
struct gb_power_supply_prop *prop; struct gb_power_supply_prop *prop;
struct gb_power_supply_get_property_request req; struct gb_power_supply_get_property_request req;
struct gb_power_supply_get_property_response resp; struct gb_power_supply_get_property_response resp;
u32 val; int val;
int ret; int ret;
prop = get_psy_prop(gbpsy, psp); prop = get_psy_prop(gbpsy, psp);
...@@ -481,6 +481,7 @@ static int gb_power_supply_property_set(struct gb_power_supply *gbpsy, ...@@ -481,6 +481,7 @@ static int gb_power_supply_property_set(struct gb_power_supply *gbpsy,
req.psy_id = gbpsy->id; req.psy_id = gbpsy->id;
req.property = (u8)psp; req.property = (u8)psp;
req.prop_val = cpu_to_le32(val); req.prop_val = cpu_to_le32(val);
req.prop_val = cpu_to_le32((s32)val);
ret = gb_operation_sync(connection, GB_POWER_SUPPLY_TYPE_SET_PROPERTY, ret = gb_operation_sync(connection, GB_POWER_SUPPLY_TYPE_SET_PROPERTY,
&req, sizeof(req), NULL, 0); &req, sizeof(req), 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