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
660db16b
Commit
660db16b
authored
Aug 04, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv: simplify function prototype
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
7fddd3d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
fa-calibration.c
kernel/fa-calibration.c
+1
-1
fa-core.c
kernel/fa-core.c
+7
-7
fa-zio-drv.c
kernel/fa-zio-drv.c
+2
-2
fmc-adc-100m14b4cha.h
kernel/fmc-adc-100m14b4cha.h
+1
-1
No files found.
kernel/fa-calibration.c
View file @
660db16b
...
...
@@ -119,7 +119,7 @@ static void fa_apply_calib(struct fa_dev *fa)
for
(
i
=
0
;
i
<
FA100M14B4C_NCHAN
;
++
i
)
{
struct
zio_channel
*
chan
=
&
fa
->
zdev
->
cset
->
chan
[
i
];
int
reg
=
zfad_get_chx_index
(
ZFA_CHx_CTL_RANGE
,
chan
);
int
reg
=
zfad_get_chx_index
(
ZFA_CHx_CTL_RANGE
,
chan
->
index
);
int
range
=
fa_readl
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
reg
]);
zfad_set_range
(
fa
,
chan
,
range
);
...
...
kernel/fa-core.c
View file @
660db16b
...
...
@@ -88,11 +88,11 @@ int zfad_convert_hw_range(uint32_t bitmask)
}
/* Calculate correct index in fa_regfield array for channel from CHx indexes */
int
zfad_get_chx_index
(
unsigned
long
addr
,
struct
zio_channel
*
chan
)
int
zfad_get_chx_index
(
unsigned
long
addr
,
unsigned
int
chan
)
{
int
offset
;
offset
=
ZFA_CHx_MULT
*
(
FA100M14B4C_NCHAN
-
chan
->
index
);
offset
=
ZFA_CHx_MULT
*
(
FA100M14B4C_NCHAN
-
chan
);
return
addr
-
offset
;
}
...
...
@@ -188,7 +188,7 @@ int zfad_apply_offset(struct zio_channel *chan)
if
(
off_uv
<
-
5000000
||
off_uv
>
5000000
)
return
-
EINVAL
;
i
=
zfad_get_chx_index
(
ZFA_CHx_CTL_RANGE
,
chan
);
i
=
zfad_get_chx_index
(
ZFA_CHx_CTL_RANGE
,
chan
->
index
);
range_reg
=
fa_readl
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
i
]);
range
=
zfad_convert_hw_range
(
range_reg
);
...
...
@@ -251,7 +251,7 @@ int zfad_set_range(struct fa_dev *fa, struct zio_channel *chan,
int
i
,
offset
,
gain
;
/* Actually set the range */
i
=
zfad_get_chx_index
(
ZFA_CHx_CTL_RANGE
,
chan
);
i
=
zfad_get_chx_index
(
ZFA_CHx_CTL_RANGE
,
chan
->
index
);
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
i
],
zfad_hw_range
[
range
]);
if
(
range
==
FA100M14B4C_RANGE_OPEN
||
fa_enable_test_data_adc
)
...
...
@@ -268,10 +268,10 @@ int zfad_set_range(struct fa_dev *fa, struct zio_channel *chan,
offset
=
fa
->
calib
.
adc
[
range
].
offset
[
chan
->
index
];
gain
=
fa
->
calib
.
adc
[
range
].
gain
[
chan
->
index
];
i
=
zfad_get_chx_index
(
ZFA_CHx_OFFSET
,
chan
);
i
=
zfad_get_chx_index
(
ZFA_CHx_OFFSET
,
chan
->
index
);
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
i
],
offset
&
0xffff
/* prevent warning */
);
i
=
zfad_get_chx_index
(
ZFA_CHx_GAIN
,
chan
);
i
=
zfad_get_chx_index
(
ZFA_CHx_GAIN
,
chan
->
index
);
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
i
],
gain
);
/* recalculate user offset for the new range */
...
...
@@ -399,7 +399,7 @@ static int __fa_init(struct fa_dev *fa)
/* Initialize channels to use 1V range */
for
(
i
=
0
;
i
<
4
;
++
i
)
{
addr
=
zfad_get_chx_index
(
ZFA_CHx_CTL_RANGE
,
&
zdev
->
cset
->
chan
[
i
]
);
zdev
->
cset
->
chan
[
i
].
index
);
fa_writel
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
addr
],
FA100M14B4C_RANGE_1V
);
zfad_set_range
(
fa
,
&
zdev
->
cset
->
chan
[
i
],
FA100M14B4C_RANGE_1V
);
...
...
kernel/fa-zio-drv.c
View file @
660db16b
...
...
@@ -398,10 +398,10 @@ static int zfad_info_get(struct device *dev, struct zio_attribute *zattr,
case
ZFA_CHx_CTL_TERM
:
/*fallthrough*/
case
ZFA_CHx_CTL_RANGE
:
reg_index
=
zfad_get_chx_index
(
zattr
->
id
,
to_zio_chan
(
dev
));
reg_index
=
zfad_get_chx_index
(
zattr
->
id
,
to_zio_chan
(
dev
)
->
index
);
break
;
case
ZFA_CHx_STA
:
reg_index
=
zfad_get_chx_index
(
zattr
->
id
,
to_zio_chan
(
dev
));
reg_index
=
zfad_get_chx_index
(
zattr
->
id
,
to_zio_chan
(
dev
)
->
index
);
*
usr_val
=
fa_readl
(
fa
,
fa
->
fa_adc_csr_base
,
&
zfad_regs
[
reg_index
]);
i
=
(
int16_t
)(
*
usr_val
);
/* now signed integer */
...
...
kernel/fmc-adc-100m14b4cha.h
View file @
660db16b
...
...
@@ -601,7 +601,7 @@ extern void zfad_reset_offset(struct fa_dev *fa);
extern
int
zfad_convert_hw_range
(
uint32_t
bitmask
);
extern
int
zfad_set_range
(
struct
fa_dev
*
fa
,
struct
zio_channel
*
chan
,
int
range
);
extern
int
zfad_get_chx_index
(
unsigned
long
addr
,
struct
zio_channel
*
chan
);
extern
int
zfad_get_chx_index
(
unsigned
long
addr
,
unsigned
int
chan
);
extern
int
zfad_pattern_data_enable
(
struct
fa_dev
*
fa
,
uint16_t
pattern
,
unsigned
int
enable
);
...
...
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