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
e5669b8e
Commit
e5669b8e
authored
Aug 03, 2012
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fa-zio-trg.c: update conf_set function to handle pre and post samples
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
5afa79c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
23 deletions
+19
-23
fa-zio-trg.c
fa-zio-trg.c
+19
-23
No files found.
fa-zio-trg.c
View file @
e5669b8e
...
...
@@ -91,27 +91,6 @@ static struct zio_attribute zfat_ext_zattr[] = {
};
/* FIXME: zio need an update, introduce PRE and POST and replace NSAMPLES*/
static
void
zfat_update_nsample
(
struct
zio_ti
*
ti
,
enum
zfadc_dregs_enum
type
,
uint32_t
val
)
{
struct
zio_attribute_set
*
zattr_set
=
&
ti
->
zattr_set
;
struct
zio_attribute
*
n
=
&
zattr_set
->
std_zattr
[
ZATTR_TRIG_NSAMPLES
];
/* 9-th attribute is PRE */
struct
zio_attribute
*
pre
=
&
zattr_set
->
ext_zattr
[
9
];
/* 10-th attribute is POST */
struct
zio_attribute
*
post
=
&
zattr_set
->
ext_zattr
[
10
];
if
(
type
==
ZFAT_PRE
)
n
->
value
=
val
+
post
->
value
;
else
if
(
type
==
ZFAT_POST
)
n
->
value
=
pre
->
value
+
val
;
/*
* FIXME n->value must update current_control. Make propagete_value
* a public function?
*/
}
/* set a value to a FMC-ADC trigger register */
static
int
zfat_conf_set
(
struct
device
*
dev
,
struct
zio_attribute
*
zattr
,
uint32_t
usr_val
)
...
...
@@ -119,6 +98,8 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
const
struct
zio_reg_desc
*
reg
=
&
zfad_regs
[
zattr
->
priv
.
addr
];
struct
zio_ti
*
ti
=
to_zio_ti
(
dev
);
int
err
;
/* These static value are synchronized with the ZIO attribute value */
static
uint32_t
pre_s
=
0
,
post_s
=
0
;
switch
(
zattr
->
priv
.
addr
)
{
case
ZFAT_SW
:
...
...
@@ -142,10 +123,25 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
if
(
err
)
return
err
;
if
(
zattr
->
priv
.
addr
==
ZFAT_PRE
||
zattr
->
priv
.
addr
==
ZFAT_POST
)
{
zfat_update_nsample
(
to_zio_ti
(
dev
),
zattr
->
priv
.
addr
,
usr_val
);
/* Update static value */
if
(
zattr
->
priv
.
addr
==
ZFAT_PRE
)
{
pre_s
=
usr_val
;
}
if
(
zattr
->
priv
.
addr
==
ZFAT_POST
)
{
post_s
=
usr_val
;
}
if
(
zattr
->
priv
.
addr
==
ZFAT_PRE
||
zattr
->
priv
.
addr
==
ZFAT_POST
)
{
/* Check if the acquisition of all required samples is possibile */
if
((
pre_s
+
post_s
)
*
ti
->
cset
->
ssize
>=
FA_MAX_ACQ_BYTE
)
{
dev_warn
(
&
ti
->
cset
->
head
.
dev
,
"you can't acquire more then %i samples"
"(pre-samples = %i, post-samples = %i)."
,
FA_MAX_ACQ_BYTE
/
ti
->
cset
->
ssize
,
pre_s
,
post_s
);
}
}
/* FIXME: zio need an update, introduce PRE and POST and replace NSAMPLES*/
return
0
;
}
/* get the value of a FMC-ADC trigger register */
...
...
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