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
0470f68e
Commit
0470f68e
authored
Jun 26, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/atmel' into spi-next
parents
77ba6145
2f767a9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
drivers/spi/spi-atmel.c
drivers/spi/spi-atmel.c
+27
-15
No files found.
drivers/spi/spi-atmel.c
View file @
0470f68e
...
...
@@ -424,10 +424,15 @@ static int atmel_spi_dma_slave_config(struct atmel_spi *as,
return
err
;
}
static
bool
filter
(
struct
dma_chan
*
chan
,
void
*
slave
)
static
bool
filter
(
struct
dma_chan
*
chan
,
void
*
pdata
)
{
struct
at_dma_slave
*
sl
=
slave
;
struct
atmel_spi_dma
*
sl_pdata
=
pdata
;
struct
at_dma_slave
*
sl
;
if
(
!
sl_pdata
)
return
false
;
sl
=
&
sl_pdata
->
dma_slave
;
if
(
sl
->
dma_dev
==
chan
->
device
->
dev
)
{
chan
->
private
=
sl
;
return
true
;
...
...
@@ -438,24 +443,31 @@ static bool filter(struct dma_chan *chan, void *slave)
static
int
atmel_spi_configure_dma
(
struct
atmel_spi
*
as
)
{
struct
at_dma_slave
*
sdata
=
&
as
->
dma
.
dma_slave
;
struct
dma_slave_config
slave_config
;
struct
device
*
dev
=
&
as
->
pdev
->
dev
;
int
err
;
if
(
sdata
&&
sdata
->
dma_dev
)
{
dma_cap_mask_t
mask
;
dma_cap_mask_t
mask
;
dma_cap_zero
(
mask
);
dma_cap_set
(
DMA_SLAVE
,
mask
);
/* Try to grab two DMA channels */
dma_cap_zero
(
mask
);
dma_cap_set
(
DMA_SLAVE
,
mask
);
as
->
dma
.
chan_tx
=
dma_request_channel
(
mask
,
filter
,
sdata
);
if
(
as
->
dma
.
chan_tx
)
as
->
dma
.
chan_rx
=
dma_request_channel
(
mask
,
filter
,
sdata
);
as
->
dma
.
chan_tx
=
dma_request_slave_channel_compat
(
mask
,
filter
,
&
as
->
dma
,
dev
,
"tx"
);
if
(
!
as
->
dma
.
chan_tx
)
{
dev_err
(
dev
,
"DMA TX channel not available, SPI unable to use DMA
\n
"
);
err
=
-
EBUSY
;
goto
error
;
}
if
(
!
as
->
dma
.
chan_rx
||
!
as
->
dma
.
chan_tx
)
{
dev_err
(
&
as
->
pdev
->
dev
,
"DMA channel not available, SPI unable to use DMA
\n
"
);
as
->
dma
.
chan_rx
=
dma_request_slave_channel_compat
(
mask
,
filter
,
&
as
->
dma
,
dev
,
"rx"
);
if
(
!
as
->
dma
.
chan_rx
)
{
dev_err
(
dev
,
"DMA RX channel not available, SPI unable to use DMA
\n
"
);
err
=
-
EBUSY
;
goto
error
;
}
...
...
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