From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751849AbdKWIIj (ORCPT ); Thu, 23 Nov 2017 03:08:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:51239 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbdKWIIi (ORCPT ); Thu, 23 Nov 2017 03:08:38 -0500 Date: Thu, 23 Nov 2017 09:08:35 +0100 Message-ID: From: Takashi Iwai To: " Maciej S. Szmigiero " Cc: "Nicolin Chen" , "Xiubo Li" , "Jaroslav Kysela" , "Timur Tabi" , , "Liam Girdwood" , "Mark Brown" , , "Fabio Estevam" , "linux-kernel" Subject: Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4 In-Reply-To: <53d527c0-89f6-d501-09e9-1effea8a5bac@maciej.szmigiero.name> References: <53d527c0-89f6-d501-09e9-1effea8a5bac@maciej.szmigiero.name> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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