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
f4432bc8
Commit
f4432bc8
authored
Jul 24, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup spec-gpio, but there's no code yet
parent
8037b7d9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
5 deletions
+47
-5
Makefile
kernel/Makefile
+6
-4
spec-fmc.c
kernel/spec-fmc.c
+2
-0
spec-gpio-no.c
kernel/spec-gpio-no.c
+17
-0
spec-gpio.c
kernel/spec-gpio.c
+15
-0
spec.h
kernel/spec.h
+7
-1
No files found.
kernel/Makefile
View file @
f4432bc8
...
...
@@ -8,10 +8,12 @@ obj-m += spec.o
obj-m
+=
fmc-trivial.o
obj-m
+=
wr-nic.o
spec-objs
=
spec-pci.o
spec-objs
+=
spec-fmc.o
spec-objs
+=
spec-i2c.o
spec-objs
+=
loader-ll.o
spec-y
=
spec-pci.o
spec-y
+=
spec-fmc.o
spec-y
+=
spec-i2c.o
spec-y
+=
loader-ll.o
spec-y
+=
spec-gpio-no.o
spec-$(CONFIG_GPIOLIB)
+=
spec-gpio.o
all modules
:
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
modules
...
...
kernel/spec-fmc.c
View file @
f4432bc8
...
...
@@ -184,6 +184,7 @@ int spec_fmc_create(struct spec_dev *spec)
ret
=
fmc_device_register
(
fmc
);
if
(
ret
)
goto
out_irq
;
spec_gpio_init
(
fmc
);
/* May fail, we don't care */
return
ret
;
out_irq:
...
...
@@ -196,6 +197,7 @@ out_free:
void
spec_fmc_destroy
(
struct
spec_dev
*
spec
)
{
spec_gpio_exit
(
spec
->
fmc
);
fmc_device_unregister
(
spec
->
fmc
);
spec_irq_exit
(
spec
->
fmc
);
spec_i2c_exit
(
spec
->
fmc
);
...
...
kernel/spec-gpio-no.c
0 → 100644
View file @
f4432bc8
#include <linux/kernel.h>
#include <linux/fmc.h>
#include "spec.h"
/*
* If the host computer has no gpiolib, this default will apply
*/
int
__weak
spec_gpio_init
(
struct
fmc_device
*
fmc
)
{
printk
(
"%s - %s
\n
"
,
__FILE__
,
__func__
);
return
0
;
}
void
__weak
spec_gpio_exit
(
struct
fmc_device
*
fmc
)
{
printk
(
"%s - %s
\n
"
,
__FILE__
,
__func__
);
}
kernel/spec-gpio.c
0 → 100644
View file @
f4432bc8
#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/fmc.h>
#include "spec.h"
int
spec_gpio_init
(
struct
fmc_device
*
fmc
)
{
printk
(
"%%s - %s
\n
"
,
__FILE__
,
__func__
);
}
void
spec_gpio_exit
(
struct
fmc_device
*
fmc
)
{
printk
(
"%s - %s
\n
"
,
__FILE__
,
__func__
);
}
kernel/spec.h
View file @
f4432bc8
...
...
@@ -13,6 +13,7 @@
#include <linux/firmware.h>
#include <linux/completion.h>
#include <linux/fmc.h>
#include <linux/gpio.h>
#define PCI_VENDOR_ID_CERN 0x10dc
#define PCI_DEVICE_ID_SPEC 0x018d
...
...
@@ -35,6 +36,7 @@ struct spec_dev {
struct
fmc_device
*
fmc
;
int
irq_count
;
/* for mezzanine use too */
struct
completion
compl
;
struct
gpio_chip
*
gpio
;
};
/* Registers for GN4124 access */
...
...
@@ -118,9 +120,13 @@ static inline void gennum_mask_val(struct spec_dev *spec,
extern
int
spec_fmc_create
(
struct
spec_dev
*
spec
);
extern
void
spec_fmc_destroy
(
struct
spec_dev
*
spec
);
/* Function in spec-i2c.c, used by spec-fmc.c */
/* Function
s
in spec-i2c.c, used by spec-fmc.c */
extern
int
spec_i2c_init
(
struct
fmc_device
*
fmc
);
extern
void
spec_i2c_exit
(
struct
fmc_device
*
fmc
);
/* Functions in spec-gpio.c */
extern
int
spec_gpio_init
(
struct
fmc_device
*
fmc
);
extern
void
spec_gpio_exit
(
struct
fmc_device
*
fmc
);
#endif
/* __SPEC_H__ */
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