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
a176973e
Commit
a176973e
authored
Mar 14, 2014
by
Linus Walleij
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'irq/for-gpio' of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
into devel
parents
9e294427
c1bacbae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
include/linux/irq.h
include/linux/irq.h
+6
-0
kernel/irq/manage.c
kernel/irq/manage.c
+27
-1
No files found.
include/linux/irq.h
View file @
a176973e
...
...
@@ -303,6 +303,10 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
* @irq_pm_shutdown: function called from core code on shutdown once per chip
* @irq_calc_mask: Optional function to set irq_data.mask for special cases
* @irq_print_chip: optional to print special chip info in show_interrupts
* @irq_request_resources: optional to request resources before calling
* any other callback related to this irq
* @irq_release_resources: optional to release resources acquired with
* irq_request_resources
* @flags: chip specific flags
*/
struct
irq_chip
{
...
...
@@ -336,6 +340,8 @@ struct irq_chip {
void
(
*
irq_calc_mask
)(
struct
irq_data
*
data
);
void
(
*
irq_print_chip
)(
struct
irq_data
*
data
,
struct
seq_file
*
p
);
int
(
*
irq_request_resources
)(
struct
irq_data
*
data
);
void
(
*
irq_release_resources
)(
struct
irq_data
*
data
);
unsigned
long
flags
;
};
...
...
kernel/irq/manage.c
View file @
a176973e
...
...
@@ -896,6 +896,23 @@ static void irq_setup_forced_threading(struct irqaction *new)
}
}
static
int
irq_request_resources
(
struct
irq_desc
*
desc
)
{
struct
irq_data
*
d
=
&
desc
->
irq_data
;
struct
irq_chip
*
c
=
d
->
chip
;
return
c
->
irq_request_resources
?
c
->
irq_request_resources
(
d
)
:
0
;
}
static
void
irq_release_resources
(
struct
irq_desc
*
desc
)
{
struct
irq_data
*
d
=
&
desc
->
irq_data
;
struct
irq_chip
*
c
=
d
->
chip
;
if
(
c
->
irq_release_resources
)
c
->
irq_release_resources
(
d
);
}
/*
* Internal function to register an irqaction - typically used to
* allocate special interrupts that are part of the architecture.
...
...
@@ -1091,6 +1108,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
}
if
(
!
shared
)
{
ret
=
irq_request_resources
(
desc
);
if
(
ret
)
{
pr_err
(
"Failed to request resources for %s (irq %d) on irqchip %s
\n
"
,
new
->
name
,
irq
,
desc
->
irq_data
.
chip
->
name
);
goto
out_mask
;
}
init_waitqueue_head
(
&
desc
->
wait_for_threads
);
/* Setup the type (level, edge polarity) if configured: */
...
...
@@ -1261,8 +1285,10 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
*
action_ptr
=
action
->
next
;
/* If this was the last handler, shut down the IRQ line: */
if
(
!
desc
->
action
)
if
(
!
desc
->
action
)
{
irq_shutdown
(
desc
);
irq_release_resources
(
desc
);
}
#ifdef CONFIG_SMP
/* make sure affinity_hint is cleaned up */
...
...
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