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
a715d01e
Commit
a715d01e
authored
Dec 09, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/fix/dma' into asoc-dma
parents
11b3a7ad
6b9f3e65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
11 deletions
+27
-11
sound/soc/soc-generic-dmaengine-pcm.c
sound/soc/soc-generic-dmaengine-pcm.c
+27
-11
No files found.
sound/soc/soc-generic-dmaengine-pcm.c
View file @
a715d01e
...
@@ -313,6 +313,20 @@ static void dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
...
@@ -313,6 +313,20 @@ static void dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
pcm
->
chan
[
1
]
=
pcm
->
chan
[
0
];
pcm
->
chan
[
1
]
=
pcm
->
chan
[
0
];
}
}
static
void
dmaengine_pcm_release_chan
(
struct
dmaengine_pcm
*
pcm
)
{
unsigned
int
i
;
for
(
i
=
SNDRV_PCM_STREAM_PLAYBACK
;
i
<=
SNDRV_PCM_STREAM_CAPTURE
;
i
++
)
{
if
(
!
pcm
->
chan
[
i
])
continue
;
dma_release_channel
(
pcm
->
chan
[
i
]);
if
(
pcm
->
flags
&
SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX
)
break
;
}
}
/**
/**
* snd_dmaengine_pcm_register - Register a dmaengine based PCM device
* snd_dmaengine_pcm_register - Register a dmaengine based PCM device
* @dev: The parent device for the PCM device
* @dev: The parent device for the PCM device
...
@@ -323,6 +337,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
...
@@ -323,6 +337,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
const
struct
snd_dmaengine_pcm_config
*
config
,
unsigned
int
flags
)
const
struct
snd_dmaengine_pcm_config
*
config
,
unsigned
int
flags
)
{
{
struct
dmaengine_pcm
*
pcm
;
struct
dmaengine_pcm
*
pcm
;
int
ret
;
pcm
=
kzalloc
(
sizeof
(
*
pcm
),
GFP_KERNEL
);
pcm
=
kzalloc
(
sizeof
(
*
pcm
),
GFP_KERNEL
);
if
(
!
pcm
)
if
(
!
pcm
)
...
@@ -334,11 +349,20 @@ int snd_dmaengine_pcm_register(struct device *dev,
...
@@ -334,11 +349,20 @@ int snd_dmaengine_pcm_register(struct device *dev,
dmaengine_pcm_request_chan_of
(
pcm
,
dev
);
dmaengine_pcm_request_chan_of
(
pcm
,
dev
);
if
(
flags
&
SND_DMAENGINE_PCM_FLAG_NO_RESIDUE
)
if
(
flags
&
SND_DMAENGINE_PCM_FLAG_NO_RESIDUE
)
ret
urn
snd_soc_add_platform
(
dev
,
&
pcm
->
platform
,
ret
=
snd_soc_add_platform
(
dev
,
&
pcm
->
platform
,
&
dmaengine_no_residue_pcm_platform
);
&
dmaengine_no_residue_pcm_platform
);
else
else
ret
urn
snd_soc_add_platform
(
dev
,
&
pcm
->
platform
,
ret
=
snd_soc_add_platform
(
dev
,
&
pcm
->
platform
,
&
dmaengine_pcm_platform
);
&
dmaengine_pcm_platform
);
if
(
ret
)
goto
err_free_dma
;
return
0
;
err_free_dma:
dmaengine_pcm_release_chan
(
pcm
);
kfree
(
pcm
);
return
ret
;
}
}
EXPORT_SYMBOL_GPL
(
snd_dmaengine_pcm_register
);
EXPORT_SYMBOL_GPL
(
snd_dmaengine_pcm_register
);
...
@@ -353,7 +377,6 @@ void snd_dmaengine_pcm_unregister(struct device *dev)
...
@@ -353,7 +377,6 @@ void snd_dmaengine_pcm_unregister(struct device *dev)
{
{
struct
snd_soc_platform
*
platform
;
struct
snd_soc_platform
*
platform
;
struct
dmaengine_pcm
*
pcm
;
struct
dmaengine_pcm
*
pcm
;
unsigned
int
i
;
platform
=
snd_soc_lookup_platform
(
dev
);
platform
=
snd_soc_lookup_platform
(
dev
);
if
(
!
platform
)
if
(
!
platform
)
...
@@ -361,15 +384,8 @@ void snd_dmaengine_pcm_unregister(struct device *dev)
...
@@ -361,15 +384,8 @@ void snd_dmaengine_pcm_unregister(struct device *dev)
pcm
=
soc_platform_to_pcm
(
platform
);
pcm
=
soc_platform_to_pcm
(
platform
);
for
(
i
=
SNDRV_PCM_STREAM_PLAYBACK
;
i
<=
SNDRV_PCM_STREAM_CAPTURE
;
i
++
)
{
if
(
pcm
->
chan
[
i
])
{
dma_release_channel
(
pcm
->
chan
[
i
]);
if
(
pcm
->
flags
&
SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX
)
break
;
}
}
snd_soc_remove_platform
(
platform
);
snd_soc_remove_platform
(
platform
);
dmaengine_pcm_release_chan
(
pcm
);
kfree
(
pcm
);
kfree
(
pcm
);
}
}
EXPORT_SYMBOL_GPL
(
snd_dmaengine_pcm_unregister
);
EXPORT_SYMBOL_GPL
(
snd_dmaengine_pcm_unregister
);
...
...
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