* [PATCH] sound: soc: tegra: do not provide PAUSE/RESUME in hardware info
@ 2013-04-03 9:19 Laxman Dewangan
2013-04-03 10:26 ` Lars-Peter Clausen
0 siblings, 1 reply; 3+ messages in thread
From: Laxman Dewangan @ 2013-04-03 9:19 UTC (permalink / raw)
To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
swarren-3lzwWm7+Weoh9ZMKESR00Q
Cc: lars-Qo5EllUWu/uELgA04lAiVw, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, tiwai-l3A5Bk7waGM,
perex-/Fr2/VpizcU, Laxman Dewangan
Tegra PCM driver uses the dmaengine based DMA driver and Tegra DMA
driver does not support the pause/resume functionality as hardware
does not support it.
ALSA driver support the sw based pause/resume functionality if hardware
does not support it and in this case, hw driver should not provide
the hardware info with PAUSE/RESUME bit enable.
Remmoving the SNDRV_PCM_INFO_PAUSE and SNDRV_PCM_INFO_RESUME from hardware
info and using the snd_dmaengine_pcm_trigger() for pcm_trigger callback.
Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
Lars reported that if driver/chip dma driver does not support the pause/resume
then need not to export this info through the hw capability and leave this
implementation to alsa driver.
Making the change accordingly.
sound/soc/tegra/tegra_pcm.c | 24 +-----------------------
1 files changed, 1 insertions(+), 23 deletions(-)
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index e67af0b..117cccc 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -43,8 +43,6 @@
static const struct snd_pcm_hardware tegra_pcm_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_PAUSE |
- SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_INTERLEAVED,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.channels_min = 2,
@@ -121,26 +119,6 @@ static int tegra_pcm_hw_free(struct snd_pcm_substream *substream)
return 0;
}
-static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
-{
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- case SNDRV_PCM_TRIGGER_RESUME:
- case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- return snd_dmaengine_pcm_trigger(substream,
- SNDRV_PCM_TRIGGER_START);
-
- case SNDRV_PCM_TRIGGER_STOP:
- case SNDRV_PCM_TRIGGER_SUSPEND:
- case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- return snd_dmaengine_pcm_trigger(substream,
- SNDRV_PCM_TRIGGER_STOP);
- default:
- return -EINVAL;
- }
- return 0;
-}
-
static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
@@ -158,7 +136,7 @@ static struct snd_pcm_ops tegra_pcm_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = tegra_pcm_hw_params,
.hw_free = tegra_pcm_hw_free,
- .trigger = tegra_pcm_trigger,
+ .trigger = snd_dmaengine_pcm_trigger,
.pointer = snd_dmaengine_pcm_pointer,
.mmap = tegra_pcm_mmap,
};
--
1.7.1.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sound: soc: tegra: do not provide PAUSE/RESUME in hardware info
[not found] ` <515C03BC.3040301-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
@ 2013-04-03 9:33 ` Laxman Dewangan
0 siblings, 0 replies; 3+ messages in thread
From: Laxman Dewangan @ 2013-04-03 9:33 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
tiwai-l3A5Bk7waGM@public.gmane.org,
perex-/Fr2/VpizcU@public.gmane.org
On Wednesday 03 April 2013 03:56 PM, Lars-Peter Clausen wrote:
> On 04/03/2013 11:19 AM, Laxman Dewangan wrote:
>> Tegra PCM driver uses the dmaengine based DMA driver and Tegra DMA
>> driver does not support the pause/resume functionality as hardware
>> does not support it.
>>
>> ALSA driver support the sw based pause/resume functionality if hardware
>> does not support it and in this case, hw driver should not provide
>> the hardware info with PAUSE/RESUME bit enable.
>>
>> Remmoving the SNDRV_PCM_INFO_PAUSE and SNDRV_PCM_INFO_RESUME from hardware
>> info and using the snd_dmaengine_pcm_trigger() for pcm_trigger callback.
>>
>> Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Hm, I sent out the same patch just half an our or so ago.
>
Then I lost the race. I was struggling with sdcard until I bought the
new one.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sound: soc: tegra: do not provide PAUSE/RESUME in hardware info
2013-04-03 9:19 [PATCH] sound: soc: tegra: do not provide PAUSE/RESUME in hardware info Laxman Dewangan
@ 2013-04-03 10:26 ` Lars-Peter Clausen
[not found] ` <515C03BC.3040301-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2013-04-03 10:26 UTC (permalink / raw)
To: Laxman Dewangan
Cc: alsa-devel, swarren, tiwai, broonie, linux-kernel, linux-tegra
On 04/03/2013 11:19 AM, Laxman Dewangan wrote:
> Tegra PCM driver uses the dmaengine based DMA driver and Tegra DMA
> driver does not support the pause/resume functionality as hardware
> does not support it.
>
> ALSA driver support the sw based pause/resume functionality if hardware
> does not support it and in this case, hw driver should not provide
> the hardware info with PAUSE/RESUME bit enable.
>
> Remmoving the SNDRV_PCM_INFO_PAUSE and SNDRV_PCM_INFO_RESUME from hardware
> info and using the snd_dmaengine_pcm_trigger() for pcm_trigger callback.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Hm, I sent out the same patch just half an our or so ago.
- Lars
> ---
> Lars reported that if driver/chip dma driver does not support the pause/resume
> then need not to export this info through the hw capability and leave this
> implementation to alsa driver.
>
> Making the change accordingly.
>
> sound/soc/tegra/tegra_pcm.c | 24 +-----------------------
> 1 files changed, 1 insertions(+), 23 deletions(-)
>
> diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
> index e67af0b..117cccc 100644
> --- a/sound/soc/tegra/tegra_pcm.c
> +++ b/sound/soc/tegra/tegra_pcm.c
> @@ -43,8 +43,6 @@
> static const struct snd_pcm_hardware tegra_pcm_hardware = {
> .info = SNDRV_PCM_INFO_MMAP |
> SNDRV_PCM_INFO_MMAP_VALID |
> - SNDRV_PCM_INFO_PAUSE |
> - SNDRV_PCM_INFO_RESUME |
> SNDRV_PCM_INFO_INTERLEAVED,
> .formats = SNDRV_PCM_FMTBIT_S16_LE,
> .channels_min = 2,
> @@ -121,26 +119,6 @@ static int tegra_pcm_hw_free(struct snd_pcm_substream *substream)
> return 0;
> }
>
> -static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
> -{
> - switch (cmd) {
> - case SNDRV_PCM_TRIGGER_START:
> - case SNDRV_PCM_TRIGGER_RESUME:
> - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> - return snd_dmaengine_pcm_trigger(substream,
> - SNDRV_PCM_TRIGGER_START);
> -
> - case SNDRV_PCM_TRIGGER_STOP:
> - case SNDRV_PCM_TRIGGER_SUSPEND:
> - case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
> - return snd_dmaengine_pcm_trigger(substream,
> - SNDRV_PCM_TRIGGER_STOP);
> - default:
> - return -EINVAL;
> - }
> - return 0;
> -}
> -
> static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
> struct vm_area_struct *vma)
> {
> @@ -158,7 +136,7 @@ static struct snd_pcm_ops tegra_pcm_ops = {
> .ioctl = snd_pcm_lib_ioctl,
> .hw_params = tegra_pcm_hw_params,
> .hw_free = tegra_pcm_hw_free,
> - .trigger = tegra_pcm_trigger,
> + .trigger = snd_dmaengine_pcm_trigger,
> .pointer = snd_dmaengine_pcm_pointer,
> .mmap = tegra_pcm_mmap,
> };
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-03 10:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 9:19 [PATCH] sound: soc: tegra: do not provide PAUSE/RESUME in hardware info Laxman Dewangan
2013-04-03 10:26 ` Lars-Peter Clausen
[not found] ` <515C03BC.3040301-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-04-03 9:33 ` Laxman Dewangan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).