Skip to content

Commit

Permalink
power_supply: Add "unknown" in power supply type
Browse files Browse the repository at this point in the history
For the default value of power supply type, "unknown" is added.
With default prop value, supply type property can be displayed
as default - "Unknown".

Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
  • Loading branch information
Kim, Milo authored and enomsg committed Jan 4, 2012
1 parent ce09aff commit 9b88722
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/power/power_supply_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static ssize_t power_supply_show_property(struct device *dev,
struct device_attribute *attr,
char *buf) {
static char *type_text[] = {
"Battery", "UPS", "Mains", "USB",
"Unknown", "Battery", "UPS", "Mains", "USB",
"USB_DCP", "USB_CDP", "USB_ACA"
};
static char *status_text[] = {
Expand Down
3 changes: 2 additions & 1 deletion include/linux/power_supply.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ enum power_supply_property {
};

enum power_supply_type {
POWER_SUPPLY_TYPE_BATTERY = 0,
POWER_SUPPLY_TYPE_UNKNOWN = 0,
POWER_SUPPLY_TYPE_BATTERY,
POWER_SUPPLY_TYPE_UPS,
POWER_SUPPLY_TYPE_MAINS,
POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */
Expand Down

0 comments on commit 9b88722

Please sign in to comment.