Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - 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 DEL 1ns 4cha - Software
Commits
d3b5c66f
Commit
d3b5c66f
authored
Apr 30, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fd-zio: better reading, still not stable
parent
1a2f76a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
fd-zio.c
fd-zio.c
+22
-10
fine-delay.h
fine-delay.h
+2
-1
No files found.
fd-zio.c
View file @
d3b5c66f
...
...
@@ -103,12 +103,16 @@ static void fd_timer_fn(unsigned long arg)
}
/* FIXME: manage an array of input samples */
if
(
!
test_bit
(
FD_FLAG_INPUT_READY
,
&
fd
->
flags
))
goto
out
;
/* there is an active block, try reading fifo */
if
(
fd_read_fifo
(
fd
,
chan
)
==
0
)
{
if
(
chan
->
active_block
)
chan
->
cset
->
trig
->
t_op
->
data_done
(
chan
->
cset
);
else
pr_err
(
"data and no block
\n
"
);
printk
(
"%s: reading %p
\n
"
,
__func__
,
chan
->
active_block
);
clear_bit
(
FD_FLAG_INPUT_READY
,
&
fd
->
flags
);
chan
->
cset
->
trig
->
t_op
->
data_done
(
chan
->
cset
);
}
out:
mod_timer
(
&
fd
->
timer
,
jiffies
+
fd_timer_period_jiffies
);
}
...
...
@@ -121,26 +125,34 @@ static int fd_output(struct zio_cset *cset)
}
/*
* The input method
will
return immediately, because input is
* The input method
may
return immediately, because input is
* asynchronous. The data_done callback is invoked when the block is
* full.
*/
static
int
fd_input
(
struct
zio_cset
*
cset
)
{
struct
spec_fd
*
fd
;
__HACK__ZDEV__
=
cset
->
zdev
;
fd
=
__HACK__FD__
;
/* Configure the device for input */
if
(
!
test_bit
(
FD_FLAG_INPUT
,
&
fd
->
flags
))
{
if
(
!
test_bit
(
FD_FLAG_
DO_
INPUT
,
&
fd
->
flags
))
{
fd_writel
(
fd
,
FD_TSBCR_PURGE
|
FD_TSBCR_RST_SEQ
,
FD_REG_TSBCR
);
fd_writel
(
fd
,
FD_TSBCR_CHAN_MASK_W
(
1
)
|
FD_TSBCR_ENABLE
,
FD_REG_TSBCR
);
set_bit
(
FD_FLAG_INPUT
,
&
fd
->
flags
);
set_bit
(
FD_FLAG_
DO_
INPUT
,
&
fd
->
flags
);
}
return
-
EAGAIN
;
/* Will be completed over time */
/* Ready for input. If there's already something, return it now */
if
(
fd_read_fifo
(
fd
,
cset
->
chan
)
==
0
)
{
printk
(
"%s: returning now %p
\n
"
,
__func__
,
cset
->
chan
->
active_block
);
cset
->
trig
->
t_op
->
data_done
(
cset
);
return
0
;
}
/* Mark the active block is valid, and return EAGAIN */
set_bit
(
FD_FLAG_INPUT_READY
,
&
fd
->
flags
);
printk
(
"%s: set bit
\n
"
,
__func__
);
return
-
EAGAIN
;
}
/* We have 5 csets, since each output triggers separately */
...
...
fine-delay.h
View file @
d3b5c66f
...
...
@@ -64,7 +64,8 @@ struct spec_fd {
/* We act on flags using atomic ops, so flag is the number, not the mask */
enum
fd_flags
{
FD_FLAG_INITED
=
0
,
FD_FLAG_INPUT
FD_FLAG_DO_INPUT
,
FD_FLAG_INPUT_READY
,
};
/* Internal time: the first three fields should be converted to zio time */
...
...
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