aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorNelson Castillo <arhuaco@freaks-unidos.net>2009-04-28 18:58:05 -0500
committerNelson Castillo <arhuaco@freaks-unidos.net>2009-04-28 18:59:24 -0500
commit4c9a8d5badc466a68d71754d47bbb792a8dc44da (patch)
treee0a84809ecaf6dab54bdaf3c17155a8734b8b3fe /drivers/power
parent9ecc089861ab238e391de368142cc17b2f715cf7 (diff)
GTA01: Add "present" property to power_supply
Small patch to add /sys/class/power_supply/battery/present. You must not run a GTA01 without battery thus it is always 1. Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/gta01_battery.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/gta01_battery.c b/drivers/power/gta01_battery.c
index 909f7fe16d9..81a0fe7387e 100644
--- a/drivers/power/gta01_battery.c
+++ b/drivers/power/gta01_battery.c
@@ -19,6 +19,7 @@ struct gta01_battery {
};
static enum power_supply_property gta01_bat_props[] = {
+ POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_CURRENT_NOW,
@@ -43,6 +44,9 @@ static int gta01_bat_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_CURRENT_NOW:
val->intval = bat->pdata->get_current();
break;
+ case POWER_SUPPLY_PROP_PRESENT:
+ val->intval = 1; /* You must never run GTA01 without battery. */
+ break;
default:
return -EINVAL;
}