alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Ismael Luceno <ismael@iodev.co.uk>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Andrey Utkin <andrey.utkin@corp.bluecherry.net>,
	Bluecherry Maintainers <maintainers@bluecherrydvr.com>,
	Anton Sviridenko <anton@corp.bluecherry.net>,
	linux-media@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH for-5.6 01/14] media: solo6x10: Use managed buffer allocation
Date: Tue, 17 Dec 2019 00:42:04 +0100	[thread overview]
Message-ID: <20191216234204.GA32004@pirotess.home> (raw)
In-Reply-To: <20191210135849.15607-2-tiwai@suse.de>

On 10/Dec/2019 14:58, Takashi Iwai wrote:
> Clean up the driver with the new managed buffer allocation API.
> The hw_params and hw_free callbacks became superfluous and dropped.
> 
> Cc: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
> Cc: Anton Sviridenko <anton@corp.bluecherry.net>
> Cc: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
> Cc: Ismael Luceno <ismael@iodev.co.uk>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  drivers/media/pci/solo6x10/solo6x10-g723.c | 23 +++++------------------
>  1 file changed, 5 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> index eaa57d835ea8..ca349d447610 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -97,17 +97,6 @@ void solo_g723_isr(struct solo_dev *solo_dev)
>  	}
>  }
>  
> -static int snd_solo_hw_params(struct snd_pcm_substream *ss,
> -			      struct snd_pcm_hw_params *hw_params)
> -{
> -	return snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw_params));
> -}
> -
> -static int snd_solo_hw_free(struct snd_pcm_substream *ss)
> -{
> -	return snd_pcm_lib_free_pages(ss);
> -}
> -
>  static const struct snd_pcm_hardware snd_solo_pcm_hw = {
>  	.info			= (SNDRV_PCM_INFO_MMAP |
>  				   SNDRV_PCM_INFO_INTERLEAVED |
> @@ -271,8 +260,6 @@ static const struct snd_pcm_ops snd_solo_pcm_ops = {
>  	.open = snd_solo_pcm_open,
>  	.close = snd_solo_pcm_close,
>  	.ioctl = snd_pcm_lib_ioctl,
> -	.hw_params = snd_solo_hw_params,
> -	.hw_free = snd_solo_hw_free,
>  	.prepare = snd_solo_pcm_prepare,
>  	.trigger = snd_solo_pcm_trigger,
>  	.pointer = snd_solo_pcm_pointer,
> @@ -351,11 +338,11 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>  	     ss; ss = ss->next, i++)
>  		sprintf(ss->name, "Camera #%d Audio", i);
>  
> -	snd_pcm_lib_preallocate_pages_for_all(pcm,
> -					SNDRV_DMA_TYPE_CONTINUOUS,
> -					NULL,
> -					G723_PERIOD_BYTES * PERIODS,
> -					G723_PERIOD_BYTES * PERIODS);
> +	snd_pcm_set_managed_buffer_all(pcm,
> +				       SNDRV_DMA_TYPE_CONTINUOUS,
> +				       NULL,
> +				       G723_PERIOD_BYTES * PERIODS,
> +				       G723_PERIOD_BYTES * PERIODS);
>  
>  	solo_dev->snd_pcm = pcm;
>  
> -- 
> 2.16.4
> 

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-12-16 22:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 13:58 [alsa-devel] [PATCH for-5.6 00/14] media: ALSA PCM API updates Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 01/14] media: solo6x10: Use managed buffer allocation Takashi Iwai
2019-12-16 23:42   ` Ismael Luceno [this message]
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 02/14] media: tw686x: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 03/14] media: usbtv: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 04/14] media: cobalt: Clean up ALSA PCM API usages Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 05/14] media: cx18: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 06/14] media: ivtv: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 07/14] media: cs231xx: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 08/14] media: em28xx: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 09/14] media: go7007: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 10/14] media: tm6000: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 11/14] media: cobalt: Drop superfluous ioctl PCM ops Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 12/14] media: cx18: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 13/14] media: ivtv: " Takashi Iwai
2019-12-10 13:58 ` [alsa-devel] [PATCH for-5.6 14/14] media: " Takashi Iwai
2019-12-16 23:43   ` Ismael Luceno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191216234204.GA32004@pirotess.home \
    --to=ismael@iodev.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=andrey.utkin@corp.bluecherry.net \
    --cc=anton@corp.bluecherry.net \
    --cc=linux-media@vger.kernel.org \
    --cc=maintainers@bluecherrydvr.com \
    --cc=mchehab@kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).