Commit 7c2670bb authored by maximilian attems's avatar maximilian attems Committed by Len Brown

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: default avatarmaximilian attems <max@stro.at>
Acked-by: default avatarAlexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 21511abd
...@@ -194,6 +194,9 @@ static int acpi_battery_get_property(struct power_supply *psy, ...@@ -194,6 +194,9 @@ static int acpi_battery_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_MANUFACTURER: case POWER_SUPPLY_PROP_MANUFACTURER:
val->strval = battery->oem_info; val->strval = battery->oem_info;
break; break;
case POWER_SUPPLY_PROP_SERIAL_NUMBER:
val->strval = battery->serial_number;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -212,6 +215,7 @@ static enum power_supply_property charge_battery_props[] = { ...@@ -212,6 +215,7 @@ static enum power_supply_property charge_battery_props[] = {
POWER_SUPPLY_PROP_CHARGE_NOW, POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
}; };
static enum power_supply_property energy_battery_props[] = { static enum power_supply_property energy_battery_props[] = {
...@@ -226,6 +230,7 @@ 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_ENERGY_NOW,
POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
}; };
#endif #endif
......
...@@ -116,6 +116,7 @@ static struct device_attribute power_supply_attrs[] = { ...@@ -116,6 +116,7 @@ static struct device_attribute power_supply_attrs[] = {
/* Properties of type `const char *' */ /* Properties of type `const char *' */
POWER_SUPPLY_ATTR(model_name), POWER_SUPPLY_ATTR(model_name),
POWER_SUPPLY_ATTR(manufacturer), POWER_SUPPLY_ATTR(manufacturer),
POWER_SUPPLY_ATTR(serial_number),
}; };
static ssize_t power_supply_show_static_attrs(struct device *dev, static ssize_t power_supply_show_static_attrs(struct device *dev,
......
...@@ -94,6 +94,7 @@ enum power_supply_property { ...@@ -94,6 +94,7 @@ enum power_supply_property {
/* Properties of type `const char *' */ /* Properties of type `const char *' */
POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
}; };
enum power_supply_type { enum power_supply_type {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment