Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC - Software
Commits
3af5e8af
Commit
3af5e8af
authored
Dec 15, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: move irq test to separate function
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
98ca8c01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
spec-fmc.c
kernel/spec-fmc.c
+25
-16
No files found.
kernel/spec-fmc.c
View file @
3af5e8af
...
...
@@ -433,6 +433,29 @@ static irqreturn_t spec_test_handler(int irq, void *dev_id)
return
IRQ_HANDLED
;
}
static
int
spec_irq_test
(
struct
fmc_device
*
fmc
)
{
struct
spec_dev
*
spec
=
fmc
->
carrier_data
;
spec
->
irq_count
=
0
;
init_completion
(
&
spec
->
compl
);
fmc
->
op
->
irq_request
(
fmc
,
spec_test_handler
,
"spec-test"
,
IRQF_SHARED
);
gennum_writel
(
spec
,
8
,
GNINT_STAT
);
gennum_writel
(
spec
,
0
,
GNINT_STAT
);
wait_for_completion_timeout
(
&
spec
->
compl
,
msecs_to_jiffies
(
50
));
fmc
->
op
->
irq_free
(
fmc
);
if
(
!
spec
->
irq_count
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"Can't receive interrupt
\n
"
);
return
-
EIO
;
}
dev_info
(
&
spec
->
pdev
->
dev
,
"Interrupts work as expected
\n
"
);
/* FIXME: configure the GPIO pins to receive interrupts */
return
0
;
}
/*
* Finally, the real init and exit
*/
...
...
@@ -469,22 +492,8 @@ static int spec_irq_init(struct fmc_device *fmc)
gennum_writel
(
spec
,
0x800c
,
GNINT_CFG
(
0
/* first one */
));
/* Finally, ensure we are able to receive it -- if the user asked to */
if
(
spec_test_irq
==
0
)
return
0
;
spec
->
irq_count
=
0
;
init_completion
(
&
spec
->
compl
);
fmc
->
op
->
irq_request
(
fmc
,
spec_test_handler
,
"spec-test"
,
IRQF_SHARED
);
gennum_writel
(
spec
,
8
,
GNINT_STAT
);
gennum_writel
(
spec
,
0
,
GNINT_STAT
);
wait_for_completion_timeout
(
&
spec
->
compl
,
msecs_to_jiffies
(
50
));
fmc
->
op
->
irq_free
(
fmc
);
if
(
!
spec
->
irq_count
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"Can't receive interrupt
\n
"
);
return
-
EIO
;
}
dev_info
(
&
spec
->
pdev
->
dev
,
"Interrupts work as expected
\n
"
);
/* FIXME: configure the GPIO pins to receive interrupts */
if
(
spec_test_irq
)
return
spec_irq_test
(
fmc
);
return
0
;
}
...
...
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