LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: " Maciej S. Szmigiero " <mail@maciej.szmigiero.name>
Cc: "Nicolin Chen" <nicoleotsuka@gmail.com>,
	"Xiubo Li" <Xiubo.Lee@gmail.com>,
	"Jaroslav Kysela" <perex@perex.cz>, "Timur Tabi" <timur@tabi.org>,
	<alsa-devel@alsa-project.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	<linuxppc-dev@lists.ozlabs.org>,
	"Fabio Estevam" <fabio.estevam@nxp.com>,
	"linux-kernel" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4
Date: Thu, 23 Nov 2017 09:08:35 +0100	[thread overview]
Message-ID: <s5hwp2h4dto.wl-tiwai@suse.de> (raw)
In-Reply-To: <53d527c0-89f6-d501-09e9-1effea8a5bac@maciej.szmigiero.name>

On Wed, 22 Nov 2017 20:17:34 +0100,
 Maciej S. Szmigiero  wrote:
> 
> This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep
> 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not
> allow 3-byte accesses (including DMA) so a 4-byte format is needed for it.
> 
> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
> ---
>  include/sound/pcm.h         |  8 ++++++++
>  include/sound/soc-dai.h     |  2 ++
>  include/uapi/sound/asound.h | 10 +++++++++-
>  sound/core/pcm_misc.c       | 16 ++++++++++++++++
>  4 files changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/include/sound/pcm.h b/include/sound/pcm.h
> index 24febf9e177c..7ad2d3f0934f 100644
> --- a/include/sound/pcm.h
> +++ b/include/sound/pcm.h
> @@ -191,6 +191,10 @@ struct snd_pcm_ops {
>  #define SNDRV_PCM_FMTBIT_DSD_U32_LE	_SNDRV_PCM_FMTBIT(DSD_U32_LE)
>  #define SNDRV_PCM_FMTBIT_DSD_U16_BE	_SNDRV_PCM_FMTBIT(DSD_U16_BE)
>  #define SNDRV_PCM_FMTBIT_DSD_U32_BE	_SNDRV_PCM_FMTBIT(DSD_U32_BE)
> +#define SNDRV_PCM_FMTBIT_S20_4LE	_SNDRV_PCM_FMTBIT(S20_4LE)
> +#define SNDRV_PCM_FMTBIT_U20_4LE	_SNDRV_PCM_FMTBIT(U20_4LE)
> +#define SNDRV_PCM_FMTBIT_S20_4BE	_SNDRV_PCM_FMTBIT(S20_4BE)
> +#define SNDRV_PCM_FMTBIT_U20_4BE	_SNDRV_PCM_FMTBIT(U20_4BE)

The conventional names aren't with "4" suffix,
e.g. SNDRV_PCM_FMTBIT_S20_LE.

Also, there are still empty slots under 32, e.g. start from 25.
The formats over 31 were used for 3 bytes or other unusual formats
(although nowadays it makes little sense), and the slots < 32 would
fit for 4 bytes linear format.

It's still an open question whether we should increase the protocol
number when we add a new PCM format definition.  I guess it's not, as
the ABI behavior itself doesn't change, but I might have overlooked
some possible breakage.


thanks,

Takashi

  parent reply	other threads:[~2017-11-23  8:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 19:17 [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4 Maciej S. Szmigiero
2017-11-22 23:27 ` [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S, U}20_4 Takashi Sakamoto
2017-11-22 23:44   ` Maciej S. Szmigiero
2017-11-23  7:40     ` Takashi Sakamoto
2017-11-23 12:26       ` Maciej S. Szmigiero
2017-11-23  8:08 ` Takashi Iwai [this message]
2017-11-23 12:26   ` [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4 Maciej S. Szmigiero

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=s5hwp2h4dto.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mail@maciej.szmigiero.name \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=timur@tabi.org \
    /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).