Lines 87-92
struct acpi_ac {
Link Here
|
87 |
unsigned long long state; |
87 |
unsigned long long state; |
88 |
}; |
88 |
}; |
89 |
|
89 |
|
|
|
90 |
static int acpi_ac_get_state(struct acpi_ac *ac); |
90 |
#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); |
91 |
#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); |
91 |
|
92 |
|
92 |
#ifdef CONFIG_ACPI_PROCFS_POWER |
93 |
#ifdef CONFIG_ACPI_PROCFS_POWER |
Lines 103-117
static int get_ac_property(struct power_
Link Here
|
103 |
enum power_supply_property psp, |
104 |
enum power_supply_property psp, |
104 |
union power_supply_propval *val) |
105 |
union power_supply_propval *val) |
105 |
{ |
106 |
{ |
|
|
107 |
int result; |
106 |
struct acpi_ac *ac = to_acpi_ac(psy); |
108 |
struct acpi_ac *ac = to_acpi_ac(psy); |
|
|
109 |
|
107 |
switch (psp) { |
110 |
switch (psp) { |
108 |
case POWER_SUPPLY_PROP_ONLINE: |
111 |
case POWER_SUPPLY_PROP_ONLINE: |
|
|
112 |
result = acpi_ac_get_state(ac); |
109 |
val->intval = ac->state; |
113 |
val->intval = ac->state; |
110 |
break; |
114 |
break; |
111 |
default: |
115 |
default: |
112 |
return -EINVAL; |
116 |
return -EINVAL; |
113 |
} |
117 |
} |
114 |
return 0; |
118 |
return result; |
115 |
} |
119 |
} |
116 |
|
120 |
|
117 |
static enum power_supply_property ac_props[] = { |
121 |
static enum power_supply_property ac_props[] = { |