Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha
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 ADC 100M 14b 4cha
Commits
a5f45966
Commit
a5f45966
authored
Feb 16, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: fix trigger compensation
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
9216a866
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
fa-core.c
kernel/fa-core.c
+5
-1
fa-zio-trg.c
kernel/fa-zio-trg.c
+18
-2
fmc-adc-100m14b4cha.h
kernel/fmc-adc-100m14b4cha.h
+2
-0
No files found.
kernel/fa-core.c
View file @
a5f45966
...
...
@@ -374,6 +374,7 @@ static int __fa_init(struct fa_dev *fa)
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
ZFAT_CFG_HW_SEL
],
1
);
zdev
->
cset
->
ti
->
zattr_set
.
ext_zattr
[
FA100M14B4C_TATTR_EXT
].
value
=
1
;
fa
->
trig_compensation
=
FA_CH_TX_DELAY
;
}
else
{
/* Enable Software trigger*/
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
ZFAT_CFG_SW_EN
],
...
...
@@ -381,6 +382,8 @@ static int __fa_init(struct fa_dev *fa)
/* Disable Hardware trigger*/
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
ZFAT_CFG_HW_EN
],
0
);
/* Set default trigger delay */
fa
->
trig_compensation
=
0
;
}
/* Zero offsets and release the DAC clear */
...
...
@@ -398,7 +401,8 @@ static int __fa_init(struct fa_dev *fa)
* Set Trigger delay in order to compensate
* the channel signal transmission delay
*/
fa_writel
(
fa
,
fa
->
fa_utc_base
,
&
zfad_regs
[
ZFAT_DLY
],
FA_CH_TX_DELAY
);
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
ZFAT_DLY
],
fa
->
trig_compensation
);
/* disable auto_start */
fa
->
enable_auto_start
=
0
;
...
...
kernel/fa-zio-trg.c
View file @
a5f45966
...
...
@@ -99,7 +99,7 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
{
struct
fa_dev
*
fa
=
get_zfadc
(
dev
);
struct
zio_ti
*
ti
=
to_zio_ti
(
dev
);
uint32_t
tmp_val
=
usr_val
;
uint32_t
tmp_val
=
usr_val
,
delay
;
switch
(
zattr
->
id
)
{
case
ZFAT_SHOTS_NB
:
...
...
@@ -133,7 +133,18 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
break
;
case
ZFAT_DLY
:
/* Add channel signal transmission delay */
tmp_val
+=
FA_CH_TX_DELAY
;
tmp_val
+=
fa
->
trig_compensation
;
break
;
case
ZFAT_CFG_HW_SEL
:
/* Remove old compensation value */
delay
=
fa_readl
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
ZFAT_DLY
]);
delay
-=
fa
->
trig_compensation
;
/* Calculate and apply new compensation */
fa
->
trig_compensation
=
tmp_val
?
FA_CH_TX_DELAY
:
0
;
delay
+=
fa
->
trig_compensation
;
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
ZFAT_DLY
],
delay
);
break
;
}
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
zattr
->
id
],
tmp_val
);
...
...
@@ -151,6 +162,11 @@ static int zfat_info_get(struct device *dev, struct zio_attribute *zattr,
struct
fa_dev
*
fa
=
get_zfadc
(
dev
);
*
usr_val
=
fa_readl
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
zattr
->
id
]);
switch
(
zattr
->
id
)
{
case
ZFAT_DLY
:
/* Add channel signal transmission delay */
*
usr_val
-=
fa
->
trig_compensation
;
}
return
0
;
}
...
...
kernel/fmc-adc-100m14b4cha.h
View file @
a5f45966
...
...
@@ -359,6 +359,8 @@ struct fa_dev {
/* flag */
int
enable_auto_start
;
uint32_t
trig_compensation
;
};
/*
...
...
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