From 43789c319ee80140fd1d07b85e1a619a8e01e466 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 20 Oct 2014 15:09:49 +0800 Subject: [PATCH] greybus: battery-gb: provide accessors for a few more functions Put the hard coded values in a function to make it easier to see what needs to be done here. Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/battery-gb.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/staging/greybus/battery-gb.c b/drivers/staging/greybus/battery-gb.c index eaced9ab39d8..685cff5ff9e8 100644 --- a/drivers/staging/greybus/battery-gb.c +++ b/drivers/staging/greybus/battery-gb.c @@ -27,12 +27,24 @@ static const struct greybus_module_id id_table[] = { { }, /* terminating NULL entry */ }; +static int get_tech(struct gb_battery *gb) +{ + // FIXME - guess! + return POWER_SUPPLY_TECHNOLOGY_NiMH; +} + static int get_status(struct gb_battery *gb) { // FIXME!!! return 0; } +static int get_max_voltage(struct gb_battery *gb) +{ + // FIXME!!! + return 4700000; +} + static int get_capacity(struct gb_battery *gb) { // FIXME!!! @@ -59,8 +71,7 @@ static int get_property(struct power_supply *b, switch (psp) { case POWER_SUPPLY_PROP_TECHNOLOGY: - // FIXME - guess! - val->intval = POWER_SUPPLY_TECHNOLOGY_NiMH; + val->intval = get_tech(gb); break; case POWER_SUPPLY_PROP_STATUS: @@ -68,7 +79,7 @@ static int get_property(struct power_supply *b, break; case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: - val->intval = 4700000; // FIXME - guess??? + val->intval = get_max_voltage(gb); break; case POWER_SUPPLY_PROP_CAPACITY: -- 2.45.2