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
37550d62
Commit
37550d62
authored
Feb 04, 2013
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc-adc.h: move overflow_detection helper in fmc-adc.h
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
f17ab569
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
20 deletions
+29
-20
fa-zio-trg.c
kernel/fa-zio-trg.c
+0
-18
fmc-adc.h
kernel/fmc-adc.h
+29
-2
No files found.
kernel/fa-zio-trg.c
View file @
37550d62
...
...
@@ -83,25 +83,7 @@ static struct zio_attribute zfat_ext_zattr[] = {
ZIO_PARAM_EXT
(
"tstamp-trg-lst-b"
,
ZIO_RO_PERM
,
ZFA_UTC_TRIG_FINE
,
0
),
};
static
int
zfat_overflow_detection
(
struct
zio_ti
*
ti
,
unsigned
int
addr
,
uint32_t
val
)
{
struct
zio_attribute
*
ti_zattr
=
ti
->
zattr_set
.
std_zattr
;
uint32_t
pre_t
,
post_t
,
nshot_t
;
if
(
!
addr
)
return
0
;
pre_t
=
addr
==
ZFAT_PRE
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_PRE_SAMP
].
value
;
post_t
=
addr
==
ZFAT_POST
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_POST_SAMP
].
value
;
nshot_t
=
addr
==
ZFAT_SHOTS_NB
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_REENABLE
].
value
+
1
;
if
(((
pre_t
+
post_t
)
*
ti
->
cset
->
ssize
*
nshot_t
)
>=
FA_MAX_ACQ_BYTE
)
{
dev_err
(
&
ti
->
head
.
dev
,
"cannot acquire, device memory overflow
\n
"
);
return
-
ENOMEM
;
}
return
0
;
}
/* 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
)
...
...
kernel/fmc-adc.h
View file @
37550d62
...
...
@@ -293,6 +293,35 @@ enum zfat_irq {
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>
extern
struct
zio_trigger_type
zfat_type
;
static
inline
int
zfat_overflow_detection
(
struct
zio_ti
*
ti
,
unsigned
int
addr
,
uint32_t
val
)
{
struct
zio_attribute
*
ti_zattr
=
ti
->
zattr_set
.
std_zattr
;
uint32_t
pre_t
,
post_t
,
nshot_t
;
size_t
size
;
if
(
!
addr
)
return
0
;
pre_t
=
addr
==
ZFAT_PRE
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_PRE_SAMP
].
value
;
post_t
=
addr
==
ZFAT_POST
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_POST_SAMP
].
value
;
if
(
ti
->
cset
->
trig
!=
&
zfat_type
)
nshot_t
=
1
;
/* with any other trigger work in one-shot mode */
else
nshot_t
=
addr
==
ZFAT_SHOTS_NB
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_N_SHOTS
].
value
;
size
=
((
pre_t
+
post_t
)
*
ti
->
cset
->
ssize
*
nshot_t
)
*
(
ti
->
cset
->
n_chan
-
1
);
if
(
size
>=
FA_MAX_ACQ_BYTE
)
{
dev_err
(
&
ti
->
head
.
dev
,
"cannot acquire, device memory overflow
\n
"
);
return
-
ENOMEM
;
}
return
0
;
}
static
inline
struct
fa_dev
*
get_zfadc
(
struct
device
*
dev
)
{
switch
(
to_zio_head
(
dev
)
->
zobj_type
)
{
...
...
@@ -346,8 +375,6 @@ static inline void zfa_common_info_get(struct fa_dev *fa,
*
usr_val
=
zio_get_field
(
&
zfad_regs
[
index
],
cur
);
}
extern
struct
zio_trigger_type
zfat_type
;
/* Functions exported by fa-zio.c */
extern
int
fa_zio_register
(
void
);
...
...
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