Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha
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 ADC 100M 14b 4cha
Commits
63ccf423
Commit
63ccf423
authored
Oct 22, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv: handle also calibration ranges
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
23090067
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
fa-core.c
kernel/fa-core.c
+11
-4
fmc-adc-100m14b4cha.h
kernel/fmc-adc-100m14b4cha.h
+4
-1
No files found.
kernel/fa-core.c
View file @
63ccf423
...
...
@@ -25,10 +25,13 @@ int fa_enable_test_data_adc = 0;
module_param_named
(
enable_test_data_adc
,
fa_enable_test_data_adc
,
int
,
0444
);
static
const
int
zfad_hw_range
[]
=
{
[
FA100M14B4C_RANGE_10V
]
=
0x45
,
[
FA100M14B4C_RANGE_1V
]
=
0x11
,
[
FA100M14B4C_RANGE_100mV
]
=
0x23
,
[
FA100M14B4C_RANGE_OPEN
]
=
0x00
,
[
FA100M14B4C_RANGE_10V_CAL
]
=
0x44
,
[
FA100M14B4C_RANGE_1V_CAL
]
=
0x40
,
[
FA100M14B4C_RANGE_100mV_CAL
]
=
0x42
,
[
FA100M14B4C_RANGE_10V
]
=
0x45
,
[
FA100M14B4C_RANGE_1V
]
=
0x11
,
[
FA100M14B4C_RANGE_100mV
]
=
0x23
,
[
FA100M14B4C_RANGE_OPEN
]
=
0x00
,
};
/* fmc-adc specific workqueue */
...
...
@@ -159,6 +162,8 @@ int zfad_apply_offset(struct zio_channel *chan)
if
(
range
==
FA100M14B4C_RANGE_OPEN
||
fa_enable_test_data_adc
)
range
=
FA100M14B4C_RANGE_1V
;
else
if
(
range
>=
FA100M14B4C_RANGE_10V_CAL
)
range
-=
FA100M14B4C_RANGE_10V_CAL
;
hwval
=
zfad_offset_to_dac
(
chan
,
off_uv
,
range
);
return
zfad_dac_set
(
chan
,
hwval
);
...
...
@@ -216,6 +221,8 @@ int zfad_set_range(struct fa_dev *fa, struct zio_channel *chan,
if
(
range
==
FA100M14B4C_RANGE_OPEN
||
fa_enable_test_data_adc
)
range
=
FA100M14B4C_RANGE_1V
;
else
if
(
range
>=
FA100M14B4C_RANGE_10V_CAL
)
range
-=
FA100M14B4C_RANGE_10V_CAL
;
if
(
range
<
0
||
range
>
ARRAY_SIZE
(
fa
->
calib
.
adc
))
{
dev_info
(
fa
->
msgdev
,
"Invalid range %i or ch %i
\n
"
,
...
...
kernel/fmc-adc-100m14b4cha.h
View file @
63ccf423
...
...
@@ -107,7 +107,10 @@ enum fa100m14b4c_input_range {
FA100M14B4C_RANGE_10V
=
0x0
,
FA100M14B4C_RANGE_1V
,
FA100M14B4C_RANGE_100mV
,
FA100M14B4C_RANGE_OPEN
,
/* Channel disconnected from ADC */
FA100M14B4C_RANGE_OPEN
,
/* Channel disconnected from ADC */
FA100M14B4C_RANGE_10V_CAL
,
/* Channel disconnected from ADC */
FA100M14B4C_RANGE_1V_CAL
,
/* Channel disconnected from ADC */
FA100M14B4C_RANGE_100mV_CAL
,
/* Channel disconnected from ADC */
};
enum
fa100m14b4c_fsm_cmd
{
...
...
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