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
402787ee
Commit
402787ee
authored
Aug 30, 2021
by
Federico Vaga
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/v5.1.0' into develop
parents
65a535b8
8f2e1d2e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
15 deletions
+58
-15
CHANGELOG.rst
CHANGELOG.rst
+4
-0
fa-calibration.c
software/kernel/fa-calibration.c
+20
-5
fa-core.c
software/kernel/fa-core.c
+28
-1
fa-debug.c
software/kernel/fa-debug.c
+1
-8
fmc-adc-100m14b4cha-private.h
software/kernel/fmc-adc-100m14b4cha-private.h
+5
-1
No files found.
CHANGELOG.rst
View file @
402787ee
...
...
@@ -17,6 +17,10 @@ Fixed
-----
- security fixes detected by flawfinder
Fixed
-----
- sw: improve compatibility with newer ( > 3.10) Linux kernel versions
5.0.4 - 2021-07-09
==================
Fixed
...
...
software/kernel/fa-calibration.c
View file @
402787ee
...
...
@@ -311,6 +311,14 @@ void fa_calib_config(struct fa_dev *fa)
fa_calib_config_chan
(
fa
,
i
,
temperature
,
0
);
spin_unlock
(
&
fa
->
zdev
->
cset
->
lock
);
}
static
void
__fa_calib_gain_update
(
struct
fa_dev
*
fa
)
{
fa_calib_config
(
fa
);
mod_timer
(
&
fa
->
calib_timer
,
jiffies
+
HZ
*
fa_calib_temp_period
);
}
/**
* Periodically update gain calibration values
* @fa: FMC ADC device
...
...
@@ -320,14 +328,17 @@ void fa_calib_config(struct fa_dev *fa)
* linear behavior with respect to the temperature.
*
*/
#if KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE
static
void
fa_calib_gain_update
(
struct
timer_list
*
timer
)
{
__fa_calib_gain_update
(
from_timer
(
fa
,
timer
,
calib_timer
));
}
#else
static
void
fa_calib_gain_update
(
unsigned
long
arg
)
{
struct
fa_dev
*
fa
=
(
void
*
)
arg
;
fa_calib_config
(
fa
);
mod_timer
(
&
fa
->
calib_timer
,
jiffies
+
HZ
*
fa_calib_temp_period
);
__fa_calib_gain_update
((
void
*
)
arg
);
}
#endif
/* Actual verification code */
static
int
fa_verify_calib_stanza
(
struct
device
*
msgdev
,
char
*
name
,
int
r
,
struct
fa_calib_stanza
*
cal
)
...
...
@@ -500,7 +511,11 @@ int fa_calib_init(struct fa_dev *fa)
/* Prepare the timely recalibration */
if
(
fa_calib_is_compensation_on
(
fa
)
&&
fa_calib_temp_period
)
{
#if KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE
timer_setup
(
&
fa
->
calib_timer
,
fa_calib_gain_update
,
0
);
#else
setup_timer
(
&
fa
->
calib_timer
,
fa_calib_gain_update
,
(
unsigned
long
)
fa
);
#endif
mod_timer
(
&
fa
->
calib_timer
,
jiffies
+
HZ
*
fa_calib_temp_period
);
}
...
...
software/kernel/fa-core.c
View file @
402787ee
...
...
@@ -12,6 +12,7 @@
#include <linux/mod_devicetable.h>
#include <uapi/linux/ipmi/fru.h>
#include <linux/fmc.h>
#include <linux/io.h>
#include "fmc-adc-100m14b4cha-private.h"
#include <platform_data/fmc-adc-100m14b4cha.h>
...
...
@@ -36,6 +37,28 @@ static const int zfad_hw_range[] = {
struct
workqueue_struct
*
fa_workqueue
;
static
int
fa_sg_alloc_table_from_pages
(
struct
sg_table
*
sgt
,
struct
page
**
pages
,
unsigned
int
n_pages
,
unsigned
int
offset
,
unsigned
long
size
,
unsigned
int
max_segment
,
gfp_t
gfp_mask
)
{
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
struct
scatterlist
*
sg
;
sg
=
__sg_alloc_table_from_pages
(
sgt
,
pages
,
n_pages
,
offset
,
size
,
max_segment
,
NULL
,
0
,
gfp_mask
);
if
(
IS_ERR
(
sg
))
return
PTR_ERR
(
sg
);
else
return
0
;
#else
return
__sg_alloc_table_from_pages
(
sgt
,
pages
,
n_pages
,
offset
,
size
,
max_segment
,
gfp_mask
);
#endif
}
/**
* Enable/Disable Data Output Randomizer
* @fa: the adc descriptor
...
...
@@ -484,7 +507,11 @@ static void fa_init_timetag(struct fa_dev *fa)
{
unsigned
long
seconds
;
#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
seconds
=
ktime_get_real_seconds
();
#else
seconds
=
get_seconds
();
#endif
fa_writel
(
fa
,
fa
->
fa_utc_base
,
&
zfad_regs
[
ZFA_UTC_SECONDS_U
],
(
seconds
>>
32
)
&
0xFFFFFFFF
);
fa_writel
(
fa
,
fa
->
fa_utc_base
,
&
zfad_regs
[
ZFA_UTC_SECONDS_L
],
...
...
@@ -645,7 +672,7 @@ static void fa_sg_alloc_table_init(struct fa_dev *fa)
if
(
fa_is_flag_set
(
fa
,
FMC_ADC_NOSQUASH_SCATTERLIST
))
fa
->
sg_alloc_table_from_pages
=
sg_alloc_table_from_pages_no_squash
;
else
fa
->
sg_alloc_table_from_pages
=
_
_sg_alloc_table_from_pages
;
fa
->
sg_alloc_table_from_pages
=
fa
_sg_alloc_table_from_pages
;
}
...
...
software/kernel/fa-debug.c
View file @
402787ee
...
...
@@ -301,14 +301,7 @@ int fa_debug_init(struct fa_dev *fa)
fa
->
dbg_reg32
.
regs
=
fa_debugfs_reg32
;
fa
->
dbg_reg32
.
nregs
=
ARRAY_SIZE
(
fa_debugfs_reg32
);
fa
->
dbg_reg32
.
base
=
fa
->
fa_top_level
;
fa
->
dbg_reg
=
debugfs_create_regset32
(
"regs"
,
0444
,
fa
->
dbg_dir
,
&
fa
->
dbg_reg32
);
if
(
IS_ERR_OR_NULL
(
fa
->
dbg_reg
))
{
err
=
PTR_ERR
(
fa
->
dbg_reg
);
dev_warn
(
&
fa
->
pdev
->
dev
,
"Cannot create debugfs file
\"
regs
\"
(%d)
\n
"
,
err
);
}
debugfs_create_regset32
(
"regs"
,
0444
,
fa
->
dbg_dir
,
&
fa
->
dbg_reg32
);
fa
->
dbg_reg_spi
=
debugfs_create_file
(
"spi-regs"
,
0444
,
fa
->
dbg_dir
,
fa
,
...
...
software/kernel/fmc-adc-100m14b4cha-private.h
View file @
402787ee
...
...
@@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/fmc.h>
#include <linux/completion.h>
#include <linux/version.h>
#include <linux/zio.h>
#include <linux/zio-dma.h>
...
...
@@ -64,7 +65,11 @@ enum fa_bus_resource {
};
struct
fa_memory_ops
{
#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE
u32
(
*
read
)(
const
void
*
addr
);
#else
u32
(
*
read
)(
void
*
addr
);
#endif
void
(
*
write
)(
u32
value
,
void
*
addr
);
};
...
...
@@ -336,7 +341,6 @@ struct fa_dev {
struct
dentry
*
dbg_dir
;
struct
debugfs_regset32
dbg_reg32
;
struct
dentry
*
dbg_reg
;
struct
dentry
*
dbg_reg_spi
;
struct
dentry
*
dbg_trg_sw
;
struct
dentry
*
dbg_data_pattern
;
...
...
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