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
56b750dc
Commit
56b750dc
authored
Feb 28, 2002
by
Nicolas Pitre
Committed by
Russell King
Feb 28, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] 998/1: GraphicsMaster irq code update
parent
efa0ef2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
40 deletions
+35
-40
arch/arm/mach-sa1100/graphicsmaster.c
arch/arm/mach-sa1100/graphicsmaster.c
+35
-40
No files found.
arch/arm/mach-sa1100/graphicsmaster.c
View file @
56b750dc
...
@@ -93,68 +93,62 @@ __initcall(graphicsmaster_init);
...
@@ -93,68 +93,62 @@ __initcall(graphicsmaster_init);
* Handlers for GraphicsMaster's external IRQ logic
* Handlers for GraphicsMaster's external IRQ logic
*/
*/
static
void
ADS_IRQ_demux
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
void
gm_irq_handler
(
unsigned
int
irq
,
struct
irqdesc
*
desc
,
struct
pt_regs
*
regs
)
{
{
int
i
;
unsigned
int
mask
;
while
(
(
irq
=
ADS_INT_ST1
|
(
ADS_INT_ST2
<<
8
))
){
while
((
mask
=
ADS_INT_ST1
|
(
ADS_INT_ST2
<<
8
)))
{
for
(
i
=
0
;
i
<
16
;
i
++
)
/* clear the parent IRQ */
if
(
irq
&
(
1
<<
i
)
)
{
GEDR
=
GPIO_GPIO0
;
do_IRQ
(
ADS_EXT_IRQ
(
i
),
regs
);
}
irq
=
ADS_EXT_IRQ
(
0
);
desc
=
irq_desc
+
irq
;
do
{
if
(
mask
&
1
)
desc
->
handle
(
irq
,
desc
,
regs
);
mask
>>=
1
;
irq
++
;
desc
++
;
}
while
(
mask
);
}
}
}
}
static
struct
irqaction
ADS_ext_irq
=
{
static
void
gm_mask_irq1
(
unsigned
int
irq
)
name:
"ADS_ext_IRQ"
,
handler:
ADS_IRQ_demux
,
flags:
SA_INTERRUPT
};
static
void
ADS_mask_and_ack_irq0
(
unsigned
int
irq
)
{
{
int
mask
=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
0
)));
int
mask
=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
0
)));
ADS_INT_EN1
&=
~
mask
;
ADS_INT_EN1
&=
~
mask
;
ADS_INT_ST1
=
mask
;
ADS_INT_ST1
=
mask
;
}
}
static
void
ADS_mask_irq0
(
unsigned
int
irq
)
static
void
gm_unmask_irq1
(
unsigned
int
irq
)
{
ADS_INT_ST1
=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
0
)));
}
static
void
ADS_unmask_irq0
(
unsigned
int
irq
)
{
{
ADS_INT_EN1
|=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
0
)));
ADS_INT_EN1
|=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
0
)));
}
}
static
struct
irqchip
ADS0
_chip
=
{
static
struct
irqchip
gm_irq1
_chip
=
{
ack:
ADS_mask_and_ack_irq0
,
ack:
gm_mask_irq1
,
mask:
ADS_mask_irq0
,
mask:
gm_mask_irq1
,
unmask:
ADS_unmask_irq0
,
unmask:
gm_unmask_irq1
,
};
};
static
void
ADS_mask_and_ack_irq1
(
unsigned
int
irq
)
static
void
gm_mask_irq2
(
unsigned
int
irq
)
{
{
int
mask
=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
8
)));
int
mask
=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
8
)));
ADS_INT_EN2
&=
~
mask
;
ADS_INT_EN2
&=
~
mask
;
ADS_INT_ST2
=
mask
;
ADS_INT_ST2
=
mask
;
}
}
static
void
ADS_mask_irq1
(
unsigned
int
irq
)
static
void
gm_unmask_irq2
(
unsigned
int
irq
)
{
ADS_INT_ST2
=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
8
)));
}
static
void
ADS_unmask_irq1
(
unsigned
int
irq
)
{
{
ADS_INT_EN2
|=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
8
)));
ADS_INT_EN2
|=
(
1
<<
(
irq
-
ADS_EXT_IRQ
(
8
)));
}
}
static
struct
irqchip
ADS1
_chip
=
{
static
struct
irqchip
gm_irq2
_chip
=
{
ack:
ADS_mask_irq1
,
ack:
gm_mask_irq2
,
mask:
ADS_mask_irq1
,
mask:
gm_mask_irq2
,
unmask:
ADS_mask_irq1
,
unmask:
gm_unmask_irq2
,
};
};
static
void
__init
graphicsmaster_init_irq
(
void
)
static
void
__init
graphicsmaster_init_irq
(
void
)
...
@@ -167,22 +161,23 @@ static void __init graphicsmaster_init_irq(void)
...
@@ -167,22 +161,23 @@ static void __init graphicsmaster_init_irq(void)
/* disable all IRQs */
/* disable all IRQs */
ADS_INT_EN1
=
0
;
ADS_INT_EN1
=
0
;
ADS_INT_EN2
=
0
;
ADS_INT_EN2
=
0
;
/* clear all IRQs */
/* clear all IRQs */
ADS_INT_ST1
=
0xff
;
ADS_INT_ST1
=
0xff
;
ADS_INT_ST2
=
0xff
;
ADS_INT_ST2
=
0xff
;
for
(
irq
=
ADS_EXT_IRQ
(
0
);
irq
<=
ADS_EXT_IRQ
(
7
);
irq
++
)
{
for
(
irq
=
ADS_EXT_IRQ
(
0
);
irq
<=
ADS_EXT_IRQ
(
7
);
irq
++
)
{
set_irq_chip
(
irq
,
&
ADS0
_chip
);
set_irq_chip
(
irq
,
&
gm_irq1
_chip
);
set_irq_handler
(
irq
,
do_level_IRQ
);
set_irq_handler
(
irq
,
do_level_IRQ
);
set_irq_flags
(
irq
,
IRQF_PROBE
|
IRQF_VALID
);
set_irq_flags
(
irq
,
IRQF_PROBE
|
IRQF_VALID
);
}
}
for
(
irq
=
ADS_EXT_IRQ
(
8
);
irq
<=
ADS_EXT_IRQ
(
15
);
irq
++
)
{
for
(
irq
=
ADS_EXT_IRQ
(
8
);
irq
<=
ADS_EXT_IRQ
(
15
);
irq
++
)
{
set_irq_chip
(
irq
,
&
ADS1
_chip
);
set_irq_chip
(
irq
,
&
gm_irq2
_chip
);
set_irq_handler
(
irq
,
do_level_IRQ
);
set_irq_handler
(
irq
,
do_level_IRQ
);
set_irq_flags
(
irq
,
IRQF_PROBE
|
IRQF_VALID
);
set_irq_flags
(
irq
,
IRQF_PROBE
|
IRQF_VALID
);
}
}
set_
GPIO_IRQ_edge
(
GPIO_GPIO0
,
GPIO_FALLING_EDGE
);
set_
irq_type
(
IRQ_GPIO0
,
IRQT_FALLING
);
set
up_arm_irq
(
IRQ_GPIO0
,
&
ADS_ext_irq
);
set
_irq_chained_handler
(
IRQ_GPIO0
,
gm_irq_handler
);
}
}
...
...
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