Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC Bus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC Bus
Commits
8ba6b1be
Commit
8ba6b1be
authored
Aug 02, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reprogram is complete and cast in stone
parent
f0ea7350
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
fmc-trivial.c
kernel/fmc-trivial.c
+7
-6
fmc.h
kernel/include/linux/fmc.h
+5
-4
No files found.
kernel/fmc-trivial.c
View file @
8ba6b1be
...
...
@@ -5,9 +5,6 @@
#include <linux/fmc.h>
#include "spec.h"
static
char
*
t_filename
;
module_param_named
(
file
,
t_filename
,
charp
,
0444
);
static
struct
fmc_driver
t_drv
;
/* initialized later */
irqreturn_t
t_handler
(
int
irq
,
void
*
dev_id
)
...
...
@@ -32,8 +29,10 @@ int t_probe(struct fmc_device *fmc)
if
(
ret
<
0
)
return
ret
;
/* Reprogram, but only if specified in the arguments */
ret
=
fmc
->
op
->
reprogram
(
fmc
,
""
);
/* Reprogram, if asked to. ESRCH == no filename specified */
ret
=
fmc
->
op
->
reprogram
(
fmc
,
&
t_drv
,
""
);
if
(
ret
==
-
ESRCH
)
ret
=
0
;
if
(
ret
<
0
)
fmc
->
op
->
irq_free
(
fmc
);
...
...
@@ -54,7 +53,9 @@ static struct fmc_driver t_drv = {
/* no table, as the current match just matches everything */
};
FMC_MODULE_PARAMS
(
t_drv
);
/* We accept the generic parameters */
/* We accept the generic parameters */
FMC_PARAM_BUSID
(
t_drv
);
FMC_PARAM_GATEWARE
(
t_drv
);
static
int
t_init
(
void
)
{
...
...
kernel/include/linux/fmc.h
View file @
8ba6b1be
...
...
@@ -40,16 +40,17 @@ struct fmc_driver {
#define to_fmc_driver(x) container_of((x), struct fmc_driver, driver)
/* These are the generic parameters, that drivers may instantiate */
#define FMC_MODULE_PARAMS(_d) \
module_param_array_named(busid, _d.busid_val, int, &_d.busid_n, 0400); \
module_param_array_named(gateware, _d.gw_val, charp, &_d.gw_n, 0400)
#define FMC_PARAM_BUSID(_d) \
module_param_array_named(busid, _d.busid_val, int, &_d.busid_n, 0444)
#define FMC_PARAM_GATEWARE(_d) \
module_param_array_named(gateware, _d.gw_val, charp, &_d.gw_n, 0444)
/* To be carrier-independent, we need to abstract hardware access */
struct
fmc_operations
{
uint32_t
(
*
readl
)(
struct
fmc_device
*
fmc
,
int
offset
);
void
(
*
writel
)(
struct
fmc_device
*
fmc
,
uint32_t
value
,
int
offset
);
int
(
*
validate
)(
struct
fmc_device
*
fmc
,
struct
fmc_driver
*
drv
);
int
(
*
reprogram
)(
struct
fmc_device
*
f
mc
,
char
*
gateware
);
int
(
*
reprogram
)(
struct
fmc_device
*
f
,
struct
fmc_driver
*
d
,
char
*
gw
);
int
(
*
irq_request
)(
struct
fmc_device
*
fmc
,
irq_handler_t
h
,
char
*
name
,
int
flags
);
void
(
*
irq_ack
)(
struct
fmc_device
*
fmc
);
...
...
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