Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
Commits
1ad18b77
Commit
1ad18b77
authored
May 15, 2012
by
Tomasz Wlostowski
Committed by
Alessandro Rubini
May 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gpio.c: dummy SPI transfer after the real one to ensure high state on all CS lines
parent
206ec171
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
fine-delay.h
fine-delay.h
+1
-0
gpio.c
gpio.c
+10
-1
No files found.
fine-delay.h
View file @
1ad18b77
...
@@ -236,6 +236,7 @@ enum fd_acam_modes {
...
@@ -236,6 +236,7 @@ enum fd_acam_modes {
#define ACAM_MASK ((1<<29) - 1)
/* 28 bits */
#define ACAM_MASK ((1<<29) - 1)
/* 28 bits */
/* SPI Bus chip selects */
/* SPI Bus chip selects */
#define FD_CS_NONE 0
/* Nothing */
#define FD_CS_PLL 1
/* AD9516 PLL */
#define FD_CS_PLL 1
/* AD9516 PLL */
#define FD_CS_GPIO 2
/* MCP23S17 GPIO */
#define FD_CS_GPIO 2
/* MCP23S17 GPIO */
...
...
gpio.c
View file @
1ad18b77
...
@@ -18,8 +18,13 @@
...
@@ -18,8 +18,13 @@
static
int
gpio_writel
(
struct
spec_fd
*
fd
,
int
val
,
int
reg
)
static
int
gpio_writel
(
struct
spec_fd
*
fd
,
int
val
,
int
reg
)
{
{
return
fd_spi_xfer
(
fd
,
FD_CS_GPIO
,
24
,
int
rval
=
fd_spi_xfer
(
fd
,
FD_CS_GPIO
,
24
,
0x4e0000
|
(
reg
<<
8
)
|
val
,
NULL
);
0x4e0000
|
(
reg
<<
8
)
|
val
,
NULL
);
fd_spi_xfer
(
fd
,
FD_CS_NONE
,
24
,
0
,
NULL
);
return
rval
;
}
}
static
int
gpio_readl
(
struct
spec_fd
*
fd
,
int
reg
)
static
int
gpio_readl
(
struct
spec_fd
*
fd
,
int
reg
)
...
@@ -29,6 +34,10 @@ static int gpio_readl(struct spec_fd *fd, int reg)
...
@@ -29,6 +34,10 @@ static int gpio_readl(struct spec_fd *fd, int reg)
err
=
fd_spi_xfer
(
fd
,
FD_CS_GPIO
,
24
,
err
=
fd_spi_xfer
(
fd
,
FD_CS_GPIO
,
24
,
0x4f0000
|
(
reg
<<
8
),
&
ret
);
0x4f0000
|
(
reg
<<
8
),
&
ret
);
fd_spi_xfer
(
fd
,
FD_CS_NONE
,
24
,
0
,
NULL
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
return
ret
&
0xff
;
return
ret
&
0xff
;
...
...
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