Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - 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 TDC 1ns 5cha - Software
Commits
f6e36321
Commit
f6e36321
authored
Oct 05, 2012
by
Samuel Iglesias Gonsálvez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdc: fix count calculation
Signed-off-by:
Samuel Iglesias Gonsalvez
<
siglesias@igalia.com
>
parent
3322f47b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
tdc-fmc.c
drivers/tdc-fmc.c
+9
-5
No files found.
drivers/tdc-fmc.c
View file @
f6e36321
...
...
@@ -19,6 +19,9 @@
#include <linux/atomic.h>
#include <linux/semaphore.h>
#include <linux/zio.h>
#include <linux/zio-trigger.h>
#include "spec.h"
#include "tdc.h"
#include "hw/tdc_regs.h"
...
...
@@ -57,9 +60,9 @@ static int tdc_fmc_check_lost_events(u32 curr_wr_ptr, u32 prev_wr_ptr, int *coun
dacapo_prev
=
prev_wr_ptr
>>
12
;
dacapo_curr
=
curr_wr_ptr
>>
12
;
curr_wr_ptr
&=
0x00fff
;
/* Pick last 12 bits */
curr_wr_ptr
>>=
2
;
/* Remove last 4 byte
s. */
curr_wr_ptr
>>=
4
;
/* Remove last 4 bit
s. */
prev_wr_ptr
&=
0x00fff
;
/* Pick last 12 bits */
prev_wr_ptr
>>=
2
;
/* Remove last 4 byte
s. */
prev_wr_ptr
>>=
4
;
/* Remove last 4 bit
s. */
dacapo_diff
=
dacapo_curr
-
dacapo_prev
;
switch
(
dacapo_diff
)
{
...
...
@@ -137,11 +140,11 @@ static void tdc_fmc_irq_work(struct work_struct *work)
/* Start reading in the oldest event */
if
(
count
==
TDC_EVENT_BUFFER_SIZE
)
rd_ptr
=
(
curr_wr_ptr
>>
2
)
&
0x000ff
;
/* The oldest is curr_wr_ptr */
rd_ptr
=
(
curr_wr_ptr
>>
4
)
&
0x000ff
;
/* The oldest is curr_wr_ptr */
else
rd_ptr
=
(
prev_wr_ptr
>>
2
)
&
0x000ff
;
/* The oldest is prev_wr_ptr */
rd_ptr
=
(
prev_wr_ptr
>>
4
)
&
0x000ff
;
/* The oldest is prev_wr_ptr */
pr_err
(
"SIG: %s count %d
\n
"
,
__func__
,
count
);
pr_err
(
"SIG: %s count %d
\n
"
,
__func__
,
count
);
for
(
;
count
>
0
;
count
--
)
{
tmp_data
=
&
events
[
rd_ptr
];
...
...
@@ -160,6 +163,7 @@ static void tdc_fmc_irq_work(struct work_struct *work)
*/
//up(&tdc->event[chan].lock);
rd_ptr
=
(
rd_ptr
+
1
)
%
TDC_EVENT_BUFFER_SIZE
;
//zio_fire_trigger(tdc->hwzdev->cset[chan].ti);
}
dma_out:
...
...
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