Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
e7143fdb
Commit
e7143fdb
authored
Feb 25, 2015
by
Sebastian Reichel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixes' into next
parents
bc352686
a7117f81
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
drivers/power/ipaq_micro_battery.c
drivers/power/ipaq_micro_battery.c
+20
-2
drivers/power/lp8788-charger.c
drivers/power/lp8788-charger.c
+3
-1
drivers/power/twl4030_madc_battery.c
drivers/power/twl4030_madc_battery.c
+5
-2
No files found.
drivers/power/ipaq_micro_battery.c
View file @
e7143fdb
...
...
@@ -226,6 +226,7 @@ static struct power_supply micro_ac_power = {
static
int
micro_batt_probe
(
struct
platform_device
*
pdev
)
{
struct
micro_battery
*
mb
;
int
ret
;
mb
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
*
mb
),
GFP_KERNEL
);
if
(
!
mb
)
...
...
@@ -233,14 +234,30 @@ static int micro_batt_probe(struct platform_device *pdev)
mb
->
micro
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
mb
->
wq
=
create_singlethread_workqueue
(
"ipaq-battery-wq"
);
if
(
!
mb
->
wq
)
return
-
ENOMEM
;
INIT_DELAYED_WORK
(
&
mb
->
update
,
micro_battery_work
);
platform_set_drvdata
(
pdev
,
mb
);
queue_delayed_work
(
mb
->
wq
,
&
mb
->
update
,
1
);
power_supply_register
(
&
pdev
->
dev
,
&
micro_batt_power
);
power_supply_register
(
&
pdev
->
dev
,
&
micro_ac_power
);
ret
=
power_supply_register
(
&
pdev
->
dev
,
&
micro_batt_power
);
if
(
ret
<
0
)
goto
batt_err
;
ret
=
power_supply_register
(
&
pdev
->
dev
,
&
micro_ac_power
);
if
(
ret
<
0
)
goto
ac_err
;
dev_info
(
&
pdev
->
dev
,
"iPAQ micro battery driver
\n
"
);
return
0
;
ac_err:
power_supply_unregister
(
&
micro_ac_power
);
batt_err:
cancel_delayed_work_sync
(
&
mb
->
update
);
destroy_workqueue
(
mb
->
wq
);
return
ret
;
}
static
int
micro_batt_remove
(
struct
platform_device
*
pdev
)
...
...
@@ -251,6 +268,7 @@ static int micro_batt_remove(struct platform_device *pdev)
power_supply_unregister
(
&
micro_ac_power
);
power_supply_unregister
(
&
micro_batt_power
);
cancel_delayed_work_sync
(
&
mb
->
update
);
destroy_workqueue
(
mb
->
wq
);
return
0
;
}
...
...
drivers/power/lp8788-charger.c
View file @
e7143fdb
...
...
@@ -417,8 +417,10 @@ static int lp8788_psy_register(struct platform_device *pdev,
pchg
->
battery
.
num_properties
=
ARRAY_SIZE
(
lp8788_battery_prop
);
pchg
->
battery
.
get_property
=
lp8788_battery_get_property
;
if
(
power_supply_register
(
&
pdev
->
dev
,
&
pchg
->
battery
))
if
(
power_supply_register
(
&
pdev
->
dev
,
&
pchg
->
battery
))
{
power_supply_unregister
(
&
pchg
->
charger
);
return
-
EPERM
;
}
return
0
;
}
...
...
drivers/power/twl4030_madc_battery.c
View file @
e7143fdb
...
...
@@ -192,6 +192,7 @@ static int twl4030_madc_battery_probe(struct platform_device *pdev)
{
struct
twl4030_madc_battery
*
twl4030_madc_bat
;
struct
twl4030_madc_bat_platform_data
*
pdata
=
pdev
->
dev
.
platform_data
;
int
ret
=
0
;
twl4030_madc_bat
=
kzalloc
(
sizeof
(
*
twl4030_madc_bat
),
GFP_KERNEL
);
if
(
!
twl4030_madc_bat
)
...
...
@@ -216,9 +217,11 @@ static int twl4030_madc_battery_probe(struct platform_device *pdev)
twl4030_madc_bat
->
pdata
=
pdata
;
platform_set_drvdata
(
pdev
,
twl4030_madc_bat
);
power_supply_register
(
&
pdev
->
dev
,
&
twl4030_madc_bat
->
psy
);
ret
=
power_supply_register
(
&
pdev
->
dev
,
&
twl4030_madc_bat
->
psy
);
if
(
ret
<
0
)
kfree
(
twl4030_madc_bat
);
return
0
;
return
ret
;
}
static
int
twl4030_madc_battery_remove
(
struct
platform_device
*
pdev
)
...
...
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