Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
White Rabbit Trigger Distribution
Commits
0c081bed
Commit
0c081bed
authored
Sep 24, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: add possibility to not load FD/TDC
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
105b23b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
30 deletions
+68
-30
wrtd-ref-svec-tdc-fd-core.c
software/drivers/wrtd-ref-svec-tdc-fd-core.c
+68
-30
No files found.
software/drivers/wrtd-ref-svec-tdc-fd-core.c
View file @
0c081bed
...
...
@@ -5,9 +5,15 @@
*/
#include <linux/module.h>
#include<linux/moduleparam.h>
#include <linux/platform_device.h>
#include <linux/mfd/core.h>
static
char
*
drivers
=
""
;
module_param
(
drivers
,
charp
,
0444
);
MODULE_PARM_DESC
(
drivers
,
"Extra drivers to load: fd (fmc-fine-delay), tdc (fmc-tdc), fdtdc (fmc-fine-delay and fmc-tdc)
\n
"
);
enum
wrtd_stf_dev_offsets
{
WRTD_STF_FDT_MEM_START
=
0x00006000
,
WRTD_STF_FDT_MEM_END
=
0x000061FF
,
...
...
@@ -18,11 +24,6 @@ enum wrtd_stf_dev_offsets {
};
/* MFD devices */
enum
spec_fpga_mfd_devs_enum
{
WRTD_STF_MFD_TRTL
=
0
,
WRTD_STF_MFD_FDT
,
WRTD_STF_MFD_TDC
,
};
static
struct
resource
wrtd_stf_fdt_res
[]
=
{
{
...
...
@@ -77,30 +78,67 @@ static struct resource wrtd_stf_trtl_res[] = {
},
};
static
const
struct
mfd_cell
wrtd_stf_mfd_devs
[]
=
{
[
WRTD_STF_MFD_TRTL
]
=
{
.
name
=
"mock-turtle"
,
.
platform_data
=
NULL
,
.
pdata_size
=
0
,
.
num_resources
=
ARRAY_SIZE
(
wrtd_stf_trtl_res
),
.
resources
=
wrtd_stf_trtl_res
,
},
[
WRTD_STF_MFD_FDT
]
=
{
.
name
=
"fmc-fdelay-tdc"
,
.
platform_data
=
NULL
,
.
pdata_size
=
0
,
.
num_resources
=
ARRAY_SIZE
(
wrtd_stf_fdt_res
),
.
resources
=
wrtd_stf_fdt_res
,
},
[
WRTD_STF_MFD_TDC
]
=
{
.
name
=
"fmc-tdc"
,
.
platform_data
=
NULL
,
.
pdata_size
=
0
,
.
num_resources
=
ARRAY_SIZE
(
wrtd_stf_tdc_res
),
.
resources
=
wrtd_stf_tdc_res
,
},
#define MFD_CELL_TRTL { \
.name = "mock-turtle", \
.platform_data = NULL, \
.pdata_size = 0, \
.num_resources = ARRAY_SIZE(wrtd_stf_trtl_res), \
.resources = wrtd_stf_trtl_res, \
}
#define MFD_CELL_FDT { \
.name = "fmc-fdelay-tdc", \
.platform_data = NULL, \
.pdata_size = 0, \
.num_resources = ARRAY_SIZE(wrtd_stf_fdt_res), \
.resources = wrtd_stf_fdt_res, \
}
#define MFD_CELL_TDC { \
.name = "fmc-tdc", \
.platform_data = NULL, \
.pdata_size = 0, \
.num_resources = ARRAY_SIZE(wrtd_stf_tdc_res), \
.resources = wrtd_stf_tdc_res, \
}
static
const
struct
mfd_cell
__wrtd_stf_mfd_devs_base
[]
=
{
MFD_CELL_TRTL
,
};
static
const
struct
mfd_cell
__wrtd_stf_mfd_devs_fdt
[]
=
{
MFD_CELL_TRTL
,
MFD_CELL_FDT
,
};
static
const
struct
mfd_cell
__wrtd_stf_mfd_devs_tdc
[]
=
{
MFD_CELL_TRTL
,
MFD_CELL_TDC
,
};
static
const
struct
mfd_cell
__wrtd_stf_mfd_devs_fdtdc
[]
=
{
MFD_CELL_TRTL
,
MFD_CELL_FDT
,
MFD_CELL_TDC
,
};
static
const
struct
mfd_cell
*
wrtd_stf_mfd_cells
(
const
char
*
extra
)
{
if
(
strncmp
(
"fdtdc"
,
extra
,
5
)
==
0
)
return
__wrtd_stf_mfd_devs_fdtdc
;
else
if
(
strncmp
(
"tdc"
,
extra
,
3
)
==
0
)
return
__wrtd_stf_mfd_devs_tdc
;
else
if
(
strncmp
(
"fd"
,
extra
,
2
)
==
0
)
return
__wrtd_stf_mfd_devs_fdt
;
else
return
__wrtd_stf_mfd_devs_base
;
}
static
unsigned
int
wrtd_stf_mfd_count
(
const
char
*
extra
)
{
int
count
=
1
;
if
(
strncmp
(
"fd"
,
extra
,
2
)
==
0
)
count
++
;
if
(
strncmp
(
"tdc"
,
extra
,
3
)
==
0
||
strncmp
(
"fdtdc"
,
extra
,
5
)
==
0
)
count
++
;
return
count
;
}
static
int
wrtd_stf_probe
(
struct
platform_device
*
pdev
)
{
...
...
@@ -126,8 +164,8 @@ static int wrtd_stf_probe(struct platform_device *pdev)
*/
return
mfd_add_devices
(
&
pdev
->
dev
,
PLATFORM_DEVID_AUTO
,
wrtd_stf_mfd_
devs
,
ARRAY_SIZE
(
wrtd_stf_mfd_dev
s
),
wrtd_stf_mfd_
cells
(
drivers
)
,
wrtd_stf_mfd_count
(
driver
s
),
rmem
,
irq
,
NULL
);
}
...
...
@@ -176,4 +214,4 @@ MODULE_VERSION(DRV_VERSION);
MODULE_DESCRIPTION
(
"Driver for the WRTD SVEC TDC Fine-Delay"
);
MODULE_DEVICE_TABLE
(
platform
,
wrtd_stf_id_table
);
MODULE_SOFTDEP
(
"pre: svec_fmc_carrier mockturtle
fmc-fine-delay fmc-tdc
"
);
MODULE_SOFTDEP
(
"pre: svec_fmc_carrier mockturtle"
);
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