Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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 - Software
Commits
abb2cabe
Commit
abb2cabe
authored
Aug 06, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv: add temperature to the calibration timer
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
f9e6eb04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
fa-calibration.c
kernel/fa-calibration.c
+14
-11
No files found.
kernel/fa-calibration.c
View file @
abb2cabe
...
...
@@ -62,30 +62,30 @@ static void fa_calib_offset_set(struct fa_dev *fa, unsigned int chan, int val)
val
&
0xFFFF
/* prevent warning */
);
}
static
int
fa_calib_adc_offset_fix
(
struct
fa_dev
*
fa
,
int
range
,
int
offset
)
static
int
fa_calib_adc_offset_fix
(
struct
fa_dev
*
fa
,
int
range
,
int
offset
,
uint32_t
temperature
)
{
return
offset
;
}
static
int
fa_calib_adc_gain_fix
(
struct
fa_dev
*
fa
,
int
range
,
int
gain
)
static
int
fa_calib_adc_gain_fix
(
struct
fa_dev
*
fa
,
int
range
,
int
gain
,
uint32_t
temperature
)
{
return
gain
;
}
static
void
fa_calib_adc_config_chan
(
struct
fa_dev
*
fa
,
unsigned
int
chan
)
static
void
fa_calib_adc_config_chan
(
struct
fa_dev
*
fa
,
unsigned
int
chan
,
uint32_t
temperature
)
{
int
range
=
fa
->
range
[
chan
];
int
offset
=
fa
->
calib
.
adc
[
range
].
offset
[
chan
];
int
gain
=
fa
->
calib
.
adc
[
range
].
gain
[
chan
];
dev_dbg
(
&
fa
->
pdev
->
dev
,
"%s: orig: {range: %d, gain: 0x%x, offset: 0x%x}
\n
"
,
__func__
,
range
,
gain
,
offset
);
offset
=
fa_calib_adc_offset_fix
(
fa
,
range
,
offset
,
temperature
);
gain
=
fa_calib_adc_gain_fix
(
fa
,
range
,
gain
,
temperature
);
offset
=
fa_calib_adc_offset_fix
(
fa
,
range
,
offset
);
gain
=
fa_calib_adc_gain_fix
(
fa
,
range
,
gain
);
dev_dbg
(
&
fa
->
pdev
->
dev
,
"%s: fixed: {range: %d, gain: 0x%x, offset: 0x%x}
\n
"
,
__func__
,
range
,
gain
,
offset
);
dev_dbg
(
&
fa
->
pdev
->
dev
,
"%s: {chan: %d, range: %d, gain: 0x%x, offset: 0x%x}
\n
"
,
__func__
,
chan
,
range
,
gain
,
offset
);
fa_calib_gain_set
(
fa
,
chan
,
gain
);
fa_calib_offset_set
(
fa
,
chan
,
offset
);
...
...
@@ -94,9 +94,12 @@ static void fa_calib_adc_config_chan(struct fa_dev *fa, unsigned int chan)
int
fa_calib_adc_config
(
struct
fa_dev
*
fa
)
{
int
i
;
uint32_t
temperature
;
temperature
=
fa_temperature_read
(
fa
);
dev_dbg
(
&
fa
->
pdev
->
dev
,
"%s: {temperature: %d}
\n
"
,
__func__
,
temperature
);
for
(
i
=
0
;
i
<
FA100M14B4C_NCHAN
;
++
i
)
fa_calib_adc_config_chan
(
fa
,
i
);
fa_calib_adc_config_chan
(
fa
,
i
,
temperature
);
return
fa_calib_apply
(
fa
);
}
...
...
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