Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
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 ADC 100M 14b 4cha - Software
Commits
70ed4d5f
Commit
70ed4d5f
authored
Apr 17, 2013
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adc: more debug messages
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
df92f628
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
fa-zio-drv.c
kernel/fa-zio-drv.c
+9
-2
fa-zio-trg.c
kernel/fa-zio-trg.c
+9
-3
No files found.
kernel/fa-zio-drv.c
View file @
70ed4d5f
...
...
@@ -405,7 +405,8 @@ static int zfad_apply_user_offset(struct fa_dev *fa, struct zio_channel *chan,
/* Get calibration offset and gain for DAC */
offset
=
fa
->
dac_cal_data
[
range
].
offset
[
chan
->
index
];
gain
=
fa
->
dac_cal_data
[
range
].
gain
[
chan
->
index
];
dev_dbg
(
&
chan
->
head
.
dev
,
"Appling offset (%d, 0x%x, 0x%x, 0x%x)
\n
"
,
chan
->
index
,
range
,
gain
,
offset
);
/* Calculate calibrater value for DAC */
cal_val
=
((((
usr_val
-
0x8000
+
offset
)
<<
15
)
*
gain
)
>>
30
);
cal_val
+=
0x8000
;
...
...
@@ -448,6 +449,8 @@ static int zfad_conf_set(struct device *dev, struct zio_attribute *zattr,
struct
fa_dev
*
fa
=
get_zfadc
(
dev
);
int
i
,
err
,
reg_index
;
dev_dbg
(
dev
,
"Writing %d in the sysfs attribute %s
\n
"
,
usr_val
,
zattr
->
attr
.
attr
.
name
);
reg_index
=
zattr
->
id
;
i
=
fa
->
zdev
->
cset
->
n_chan
-
1
;
/* -1 because of interleaved channel */
switch
(
reg_index
)
{
...
...
@@ -560,7 +563,8 @@ static int zfad_info_get(struct device *dev, struct zio_attribute *zattr,
}
zfa_common_info_get
(
fa
,
reg_index
,
usr_val
);
dev_dbg
(
dev
,
"Reading %d from the sysfs attribute %s (%d)
\n
"
,
*
usr_val
,
zattr
->
attr
.
attr
.
name
,
reg_index
);
return
0
;
}
static
const
struct
zio_sysfs_operations
zfad_s_op
=
{
...
...
@@ -832,6 +836,9 @@ static void zfat_irq_trg_fire(struct zio_cset *cset)
/* translate from sample count to memory offset */
fixed_mem_ptr
=
(
trg_pos
-
pre_samp
)
*
cset
->
ssize
;
fixed_mem_ptr
*=
cset
->
n_chan
;
dev_dbg
(
fa
->
fmc
->
hwdev
,
"Trigger position: %i samples %i bytes
\n
"
,
trg_pos
,
fixed_mem_ptr
);
zfad_block
[
fa
->
n_fires
].
dev_mem_ptr
=
fixed_mem_ptr
;
}
...
...
kernel/fa-zio-trg.c
View file @
70ed4d5f
...
...
@@ -90,6 +90,8 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
uint32_t
tmp_val
=
usr_val
;
int
err
=
0
;
dev_dbg
(
dev
,
"Writing %d in the sysfs attribute %s
\n
"
,
usr_val
,
zattr
->
attr
.
attr
.
name
);
switch
(
zattr
->
id
)
{
case
ZFAT_SHOTS_NB
:
if
(
!
tmp_val
)
{
...
...
@@ -136,6 +138,9 @@ static int zfat_info_get(struct device *dev, struct zio_attribute *zattr,
zfa_common_info_get
(
fa
,
zattr
->
id
,
usr_val
);
dev_dbg
(
dev
,
"Reading %d from the sysfs attribute %s
\n
"
,
*
usr_val
,
zattr
->
attr
.
attr
.
name
);
return
0
;
}
static
const
struct
zio_sysfs_operations
zfat_s_op
=
{
...
...
@@ -221,7 +226,7 @@ static int zfat_data_done(struct zio_cset *cset)
struct
fa_dev
*
fa
=
cset
->
zdev
->
priv_d
;
unsigned
int
i
;
dev_dbg
(
fa
->
fmc
->
hw
dev
,
"Data done
\n
"
);
dev_dbg
(
&
cset
->
head
.
dev
,
"Data done
\n
"
);
/* Nothing to store */
if
(
!
zfad_block
)
...
...
@@ -230,11 +235,11 @@ static int zfat_data_done(struct zio_cset *cset)
/* Store blocks */
for
(
i
=
0
;
i
<
fa
->
n_shots
;
++
i
)
if
(
likely
(
i
<
fa
->
n_fires
))
{
/* Store filled blocks */
dev_dbg
(
fa
->
fmc
->
hw
dev
,
"Store Block %i/%i
\n
"
,
dev_dbg
(
&
cset
->
head
.
dev
,
"Store Block %i/%i
\n
"
,
i
+
1
,
fa
->
n_shots
);
bi
->
b_op
->
store_block
(
bi
,
zfad_block
[
i
].
block
);
}
else
{
/* Free un-filled blocks */
dev_dbg
(
fa
->
fmc
->
hw
dev
,
"Free un-acquired block %d/%d "
dev_dbg
(
&
cset
->
head
.
dev
,
"Free un-acquired block %d/%d "
"(received %d shots)
\n
"
,
i
+
1
,
fa
->
n_shots
,
fa
->
n_fires
);
bi
->
b_op
->
free_block
(
bi
,
zfad_block
[
i
].
block
);
...
...
@@ -297,6 +302,7 @@ static int zfat_arm_trigger(struct zio_ti *ti)
dev_mem_ptr
=
0
;
/* Allocate ZIO blocks */
for
(
i
=
0
;
i
<
fa
->
n_shots
;
++
i
)
{
dev_dbg
(
&
ti
->
cset
->
head
.
dev
,
"Allocating block %d ...
\n
"
,
i
);
block
=
zbuf
->
b_op
->
alloc_block
(
interleave
->
bi
,
size
,
GFP_ATOMIC
);
if
(
!
block
)
{
...
...
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