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
nexedi
linux
Commits
97fa4133
Commit
97fa4133
authored
Nov 03, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next
parents
07ad822c
9ade09d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/core.c
+20
-11
No files found.
sound/soc/sh/rcar/core.c
View file @
97fa4133
...
@@ -94,6 +94,7 @@
...
@@ -94,6 +94,7 @@
*
*
*/
*/
#include <linux/pm_runtime.h>
#include <linux/pm_runtime.h>
#include <linux/shdma-base.h>
#include "rsnd.h"
#include "rsnd.h"
#define RSND_RATES SNDRV_PCM_RATE_8000_96000
#define RSND_RATES SNDRV_PCM_RATE_8000_96000
...
@@ -209,13 +210,6 @@ int rsnd_dma_available(struct rsnd_dma *dma)
...
@@ -209,13 +210,6 @@ int rsnd_dma_available(struct rsnd_dma *dma)
return
!!
dma
->
chan
;
return
!!
dma
->
chan
;
}
}
static
bool
rsnd_dma_filter
(
struct
dma_chan
*
chan
,
void
*
param
)
{
chan
->
private
=
param
;
return
true
;
}
int
rsnd_dma_init
(
struct
rsnd_priv
*
priv
,
struct
rsnd_dma
*
dma
,
int
rsnd_dma_init
(
struct
rsnd_priv
*
priv
,
struct
rsnd_dma
*
dma
,
int
is_play
,
int
id
,
int
is_play
,
int
id
,
int
(
*
inquiry
)(
struct
rsnd_dma
*
dma
,
int
(
*
inquiry
)(
struct
rsnd_dma
*
dma
,
...
@@ -223,7 +217,9 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
...
@@ -223,7 +217,9 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
int
(
*
complete
)(
struct
rsnd_dma
*
dma
))
int
(
*
complete
)(
struct
rsnd_dma
*
dma
))
{
{
struct
device
*
dev
=
rsnd_priv_to_dev
(
priv
);
struct
device
*
dev
=
rsnd_priv_to_dev
(
priv
);
struct
dma_slave_config
cfg
;
dma_cap_mask_t
mask
;
dma_cap_mask_t
mask
;
int
ret
;
if
(
dma
->
chan
)
{
if
(
dma
->
chan
)
{
dev_err
(
dev
,
"it already has dma channel
\n
"
);
dev_err
(
dev
,
"it already has dma channel
\n
"
);
...
@@ -233,15 +229,23 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
...
@@ -233,15 +229,23 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
dma_cap_zero
(
mask
);
dma_cap_zero
(
mask
);
dma_cap_set
(
DMA_SLAVE
,
mask
);
dma_cap_set
(
DMA_SLAVE
,
mask
);
dma
->
slave
.
shdma_slave
.
slave_id
=
id
;
dma
->
chan
=
dma_request_slave_channel_compat
(
mask
,
shdma_chan_filter
,
(
void
*
)
id
,
dev
,
dma
->
chan
=
dma_request_channel
(
mask
,
rsnd_dma_filter
,
is_play
?
"tx"
:
"rx"
);
&
dma
->
slave
.
shdma_slave
);
if
(
!
dma
->
chan
)
{
if
(
!
dma
->
chan
)
{
dev_err
(
dev
,
"can't get dma channel
\n
"
);
dev_err
(
dev
,
"can't get dma channel
\n
"
);
return
-
EIO
;
return
-
EIO
;
}
}
cfg
.
slave_id
=
id
;
cfg
.
dst_addr
=
0
;
/* use default addr when playback */
cfg
.
src_addr
=
0
;
/* use default addr when capture */
cfg
.
direction
=
is_play
?
DMA_MEM_TO_DEV
:
DMA_DEV_TO_MEM
;
ret
=
dmaengine_slave_config
(
dma
->
chan
,
&
cfg
);
if
(
ret
<
0
)
goto
rsnd_dma_init_err
;
dma
->
dir
=
is_play
?
DMA_TO_DEVICE
:
DMA_FROM_DEVICE
;
dma
->
dir
=
is_play
?
DMA_TO_DEVICE
:
DMA_FROM_DEVICE
;
dma
->
priv
=
priv
;
dma
->
priv
=
priv
;
dma
->
inquiry
=
inquiry
;
dma
->
inquiry
=
inquiry
;
...
@@ -249,6 +253,11 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
...
@@ -249,6 +253,11 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
INIT_WORK
(
&
dma
->
work
,
rsnd_dma_do_work
);
INIT_WORK
(
&
dma
->
work
,
rsnd_dma_do_work
);
return
0
;
return
0
;
rsnd_dma_init_err:
rsnd_dma_quit
(
priv
,
dma
);
return
ret
;
}
}
void
rsnd_dma_quit
(
struct
rsnd_priv
*
priv
,
void
rsnd_dma_quit
(
struct
rsnd_priv
*
priv
,
...
...
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