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
Kirill Smelkov
linux
Commits
0831e3e4
Commit
0831e3e4
authored
Oct 06, 2009
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: iPAQ: provide a way to setup platform-controlled GPIOs
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
a5d176a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
arch/arm/mach-sa1100/h3600.c
arch/arm/mach-sa1100/h3600.c
+42
-0
No files found.
arch/arm/mach-sa1100/h3600.c
View file @
0831e3e4
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/partitions.h>
#include <linux/serial_core.h>
#include <linux/serial_core.h>
#include <linux/gpio.h>
#include <asm/irq.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
...
@@ -49,6 +50,47 @@
...
@@ -49,6 +50,47 @@
void
(
*
assign_h3600_egpio
)(
enum
ipaq_egpio_type
x
,
int
level
);
void
(
*
assign_h3600_egpio
)(
enum
ipaq_egpio_type
x
,
int
level
);
EXPORT_SYMBOL
(
assign_h3600_egpio
);
EXPORT_SYMBOL
(
assign_h3600_egpio
);
struct
gpio_default_state
{
int
gpio
;
int
mode
;
const
char
*
name
;
};
#define GPIO_MODE_IN -1
#define GPIO_MODE_OUT0 0
#define GPIO_MODE_OUT1 1
static
void
h3xxx_init_gpio
(
struct
gpio_default_state
*
s
,
size_t
n
)
{
while
(
n
--
)
{
const
char
*
name
=
s
->
name
;
int
err
;
if
(
!
name
)
name
=
"[init]"
;
err
=
gpio_request
(
s
->
gpio
,
name
);
if
(
err
)
{
printk
(
KERN_ERR
"gpio%u: unable to request: %d
\n
"
,
s
->
gpio
,
err
);
continue
;
}
if
(
s
->
mode
>=
0
)
{
err
=
gpio_direction_output
(
s
->
gpio
,
s
->
mode
);
}
else
{
err
=
gpio_direction_input
(
s
->
gpio
);
}
if
(
err
)
{
printk
(
KERN_ERR
"gpio%u: unable to set direction: %d
\n
"
,
s
->
gpio
,
err
);
continue
;
}
if
(
!
s
->
name
)
gpio_free
(
s
->
gpio
);
s
++
;
}
}
static
struct
mtd_partition
h3xxx_partitions
[]
=
{
static
struct
mtd_partition
h3xxx_partitions
[]
=
{
{
{
.
name
=
"H3XXX boot firmware"
,
.
name
=
"H3XXX boot firmware"
,
...
...
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