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
9823b2d0
Commit
9823b2d0
authored
Feb 10, 2009
by
Thomas Kunze
Committed by
Thomas Kunze
Nov 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
collie: support pda_power driver
This add the pda-power platform device to collie.
parent
f1fce597
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/collie.c
+65
-0
No files found.
arch/arm/mach-sa1100/collie.c
View file @
9823b2d0
...
...
@@ -26,6 +26,7 @@
#include <linux/mtd/partitions.h>
#include <linux/timer.h>
#include <linux/gpio.h>
#include <linux/pda_power.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
...
...
@@ -89,6 +90,69 @@ static struct mcp_plat_data collie_mcp_data = {
.
gpio_base
=
COLLIE_TC35143_GPIO_BASE
,
};
/*
* Collie AC IN
*/
static
int
collie_power_init
(
struct
device
*
dev
)
{
int
ret
=
gpio_request
(
COLLIE_GPIO_AC_IN
,
"ac in"
);
if
(
ret
)
goto
err_gpio_req
;
ret
=
gpio_direction_input
(
COLLIE_GPIO_AC_IN
);
if
(
ret
)
goto
err_gpio_in
;
return
0
;
err_gpio_in:
gpio_free
(
COLLIE_GPIO_AC_IN
);
err_gpio_req:
return
ret
;
}
static
void
collie_power_exit
(
struct
device
*
dev
)
{
gpio_free
(
COLLIE_GPIO_AC_IN
);
}
static
int
collie_power_ac_online
(
void
)
{
return
gpio_get_value
(
COLLIE_GPIO_AC_IN
)
==
2
;
}
static
char
*
collie_ac_supplied_to
[]
=
{
"main-battery"
,
"backup-battery"
,
};
static
struct
pda_power_pdata
collie_power_data
=
{
.
init
=
collie_power_init
,
.
is_ac_online
=
collie_power_ac_online
,
.
exit
=
collie_power_exit
,
.
supplied_to
=
collie_ac_supplied_to
,
.
num_supplicants
=
ARRAY_SIZE
(
collie_ac_supplied_to
),
};
static
struct
resource
collie_power_resource
[]
=
{
{
.
name
=
"ac"
,
.
start
=
gpio_to_irq
(
COLLIE_GPIO_AC_IN
),
.
end
=
gpio_to_irq
(
COLLIE_GPIO_AC_IN
),
.
flags
=
IORESOURCE_IRQ
|
IORESOURCE_IRQ_HIGHEDGE
|
IORESOURCE_IRQ_LOWEDGE
,
},
};
static
struct
platform_device
collie_power_device
=
{
.
name
=
"pda-power"
,
.
id
=
-
1
,
.
dev
.
platform_data
=
&
collie_power_data
,
.
resource
=
collie_power_resource
,
.
num_resources
=
ARRAY_SIZE
(
collie_power_resource
),
};
#ifdef CONFIG_SHARP_LOCOMO
/*
* low-level UART features.
...
...
@@ -180,6 +244,7 @@ struct platform_device collie_locomo_device = {
static
struct
platform_device
*
devices
[]
__initdata
=
{
&
collie_locomo_device
,
&
colliescoop_device
,
&
collie_power_device
,
};
static
struct
mtd_partition
collie_partitions
[]
=
{
...
...
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