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
c4e8964e
Commit
c4e8964e
authored
Nov 29, 2010
by
Lennert Buytenhek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: sa1100: irq_data conversion.
Signed-off-by:
Lennert Buytenhek
<
buytenh@secretlab.ca
>
parent
9a364da7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
46 deletions
+46
-46
arch/arm/mach-sa1100/irq.c
arch/arm/mach-sa1100/irq.c
+42
-42
arch/arm/mach-sa1100/neponset.c
arch/arm/mach-sa1100/neponset.c
+4
-4
No files found.
arch/arm/mach-sa1100/irq.c
View file @
c4e8964e
...
@@ -37,14 +37,14 @@ static int GPIO_IRQ_mask = (1 << 11) - 1;
...
@@ -37,14 +37,14 @@ static int GPIO_IRQ_mask = (1 << 11) - 1;
#define GPIO_11_27_IRQ(i) ((i) - 21)
#define GPIO_11_27_IRQ(i) ((i) - 21)
#define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq))
#define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq))
static
int
sa1100_gpio_type
(
unsigned
int
irq
,
unsigned
int
type
)
static
int
sa1100_gpio_type
(
struct
irq_data
*
d
,
unsigned
int
type
)
{
{
unsigned
int
mask
;
unsigned
int
mask
;
if
(
irq
<=
10
)
if
(
d
->
irq
<=
10
)
mask
=
1
<<
irq
;
mask
=
1
<<
d
->
irq
;
else
else
mask
=
GPIO11_27_MASK
(
irq
);
mask
=
GPIO11_27_MASK
(
d
->
irq
);
if
(
type
==
IRQ_TYPE_PROBE
)
{
if
(
type
==
IRQ_TYPE_PROBE
)
{
if
((
GPIO_IRQ_rising_edge
|
GPIO_IRQ_falling_edge
)
&
mask
)
if
((
GPIO_IRQ_rising_edge
|
GPIO_IRQ_falling_edge
)
&
mask
)
...
@@ -70,37 +70,37 @@ static int sa1100_gpio_type(unsigned int irq, unsigned int type)
...
@@ -70,37 +70,37 @@ static int sa1100_gpio_type(unsigned int irq, unsigned int type)
/*
/*
* GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10.
* GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10.
*/
*/
static
void
sa1100_low_gpio_ack
(
unsigned
int
irq
)
static
void
sa1100_low_gpio_ack
(
struct
irq_data
*
d
)
{
{
GEDR
=
(
1
<<
irq
);
GEDR
=
(
1
<<
d
->
irq
);
}
}
static
void
sa1100_low_gpio_mask
(
unsigned
int
irq
)
static
void
sa1100_low_gpio_mask
(
struct
irq_data
*
d
)
{
{
ICMR
&=
~
(
1
<<
irq
);
ICMR
&=
~
(
1
<<
d
->
irq
);
}
}
static
void
sa1100_low_gpio_unmask
(
unsigned
int
irq
)
static
void
sa1100_low_gpio_unmask
(
struct
irq_data
*
d
)
{
{
ICMR
|=
1
<<
irq
;
ICMR
|=
1
<<
d
->
irq
;
}
}
static
int
sa1100_low_gpio_wake
(
unsigned
int
irq
,
unsigned
int
on
)
static
int
sa1100_low_gpio_wake
(
struct
irq_data
*
d
,
unsigned
int
on
)
{
{
if
(
on
)
if
(
on
)
PWER
|=
1
<<
irq
;
PWER
|=
1
<<
d
->
irq
;
else
else
PWER
&=
~
(
1
<<
irq
);
PWER
&=
~
(
1
<<
d
->
irq
);
return
0
;
return
0
;
}
}
static
struct
irq_chip
sa1100_low_gpio_chip
=
{
static
struct
irq_chip
sa1100_low_gpio_chip
=
{
.
name
=
"GPIO-l"
,
.
name
=
"GPIO-l"
,
.
ack
=
sa1100_low_gpio_ack
,
.
irq_ack
=
sa1100_low_gpio_ack
,
.
mask
=
sa1100_low_gpio_mask
,
.
irq_mask
=
sa1100_low_gpio_mask
,
.
unmask
=
sa1100_low_gpio_unmask
,
.
irq_unmask
=
sa1100_low_gpio_unmask
,
.
set_type
=
sa1100_gpio_type
,
.
irq_
set_type
=
sa1100_gpio_type
,
.
set_wake
=
sa1100_low_gpio_wake
,
.
irq_
set_wake
=
sa1100_low_gpio_wake
,
};
};
/*
/*
...
@@ -139,16 +139,16 @@ sa1100_high_gpio_handler(unsigned int irq, struct irq_desc *desc)
...
@@ -139,16 +139,16 @@ sa1100_high_gpio_handler(unsigned int irq, struct irq_desc *desc)
* In addition, the IRQs are all collected up into one bit in the
* In addition, the IRQs are all collected up into one bit in the
* interrupt controller registers.
* interrupt controller registers.
*/
*/
static
void
sa1100_high_gpio_ack
(
unsigned
int
irq
)
static
void
sa1100_high_gpio_ack
(
struct
irq_data
*
d
)
{
{
unsigned
int
mask
=
GPIO11_27_MASK
(
irq
);
unsigned
int
mask
=
GPIO11_27_MASK
(
d
->
irq
);
GEDR
=
mask
;
GEDR
=
mask
;
}
}
static
void
sa1100_high_gpio_mask
(
unsigned
int
irq
)
static
void
sa1100_high_gpio_mask
(
struct
irq_data
*
d
)
{
{
unsigned
int
mask
=
GPIO11_27_MASK
(
irq
);
unsigned
int
mask
=
GPIO11_27_MASK
(
d
->
irq
);
GPIO_IRQ_mask
&=
~
mask
;
GPIO_IRQ_mask
&=
~
mask
;
...
@@ -156,9 +156,9 @@ static void sa1100_high_gpio_mask(unsigned int irq)
...
@@ -156,9 +156,9 @@ static void sa1100_high_gpio_mask(unsigned int irq)
GFER
&=
~
mask
;
GFER
&=
~
mask
;
}
}
static
void
sa1100_high_gpio_unmask
(
unsigned
int
irq
)
static
void
sa1100_high_gpio_unmask
(
struct
irq_data
*
d
)
{
{
unsigned
int
mask
=
GPIO11_27_MASK
(
irq
);
unsigned
int
mask
=
GPIO11_27_MASK
(
d
->
irq
);
GPIO_IRQ_mask
|=
mask
;
GPIO_IRQ_mask
|=
mask
;
...
@@ -166,44 +166,44 @@ static void sa1100_high_gpio_unmask(unsigned int irq)
...
@@ -166,44 +166,44 @@ static void sa1100_high_gpio_unmask(unsigned int irq)
GFER
=
GPIO_IRQ_falling_edge
&
GPIO_IRQ_mask
;
GFER
=
GPIO_IRQ_falling_edge
&
GPIO_IRQ_mask
;
}
}
static
int
sa1100_high_gpio_wake
(
unsigned
int
irq
,
unsigned
int
on
)
static
int
sa1100_high_gpio_wake
(
struct
irq_data
*
d
,
unsigned
int
on
)
{
{
if
(
on
)
if
(
on
)
PWER
|=
GPIO11_27_MASK
(
irq
);
PWER
|=
GPIO11_27_MASK
(
d
->
irq
);
else
else
PWER
&=
~
GPIO11_27_MASK
(
irq
);
PWER
&=
~
GPIO11_27_MASK
(
d
->
irq
);
return
0
;
return
0
;
}
}
static
struct
irq_chip
sa1100_high_gpio_chip
=
{
static
struct
irq_chip
sa1100_high_gpio_chip
=
{
.
name
=
"GPIO-h"
,
.
name
=
"GPIO-h"
,
.
ack
=
sa1100_high_gpio_ack
,
.
irq_ack
=
sa1100_high_gpio_ack
,
.
mask
=
sa1100_high_gpio_mask
,
.
irq_mask
=
sa1100_high_gpio_mask
,
.
unmask
=
sa1100_high_gpio_unmask
,
.
irq_unmask
=
sa1100_high_gpio_unmask
,
.
set_type
=
sa1100_gpio_type
,
.
irq_
set_type
=
sa1100_gpio_type
,
.
set_wake
=
sa1100_high_gpio_wake
,
.
irq_
set_wake
=
sa1100_high_gpio_wake
,
};
};
/*
/*
* We don't need to ACK IRQs on the SA1100 unless they're GPIOs
* We don't need to ACK IRQs on the SA1100 unless they're GPIOs
* this is for internal IRQs i.e. from 11 to 31.
* this is for internal IRQs i.e. from 11 to 31.
*/
*/
static
void
sa1100_mask_irq
(
unsigned
int
irq
)
static
void
sa1100_mask_irq
(
struct
irq_data
*
d
)
{
{
ICMR
&=
~
(
1
<<
irq
);
ICMR
&=
~
(
1
<<
d
->
irq
);
}
}
static
void
sa1100_unmask_irq
(
unsigned
int
irq
)
static
void
sa1100_unmask_irq
(
struct
irq_data
*
d
)
{
{
ICMR
|=
(
1
<<
irq
);
ICMR
|=
(
1
<<
d
->
irq
);
}
}
/*
/*
* Apart form GPIOs, only the RTC alarm can be a wakeup event.
* Apart form GPIOs, only the RTC alarm can be a wakeup event.
*/
*/
static
int
sa1100_set_wake
(
unsigned
int
irq
,
unsigned
int
on
)
static
int
sa1100_set_wake
(
struct
irq_data
*
d
,
unsigned
int
on
)
{
{
if
(
irq
==
IRQ_RTCAlrm
)
{
if
(
d
->
irq
==
IRQ_RTCAlrm
)
{
if
(
on
)
if
(
on
)
PWER
|=
PWER_RTC
;
PWER
|=
PWER_RTC
;
else
else
...
@@ -215,10 +215,10 @@ static int sa1100_set_wake(unsigned int irq, unsigned int on)
...
@@ -215,10 +215,10 @@ static int sa1100_set_wake(unsigned int irq, unsigned int on)
static
struct
irq_chip
sa1100_normal_chip
=
{
static
struct
irq_chip
sa1100_normal_chip
=
{
.
name
=
"SC"
,
.
name
=
"SC"
,
.
ack
=
sa1100_mask_irq
,
.
irq_ack
=
sa1100_mask_irq
,
.
mask
=
sa1100_mask_irq
,
.
irq_mask
=
sa1100_mask_irq
,
.
unmask
=
sa1100_unmask_irq
,
.
irq_unmask
=
sa1100_unmask_irq
,
.
set_wake
=
sa1100_set_wake
,
.
irq_
set_wake
=
sa1100_set_wake
,
};
};
static
struct
resource
irq_resource
=
{
static
struct
resource
irq_resource
=
{
...
...
arch/arm/mach-sa1100/neponset.c
View file @
c4e8964e
...
@@ -35,7 +35,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
...
@@ -35,7 +35,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
/*
/*
* Acknowledge the parent IRQ.
* Acknowledge the parent IRQ.
*/
*/
desc
->
chip
->
ack
(
irq
);
desc
->
irq_data
.
chip
->
irq_ack
(
&
desc
->
irq_data
);
/*
/*
* Read the interrupt reason register. Let's have all
* Read the interrupt reason register. Let's have all
...
@@ -53,7 +53,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
...
@@ -53,7 +53,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
* recheck the register for any pending IRQs.
* recheck the register for any pending IRQs.
*/
*/
if
(
irr
&
(
IRR_ETHERNET
|
IRR_USAR
))
{
if
(
irr
&
(
IRR_ETHERNET
|
IRR_USAR
))
{
desc
->
chip
->
mask
(
irq
);
desc
->
irq_data
.
chip
->
irq_mask
(
&
desc
->
irq_data
);
/*
/*
* Ack the interrupt now to prevent re-entering
* Ack the interrupt now to prevent re-entering
...
@@ -61,7 +61,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
...
@@ -61,7 +61,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
* since we'll check the IRR register prior to
* since we'll check the IRR register prior to
* leaving.
* leaving.
*/
*/
desc
->
chip
->
ack
(
irq
);
desc
->
irq_data
.
chip
->
irq_ack
(
&
desc
->
irq_data
);
if
(
irr
&
IRR_ETHERNET
)
{
if
(
irr
&
IRR_ETHERNET
)
{
generic_handle_irq
(
IRQ_NEPONSET_SMC9196
);
generic_handle_irq
(
IRQ_NEPONSET_SMC9196
);
...
@@ -71,7 +71,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
...
@@ -71,7 +71,7 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
generic_handle_irq
(
IRQ_NEPONSET_USAR
);
generic_handle_irq
(
IRQ_NEPONSET_USAR
);
}
}
desc
->
chip
->
unmask
(
irq
);
desc
->
irq_data
.
chip
->
irq_unmask
(
&
desc
->
irq_data
);
}
}
if
(
irr
&
IRR_SA1111
)
{
if
(
irr
&
IRR_SA1111
)
{
...
...
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