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
f020b5dd
Commit
f020b5dd
authored
Oct 09, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc-trivial: configure gpio in the carrier
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
234c680b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
fmc-trivial.c
kernel/fmc-trivial.c
+15
-0
No files found.
kernel/fmc-trivial.c
View file @
f020b5dd
...
...
@@ -2,6 +2,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/fmc.h>
#include "spec.h"
...
...
@@ -16,6 +17,18 @@ irqreturn_t t_handler(int irq, void *dev_id)
return
IRQ_HANDLED
;
}
struct
fmc_gpio
t_gpio
[]
=
{
{
.
gpio
=
FMC_GPIO_IRQ
(
0
),
.
mode
=
GPIOF_DIR_IN
,
.
irqmode
=
IRQF_TRIGGER_RISING
,
},
{
.
gpio
=
FMC_GPIO_IRQ
(
1
),
.
mode
=
GPIOF_DIR_IN
,
.
irqmode
=
IRQF_TRIGGER_RISING
,
}
};
int
t_probe
(
struct
fmc_device
*
fmc
)
{
int
ret
;
...
...
@@ -28,6 +41,8 @@ int t_probe(struct fmc_device *fmc)
ret
=
fmc
->
op
->
irq_request
(
fmc
,
t_handler
,
"fmc-trivial"
,
0
);
if
(
ret
<
0
)
return
ret
;
/* ignore error code of call below, we really don't care */
fmc
->
op
->
gpio_config
(
fmc
,
t_gpio
,
ARRAY_SIZE
(
t_gpio
));
/* Reprogram, if asked to. ESRCH == no filename specified */
ret
=
fmc
->
op
->
reprogram
(
fmc
,
&
t_drv
,
""
);
...
...
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