Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
Commits
3465f98f
Commit
3465f98f
authored
May 09, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fd-zio: handle a negative coarse readout
parent
972b0f68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
fd-zio.c
fd-zio.c
+15
-0
No files found.
fd-zio.c
View file @
3465f98f
...
...
@@ -441,6 +441,19 @@ static int fd_read_fifo(struct spec_fd *fd, struct zio_channel *chan)
t
.
channel
=
FD_TSBR_FID_CHANNEL_R
(
reg
);
t
.
seq_id
=
FD_TSBR_FID_SEQID_R
(
reg
);
/* The coarse count may be negative, because of how it works */
if
(
t
.
coarse
&
(
1
<<
27
))
{
// coarse is 28 bits
printk
(
"%i (%x)
\n
"
,
t
.
coarse
,
t
.
coarse
);
/* we may get 0xfff.ffef..0xffff.ffff -- 125M == 0x773.5940 */
t
.
coarse
+=
125000000
;
t
.
coarse
&=
0xfffffff
;
t
.
utc
--
;
}
else
if
(
t
.
coarse
>
125000000
)
{
printk
(
"%i (%x)
\n
"
,
t
.
coarse
,
t
.
coarse
);
t
.
coarse
-=
125000000
;
t
.
utc
++
;
}
fd_ts_sub
(
&
t
,
fd
->
calib
.
tdc_zero_offset
);
/* The input data is written to attribute values in the active block. */
...
...
@@ -454,6 +467,8 @@ static int fd_read_fifo(struct spec_fd *fd, struct zio_channel *chan)
v
[
FD_ATTR_TDC_CHAN
]
=
t
.
channel
;
v
[
FD_ATTR_TDC_OFFSET
]
=
fd
->
calib
.
tdc_zero_offset
;
__fd_apply_offset
(
v
+
FD_ATTR_TDC_UTC_H
,
fd
->
calib
.
tdc_user_offset
);
/* We also need a copy within the device, so sysfs can read it */
...
...
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