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
f869b87c
Commit
f869b87c
authored
Jun 10, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sa1100 irq] Convert to new system device API.
parent
3db29faf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
57 deletions
+36
-57
arch/arm/mach-sa1100/irq.c
arch/arm/mach-sa1100/irq.c
+36
-57
No files found.
arch/arm/mach-sa1100/irq.c
View file @
f869b87c
...
...
@@ -13,7 +13,7 @@
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/ptrace.h>
#include <linux/
device
.h>
#include <linux/
sysdev
.h>
#include <asm/hardware.h>
#include <asm/irq.h>
...
...
@@ -211,94 +211,73 @@ static struct resource irq_resource = {
.
end
=
0x9005ffff
,
};
st
ruct
sa1100irq_state
{
st
atic
struct
{
unsigned
int
saved
;
unsigned
int
icmr
;
unsigned
int
iclr
;
unsigned
int
iccr
;
};
}
sa1100irq_state
;
static
int
sa1100irq_suspend
(
struct
device
*
dev
,
u32
state
,
u32
level
)
{
struct
sa1100irq_state
*
st
;
if
(
!
dev
->
saved_state
&&
level
==
SUSPEND_NOTIFY
)
dev
->
saved_state
=
kmalloc
(
sizeof
(
struct
sa1100irq_state
),
GFP_KERNEL
);
if
(
!
dev
->
saved_state
)
return
-
ENOMEM
;
if
(
level
==
SUSPEND_POWER_DOWN
)
{
st
=
(
struct
sa1100irq_state
*
)
dev
->
saved_state
;
struct
sa1100irq_state
*
st
=
&
sa1100irq_state
;
st
->
saved
=
1
;
st
->
icmr
=
ICMR
;
st
->
iclr
=
ICLR
;
st
->
iccr
=
ICCR
;
st
->
saved
=
1
;
st
->
icmr
=
ICMR
;
st
->
iclr
=
ICLR
;
st
->
iccr
=
ICCR
;
/*
* Disable all GPIO-based interrupts.
*/
ICMR
&=
~
(
IC_GPIO11_27
|
IC_GPIO10
|
IC_GPIO9
|
IC_GPIO8
|
IC_GPIO7
|
IC_GPIO6
|
IC_GPIO5
|
IC_GPIO4
|
IC_GPIO3
|
IC_GPIO2
|
IC_GPIO1
|
IC_GPIO0
);
/*
* Disable all GPIO-based interrupts.
*/
ICMR
&=
~
(
IC_GPIO11_27
|
IC_GPIO10
|
IC_GPIO9
|
IC_GPIO8
|
IC_GPIO7
|
IC_GPIO6
|
IC_GPIO5
|
IC_GPIO4
|
IC_GPIO3
|
IC_GPIO2
|
IC_GPIO1
|
IC_GPIO0
);
/*
* Set the appropriate edges for wakeup.
*/
GRER
=
PWER
&
GPIO_IRQ_rising_edge
;
GFER
=
PWER
&
GPIO_IRQ_falling_edge
;
/*
* Set the appropriate edges for wakeup.
*/
GRER
=
PWER
&
GPIO_IRQ_rising_edge
;
GFER
=
PWER
&
GPIO_IRQ_falling_edge
;
/*
* Clear any pending GPIO interrupts.
*/
GEDR
=
GEDR
;
/*
* Clear any pending GPIO interrupts.
*/
GEDR
=
GEDR
;
}
return
0
;
}
static
int
sa1100irq_resume
(
struct
device
*
dev
,
u32
level
)
static
int
sa1100irq_resume
(
struct
sys_device
*
dev
)
{
struct
sa1100irq_state
*
st
;
if
(
level
==
RESUME_POWER_ON
)
{
st
=
(
struct
sa1100irq_state
*
)
dev
->
saved_state
;
dev
->
saved_state
=
NULL
;
if
(
st
->
saved
)
{
ICCR
=
st
->
iccr
;
ICLR
=
st
->
iclr
;
struct
sa1100irq_state
*
st
=
&
sa1100irq_state
;
GRER
=
GPIO_IRQ_rising_edge
&
GPIO_IRQ_mask
;
GFER
=
GPIO_IRQ_falling_edge
&
GPIO_IRQ_mask
;
if
(
st
->
saved
)
{
ICCR
=
st
->
iccr
;
ICLR
=
st
->
iclr
;
ICMR
=
st
->
icmr
;
}
GRER
=
GPIO_IRQ_rising_edge
&
GPIO_IRQ_mask
;
GFER
=
GPIO_IRQ_falling_edge
&
GPIO_IRQ_mask
;
kfree
(
st
)
;
ICMR
=
st
->
icmr
;
}
return
0
;
}
static
struct
device_driver
sa1100irq_driver
=
{
.
name
=
"sa11x0-irq"
,
.
bus
=
&
system_bus_type
,
static
struct
sysdev_class
sa1100irq_sysclass
=
{
set_kset_name
(
"sa11x0-irq"
),
.
suspend
=
sa1100irq_suspend
,
.
resume
=
sa1100irq_resume
,
};
static
struct
sys_device
sa1100irq_device
=
{
.
name
=
"irq"
,
.
id
=
0
,
.
dev
=
{
.
name
=
"Intel SA11x0 [Interrupt Controller]"
,
.
driver
=
&
sa1100irq_driver
,
},
.
cls
=
&
sa1100irq_sysclass
,
};
static
int
__init
sa1100irq_init_devicefs
(
void
)
{
driver_register
(
&
sa1100irq_driver
);
sysdev_class_register
(
&
sa1100irq_sysclass
);
return
sys_device_register
(
&
sa1100irq_device
);
}
...
...
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