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
75ab73bc
Commit
75ab73bc
authored
Dec 02, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/dma' into asoc-fsl
parents
4ded61eb
a22f33b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
include/sound/dmaengine_pcm.h
include/sound/dmaengine_pcm.h
+4
-0
sound/soc/soc-devres.c
sound/soc/soc-devres.c
+41
-0
sound/soc/soc-generic-dmaengine-pcm.c
sound/soc/soc-generic-dmaengine-pcm.c
+3
-0
No files found.
include/sound/dmaengine_pcm.h
View file @
75ab73bc
...
...
@@ -140,6 +140,10 @@ int snd_dmaengine_pcm_register(struct device *dev,
unsigned
int
flags
);
void
snd_dmaengine_pcm_unregister
(
struct
device
*
dev
);
int
devm_snd_dmaengine_pcm_register
(
struct
device
*
dev
,
const
struct
snd_dmaengine_pcm_config
*
config
,
unsigned
int
flags
);
int
snd_dmaengine_pcm_prepare_slave_config
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
params
,
struct
dma_slave_config
*
slave_config
);
...
...
sound/soc/soc-devres.c
View file @
75ab73bc
...
...
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <sound/soc.h>
#include <sound/dmaengine_pcm.h>
static
void
devm_component_release
(
struct
device
*
dev
,
void
*
res
)
{
...
...
@@ -84,3 +85,43 @@ int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card)
return
ret
;
}
EXPORT_SYMBOL_GPL
(
devm_snd_soc_register_card
);
#ifdef CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM
static
void
devm_dmaengine_pcm_release
(
struct
device
*
dev
,
void
*
res
)
{
snd_dmaengine_pcm_unregister
(
*
(
struct
device
**
)
res
);
}
/**
* devm_snd_dmaengine_pcm_register - resource managed dmaengine PCM registration
* @dev: The parent device for the PCM device
* @config: Platform specific PCM configuration
* @flags: Platform specific quirks
*
* Register a dmaengine based PCM device with automatic unregistration when the
* device is unregistered.
*/
int
devm_snd_dmaengine_pcm_register
(
struct
device
*
dev
,
const
struct
snd_dmaengine_pcm_config
*
config
,
unsigned
int
flags
)
{
struct
device
**
ptr
;
int
ret
;
ptr
=
devres_alloc
(
devm_dmaengine_pcm_release
,
sizeof
(
*
ptr
),
GFP_KERNEL
);
if
(
!
ptr
)
return
-
ENOMEM
;
ret
=
snd_dmaengine_pcm_register
(
dev
,
config
,
flags
);
if
(
ret
==
0
)
{
*
ptr
=
dev
;
devres_add
(
dev
,
ptr
);
}
else
{
devres_free
(
ptr
);
}
return
ret
;
}
EXPORT_SYMBOL_GPL
(
devm_snd_dmaengine_pcm_register
);
#endif
sound/soc/soc-generic-dmaengine-pcm.c
View file @
75ab73bc
...
...
@@ -137,6 +137,9 @@ static int dmaengine_pcm_set_runtime_hwparams(struct snd_pcm_substream *substrea
hw
.
buffer_bytes_max
=
SIZE_MAX
;
hw
.
fifo_size
=
dma_data
->
fifo_size
;
if
(
pcm
->
flags
&
SND_DMAENGINE_PCM_FLAG_NO_RESIDUE
)
hw
.
info
|=
SNDRV_PCM_INFO_BATCH
;
ret
=
dma_get_slave_caps
(
chan
,
&
dma_caps
);
if
(
ret
==
0
)
{
if
(
dma_caps
.
cmd_pause
)
...
...
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