]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ACPI: battery: add sysfs serial number
authormaximilian attems <max@stro.at>
Tue, 22 Jan 2008 17:46:50 +0000 (18:46 +0100)
committerLen Brown <len.brown@intel.com>
Wed, 6 Feb 2008 02:15:50 +0000 (21:15 -0500)
egrep serial /proc/acpi/battery/BAT0/info
serial number:           32090

serial number can tell you from the imminent danger
of beeing set on fire.

Signed-off-by: maximilian attems <max@stro.at>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/battery.c
drivers/power/power_supply_sysfs.c
include/linux/power_supply.h

index c4a769d1ba8542bf0210f71eb6930641c9062a2f..f6215e8098086887f11b414e180923479949c467 100644 (file)
@@ -194,6 +194,9 @@ static int acpi_battery_get_property(struct power_supply *psy,
        case POWER_SUPPLY_PROP_MANUFACTURER:
                val->strval = battery->oem_info;
                break;
+       case POWER_SUPPLY_PROP_SERIAL_NUMBER:
+               val->strval = battery->serial_number;
+               break;
        default:
                return -EINVAL;
        }
@@ -212,6 +215,7 @@ static enum power_supply_property charge_battery_props[] = {
        POWER_SUPPLY_PROP_CHARGE_NOW,
        POWER_SUPPLY_PROP_MODEL_NAME,
        POWER_SUPPLY_PROP_MANUFACTURER,
+       POWER_SUPPLY_PROP_SERIAL_NUMBER,
 };
 
 static enum power_supply_property energy_battery_props[] = {
@@ -226,6 +230,7 @@ static enum power_supply_property energy_battery_props[] = {
        POWER_SUPPLY_PROP_ENERGY_NOW,
        POWER_SUPPLY_PROP_MODEL_NAME,
        POWER_SUPPLY_PROP_MANUFACTURER,
+       POWER_SUPPLY_PROP_SERIAL_NUMBER,
 };
 #endif
 
index d4824840c5bfc9c8bb877399014e01305adf3862..ad2bed0174d63944356a2befb4bef2eb3a562036 100644 (file)
@@ -116,6 +116,7 @@ static struct device_attribute power_supply_attrs[] = {
        /* Properties of type `const char *' */
        POWER_SUPPLY_ATTR(model_name),
        POWER_SUPPLY_ATTR(manufacturer),
+       POWER_SUPPLY_ATTR(serial_number),
 };
 
 static ssize_t power_supply_show_static_attrs(struct device *dev,
index 5cbf3e371012a8ed26b361d72a1614d4d9a0c03b..68ed19ccf1f702c1978c8fb5e18ed557f316484c 100644 (file)
@@ -94,6 +94,7 @@ enum power_supply_property {
        /* Properties of type `const char *' */
        POWER_SUPPLY_PROP_MODEL_NAME,
        POWER_SUPPLY_PROP_MANUFACTURER,
+       POWER_SUPPLY_PROP_SERIAL_NUMBER,
 };
 
 enum power_supply_type {