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
ebf39881
Commit
ebf39881
authored
Apr 18, 2014
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: default calibration parameters on EEPROM redaout failure
parent
05f9063b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
calibration.c
kernel/calibration.c
+16
-13
No files found.
kernel/calibration.c
View file @
ebf39881
...
...
@@ -69,19 +69,22 @@ int ft_handle_eeprom_calibration(struct fmctdc_dev *ft)
memcpy
(
calib
,
&
default_calibration
,
sizeof
(
struct
ft_calibration
));
i
=
ft_read_calibration_eeprom
(
ft
->
fmc
,
raw_calib
,
sizeof
(
raw_calib
));
/* fixme: there is no calibration validation. Change format? */
/* Translate offsets (they are referenced to channel 0 and in 1/100s of picosecond) to
offsets that could be added to TDC timestamps right away (picoseconds, referenced to WR) */
calib
->
zero_offset
[
0
]
=
0
;
for
(
i
=
FT_CH_1
+
1
;
i
<
FT_NUM_CHANNELS
;
i
++
)
calib
->
zero_offset
[
i
]
=
le32_to_cpu
(
raw_calib
[
i
-
1
])
/
100
-
calib
->
zero_offset
[
0
];
calib
->
vcxo_default_tune
=
le32_to_cpu
(
raw_calib
[
4
]);
if
(
i
<
0
)
{
dev_err
(
d
,
"Failed to read the calibration EEPROM. Using default calibration parameters.
\n
"
);
for
(
i
=
0
;
i
<
FT_NUM_CHANNELS
;
i
++
)
calib
->
zero_offset
[
i
]
=
0
;
calib
->
vcxo_default_tune
=
32000
;
}
else
{
calib
->
zero_offset
[
0
]
=
0
;
for
(
i
=
FT_CH_1
+
1
;
i
<
FT_NUM_CHANNELS
;
i
++
)
calib
->
zero_offset
[
i
]
=
le32_to_cpu
(
raw_calib
[
i
-
1
])
/
100
-
calib
->
zero_offset
[
0
];
calib
->
vcxo_default_tune
=
le32_to_cpu
(
raw_calib
[
4
]);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
calib
->
zero_offset
);
i
++
)
dev_info
(
d
,
"calib: zero_offset[%i] = %li
\n
"
,
i
,
(
long
)
calib
->
zero_offset
[
i
]);
...
...
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