Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c23663ac
Commit
c23663ac
authored
Mar 10, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/fix/imx' into spi-linus
parents
f6cede5b
ba4a3550
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
15 deletions
+2
-15
drivers/spi/spi-imx.c
drivers/spi/spi-imx.c
+2
-15
No files found.
drivers/spi/spi-imx.c
View file @
c23663ac
...
...
@@ -204,8 +204,8 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,
{
struct
spi_imx_data
*
spi_imx
=
spi_master_get_devdata
(
master
);
if
(
spi_imx
->
dma_is_inited
&&
transfer
->
len
>
spi_imx
->
wml
*
sizeof
(
u32
)
)
if
(
spi_imx
->
dma_is_inited
&&
transfer
->
len
>=
spi_imx
->
wml
&&
(
transfer
->
len
%
spi_imx
->
wml
)
==
0
)
return
true
;
return
false
;
}
...
...
@@ -919,8 +919,6 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
struct
dma_async_tx_descriptor
*
desc_tx
=
NULL
,
*
desc_rx
=
NULL
;
int
ret
;
unsigned
long
timeout
;
u32
dma
;
int
left
;
struct
spi_master
*
master
=
spi_imx
->
bitbang
.
master
;
struct
sg_table
*
tx
=
&
transfer
->
tx_sg
,
*
rx
=
&
transfer
->
rx_sg
;
...
...
@@ -954,13 +952,6 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
/* Trigger the cspi module. */
spi_imx
->
dma_finished
=
0
;
dma
=
readl
(
spi_imx
->
base
+
MX51_ECSPI_DMA
);
dma
=
dma
&
(
~
MX51_ECSPI_DMA_RXT_WML_MASK
);
/* Change RX_DMA_LENGTH trigger dma fetch tail data */
left
=
transfer
->
len
%
spi_imx
->
wml
;
if
(
left
)
writel
(
dma
|
(
left
<<
MX51_ECSPI_DMA_RXT_WML_OFFSET
),
spi_imx
->
base
+
MX51_ECSPI_DMA
);
/*
* Set these order to avoid potential RX overflow. The overflow may
* happen if we enable SPI HW before starting RX DMA due to rescheduling
...
...
@@ -992,10 +983,6 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
spi_imx
->
devtype_data
->
reset
(
spi_imx
);
dmaengine_terminate_all
(
master
->
dma_rx
);
}
dma
&=
~
MX51_ECSPI_DMA_RXT_WML_MASK
;
writel
(
dma
|
spi_imx
->
wml
<<
MX51_ECSPI_DMA_RXT_WML_OFFSET
,
spi_imx
->
base
+
MX51_ECSPI_DMA
);
}
spi_imx
->
dma_finished
=
1
;
...
...
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