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 <greg@kroah.com>
This commit is contained in:
Greg Kroah-Hartman 2014-10-20 15:09:49 +08:00
parent 213aefe206
commit 43789c319e
1 changed files with 14 additions and 3 deletions

View File

@ -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: