diff options
author | maximilian attems <max@stro.at> | 2008-01-22 12:46:50 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-05 21:15:50 -0500 |
commit | 7c2670bbb53820d0a4fab8d74593eeccd1eef225 (patch) | |
tree | 1c6207181694443b0ac0be6b16e446feae527c77 | |
parent | 21511abd0a248a3f225d3b611cfabb93124605a7 (diff) |
ACPI: battery: add sysfs serial number
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>
-rw-r--r-- | drivers/acpi/battery.c | 5 | ||||
-rw-r--r-- | drivers/power/power_supply_sysfs.c | 1 | ||||
-rw-r--r-- | include/linux/power_supply.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index c4a769d1ba85..f6215e809808 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -194,6 +194,9 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
194 | case POWER_SUPPLY_PROP_MANUFACTURER: | 194 | case POWER_SUPPLY_PROP_MANUFACTURER: |
195 | val->strval = battery->oem_info; | 195 | val->strval = battery->oem_info; |
196 | break; | 196 | break; |
197 | case POWER_SUPPLY_PROP_SERIAL_NUMBER: | ||
198 | val->strval = battery->serial_number; | ||
199 | break; | ||
197 | default: | 200 | default: |
198 | return -EINVAL; | 201 | return -EINVAL; |
199 | } | 202 | } |
@@ -212,6 +215,7 @@ static enum power_supply_property charge_battery_props[] = { | |||
212 | POWER_SUPPLY_PROP_CHARGE_NOW, | 215 | POWER_SUPPLY_PROP_CHARGE_NOW, |
213 | POWER_SUPPLY_PROP_MODEL_NAME, | 216 | POWER_SUPPLY_PROP_MODEL_NAME, |
214 | POWER_SUPPLY_PROP_MANUFACTURER, | 217 | POWER_SUPPLY_PROP_MANUFACTURER, |
218 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | ||
215 | }; | 219 | }; |
216 | 220 | ||
217 | static enum power_supply_property energy_battery_props[] = { | 221 | static enum power_supply_property energy_battery_props[] = { |
@@ -226,6 +230,7 @@ static enum power_supply_property energy_battery_props[] = { | |||
226 | POWER_SUPPLY_PROP_ENERGY_NOW, | 230 | POWER_SUPPLY_PROP_ENERGY_NOW, |
227 | POWER_SUPPLY_PROP_MODEL_NAME, | 231 | POWER_SUPPLY_PROP_MODEL_NAME, |
228 | POWER_SUPPLY_PROP_MANUFACTURER, | 232 | POWER_SUPPLY_PROP_MANUFACTURER, |
233 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | ||
229 | }; | 234 | }; |
230 | #endif | 235 | #endif |
231 | 236 | ||
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index d4824840c5bf..ad2bed0174d6 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c | |||
@@ -116,6 +116,7 @@ static struct device_attribute power_supply_attrs[] = { | |||
116 | /* Properties of type `const char *' */ | 116 | /* Properties of type `const char *' */ |
117 | POWER_SUPPLY_ATTR(model_name), | 117 | POWER_SUPPLY_ATTR(model_name), |
118 | POWER_SUPPLY_ATTR(manufacturer), | 118 | POWER_SUPPLY_ATTR(manufacturer), |
119 | POWER_SUPPLY_ATTR(serial_number), | ||
119 | }; | 120 | }; |
120 | 121 | ||
121 | static ssize_t power_supply_show_static_attrs(struct device *dev, | 122 | static ssize_t power_supply_show_static_attrs(struct device *dev, |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 5cbf3e371012..68ed19ccf1f7 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -94,6 +94,7 @@ enum power_supply_property { | |||
94 | /* Properties of type `const char *' */ | 94 | /* Properties of type `const char *' */ |
95 | POWER_SUPPLY_PROP_MODEL_NAME, | 95 | POWER_SUPPLY_PROP_MODEL_NAME, |
96 | POWER_SUPPLY_PROP_MANUFACTURER, | 96 | POWER_SUPPLY_PROP_MANUFACTURER, |
97 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | ||
97 | }; | 98 | }; |
98 | 99 | ||
99 | enum power_supply_type { | 100 | enum power_supply_type { |