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
78c43fbf
Commit
78c43fbf
authored
Jul 02, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: endian-convert EEPROM calibration data
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
53dc6acd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
fa-zio-drv.c
kernel/fa-zio-drv.c
+13
-3
No files found.
kernel/fa-zio-drv.c
View file @
78c43fbf
...
...
@@ -4,8 +4,6 @@
*
* Driver for the mezzanine ADC for the SPEC
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
...
...
@@ -21,6 +19,8 @@
#include <linux/zio-buffer.h>
#include <linux/zio-trigger.h>
#include <asm/byteorder.h>
#include "fmc-adc.h"
int
enable_auto_start
=
0
;
...
...
@@ -28,7 +28,6 @@ static int enable_test_data = 0;
module_param
(
enable_test_data
,
int
,
0444
);
/*
* zio device attributes
*/
...
...
@@ -1037,6 +1036,16 @@ static void zfad_verify_calib(struct device *msgdev,
}
}
static
void
zfad_endian_calib
(
struct
fa_calib
*
calib
)
{
int
i
;
uint16_t
*
p
=
(
void
*
)
calib
;
/* We know for sure that our structure is only made of 16bit fields */
for
(
i
=
0
;
i
<
sizeof
(
*
calib
)
/
sizeof
(
uint16_t
);
i
++
)
le16_to_cpus
(
p
+
i
);
/* s == in situ */
}
/* * * * * * * * * * * * * * * * Initialization * * * * * * * * * * * * * * */
/*
...
...
@@ -1057,6 +1066,7 @@ static int zfad_zio_probe(struct zio_device *zdev)
/* Retrieve calibration data from the eeprom, then verify it */
memcpy
(
&
fa
->
calib
,
fa
->
fmc
->
eeprom
+
FA_CAL_OFFSET
,
sizeof
(
fa
->
calib
));
zfad_endian_calib
(
&
fa
->
calib
);
zfad_verify_calib
(
&
fa
->
fmc
->
dev
,
&
fa
->
calib
,
&
fa_identity_calib
);
/* Configure GPIO for IRQ */
...
...
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