Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
86533e80
Commit
86533e80
authored
Nov 20, 2007
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Pull battery into release branch
parents
2ffbb837
037cbc63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
drivers/acpi/battery.c
drivers/acpi/battery.c
+2
-0
drivers/acpi/sbs.c
drivers/acpi/sbs.c
+17
-8
No files found.
drivers/acpi/battery.c
View file @
86533e80
...
...
@@ -153,6 +153,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
val
->
intval
=
POWER_SUPPLY_STATUS_CHARGING
;
else
if
(
battery
->
state
==
0
)
val
->
intval
=
POWER_SUPPLY_STATUS_FULL
;
else
val
->
intval
=
POWER_SUPPLY_STATUS_UNKNOWN
;
break
;
case
POWER_SUPPLY_PROP_PRESENT
:
val
->
intval
=
acpi_battery_present
(
battery
);
...
...
drivers/acpi/sbs.c
View file @
86533e80
...
...
@@ -113,6 +113,7 @@ struct acpi_battery {
u16
spec
;
u8
id
;
u8
present
:
1
;
u8
have_sysfs_alarm
:
1
;
};
#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
...
...
@@ -808,7 +809,13 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
}
battery
->
bat
.
get_property
=
acpi_sbs_battery_get_property
;
result
=
power_supply_register
(
&
sbs
->
device
->
dev
,
&
battery
->
bat
);
device_create_file
(
battery
->
bat
.
dev
,
&
alarm_attr
);
if
(
result
)
goto
end
;
result
=
device_create_file
(
battery
->
bat
.
dev
,
&
alarm_attr
);
if
(
result
)
goto
end
;
battery
->
have_sysfs_alarm
=
1
;
end:
printk
(
KERN_INFO
PREFIX
"%s [%s]: Battery Slot [%s] (battery %s)
\n
"
,
ACPI_SBS_DEVICE_NAME
,
acpi_device_bid
(
sbs
->
device
),
battery
->
name
,
sbs
->
battery
->
present
?
"present"
:
"absent"
);
...
...
@@ -817,14 +824,16 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
static
void
acpi_battery_remove
(
struct
acpi_sbs
*
sbs
,
int
id
)
{
if
(
sbs
->
battery
[
id
].
bat
.
dev
)
device_remove_file
(
sbs
->
battery
[
id
].
bat
.
dev
,
&
alarm_attr
);
power_supply_unregister
(
&
sbs
->
battery
[
id
].
bat
);
#ifdef CONFIG_ACPI_PROCFS
if
(
sbs
->
battery
[
id
].
proc_entry
)
{
acpi_sbs_remove_fs
(
&
(
sbs
->
battery
[
id
].
proc_entry
),
acpi_battery_dir
);
struct
acpi_battery
*
battery
=
&
sbs
->
battery
[
id
];
if
(
battery
->
bat
.
dev
)
{
if
(
battery
->
have_sysfs_alarm
)
device_remove_file
(
battery
->
bat
.
dev
,
&
alarm_attr
);
power_supply_unregister
(
&
battery
->
bat
);
}
#ifdef CONFIG_ACPI_PROCFS
if
(
battery
->
proc_entry
)
acpi_sbs_remove_fs
(
&
battery
->
proc_entry
,
acpi_battery_dir
);
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment