Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - Software
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
FMC TDC 1ns 5cha - Software
Commits
c6be45fb
Commit
c6be45fb
authored
Aug 28, 2012
by
Samuel Iglesias Gonsálvez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdc: added helper functions to the core
Signed-off-by:
Samuel Iglesias Gonsálvez
<
siglesias@igalia.com
>
parent
ec765a55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
tdc-core.c
tdc-core.c
+60
-0
No files found.
tdc-core.c
View file @
c6be45fb
...
...
@@ -39,6 +39,66 @@ static void tdc_fw_reset(struct spec_dev *dev)
mdelay
(
5000
);
}
/* XXX: Check that the value is properly written? */
static
int
tdc_set_utc_time
(
struct
spec_tdc
*
tdc
)
{
u32
utc_time
;
/* TODO: fill the variable with a proper value */
writel
(
utc_time
,
tdc
->
base
+
TDC_START_UTC
);
writel
(
TDC_CTRL_LOAD_UTC
,
tdc
->
base
+
TDC_CTRL_REG
);
return
0
;
}
static
u32
tdc_get_utc_time
(
struct
spec_tdc
*
tdc
)
{
return
readl
(
tdc
->
base
+
TDC_CURRENT_UTC
);
}
/* XXX: void-function or I should check that the value is properly written? */
void
tdc_set_irq_tstamp_thresh
(
struct
spec_tdc
*
tdc
,
u32
val
)
{
writel
(
val
,
tdc
->
base
+
TDC_IRQ_TSTAMP_THRESH
);
}
u32
tdc_get_irq_tstamp_thresh
(
struct
spec_tdc
*
tdc
)
{
return
readl
(
tdc
->
base
+
TDC_IRQ_TSTAMP_THRESH
);
}
/* XXX: void-function or I should check that the value is properly written? */
void
tdc_set_irq_time_thresh
(
struct
spec_tdc
*
tdc
,
u32
val
)
{
writel
(
val
,
tdc
->
base
+
TDC_IRQ_TIME_THRESH
);
}
u32
tdc_get_irq_time_thresh
(
struct
spec_tdc
*
tdc
)
{
return
readl
(
tdc
->
base
+
TDC_IRQ_TIME_THRESH
);
}
/* XXX: void-function or I should check that the value is properly written? */
void
tdc_set_dac_word
(
struct
spec_tdc
*
tdc
,
u32
val
)
{
writel
(
val
,
tdc
->
base
+
TDC_DAC_WORD
);
writel
(
TDC_CTRL_CONFIG_DAC
,
tdc
->
base
+
TDC_CTRL_REG
);
}
void
tdc_clear_da_capo_flag
(
struct
spec_tdc
*
tdc
)
{
writel
(
TDC_CTRL_CLEAR_DACAPO_FLAG
,
tdc
->
base
+
TDC_CTRL_REG
);
}
void
tdc_activate_adquisition
(
struct
spec_tdc
*
tdc
)
{
/* Before activate the adquisition is required to reset the ACAM chip */
tdc_acam_reset
(
tdc
);
writel
(
TDC_CTRL_EN_ACQ
,
tdc
->
base
+
TDC_CTRL_REG
);
}
void
tdc_deactivate_adquisition
(
struct
spec_tdc
*
tdc
)
{
writel
(
TDC_CTRL_DIS_ACQ
,
tdc
->
base
+
TDC_CTRL_REG
);
}
int
tdc_probe
(
struct
spec_dev
*
dev
)
{
...
...
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