Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
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 DEL 1ns 4cha - Software
Commits
b8fb123f
Commit
b8fb123f
authored
Feb 26, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel/spi: export a vcxo-set function (no technical change)
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
b6d6652a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
fine-delay.h
kernel/fine-delay.h
+2
-0
spi.c
kernel/spi.c
+9
-2
No files found.
kernel/fine-delay.h
View file @
b8fb123f
...
...
@@ -202,6 +202,7 @@ struct fd_dev {
int
temp
;
/* temperature: scaled by 4 bits */
int
temp_ready
;
/* temperature: measurement ready flag */
int
verbose
;
int
current_vcxo_dac
;
uint32_t
tdc_attrs
[
FD_ATTR_TDC__LAST
-
FD_ATTR_DEV__LAST
];
uint16_t
mcp_iodir
,
mcp_olat
;
struct
fd_sw_fifo
sw_fifo
;
...
...
@@ -314,6 +315,7 @@ static inline void __check_output(int x)
/* Functions exported by spi.c */
extern
int
fd_spi_xfer
(
struct
fd_dev
*
fd
,
int
ss
,
int
num_bits
,
uint32_t
in
,
uint32_t
*
out
);
extern
int
fd_spi_set_vcxo
(
struct
fd_dev
*
fd
,
int
vcxo_dac
);
extern
int
fd_spi_init
(
struct
fd_dev
*
fd
);
extern
void
fd_spi_exit
(
struct
fd_dev
*
fd
);
...
...
kernel/spi.c
View file @
b8fb123f
...
...
@@ -43,12 +43,19 @@ int fd_spi_xfer(struct fd_dev *fd, int ss, int num_bits,
return
0
;
}
int
fd_spi_set_vcxo
(
struct
fd_dev
*
fd
,
int
vcxo_dac
)
{
vcxo_dac
&=
0xffff
;
fd_spi_xfer
(
fd
,
FD_CS_DAC
,
24
,
vcxo_dac
,
NULL
);
fd
->
current_vcxo_dac
=
vcxo_dac
;
return
vcxo_dac
;
}
int
fd_spi_init
(
struct
fd_dev
*
fd
)
{
/* write default to DAC for VCXO */
fd_spi_xfer
(
fd
,
FD_CS_DAC
,
24
,
fd
->
calib
.
vcxo_default_tune
&
0xffff
,
NULL
);
fd_spi_set_vcxo
(
fd
,
fd
->
calib
.
vcxo_default_tune
);
return
0
;
}
...
...
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