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
4ae23b38
Commit
4ae23b38
authored
Nov 14, 2012
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spi.c: update printk
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
a8d217f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
spi.c
kernel/spi.c
+3
-5
No files found.
kernel/spi.c
View file @
4ae23b38
...
...
@@ -40,7 +40,6 @@ int fa_spi_xfer(struct fa_dev *fa, int cs, int num_bits,
unsigned
long
j
=
jiffies
+
HZ
;
int
err
=
0
;
pr_info
(
"%s:%d out %d
\n
"
,
__func__
,
__LINE__
,
tx
);
/* Put out value in the T0 register*/
fmc_writel
(
fa
->
fmc
,
(
tx
&
(
num_bits
-
1
)),
FA_SPI_MEM_OFF
+
FA_SPI_TX
(
0
));
/* Configure SPI controller */
...
...
@@ -53,19 +52,18 @@ int fa_spi_xfer(struct fa_dev *fa, int cs, int num_bits,
ctrl
|=
FA_SPI_CTRL_BUSY
;
fmc_writel
(
fa
->
fmc
,
ctrl
,
FA_SPI_MEM_OFF
+
FA_SPI_CTRL
);
/* Wait transfer complete */
pr_info
(
"%s:%d
\n
"
,
__func__
,
__LINE__
);
while
(
fmc_readl
(
fa
->
fmc
,
FA_SPI_MEM_OFF
+
FA_SPI_CTRL
)
&
FA_SPI_CTRL_BUSY
)
{
pr_info
(
"%s:%d
\n
"
,
__func__
,
__LINE__
);
if
(
jiffies
>
j
)
{
dev_err
(
&
fa
->
fmc
->
dev
,
"SPI transfer error
\n
"
);
err
=
-
EIO
;
goto
out
;
}
}
pr_info
(
"%s:%d
\n
"
,
__func__
,
__LINE__
);
/* Transfer compleate, read data */
*
rx
=
fmc_readl
(
fa
->
fmc
,
FA_SPI_MEM_OFF
+
FA_SPI_RX
(
0
))
&
(
num_bits
-
1
);
dev_dbg
(
&
fa
->
fmc
->
dev
,
"SPI transfer CS %d, NBIT %d, TX 0x%x RX 0x%x
\n
"
,
cs
,
num_bits
,
tx
,
*
rx
);
out:
pr_info
(
"%s:%d in %d
\n
"
,
__func__
,
__LINE__
,
*
rx
);
/* Clear Chip Select */
fmc_writel
(
fa
->
fmc
,
0
,
FA_SPI_MEM_OFF
+
FA_SPI_CTRL_ASS
);
...
...
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