From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH v4 05/14] ASoC: hdac_hdmi: Apply constraints based on ELD Date: Fri, 08 Jan 2016 15:48:03 +0100 Message-ID: References: <1449677405-7907-1-git-send-email-subhransu.s.prusty@intel.com> <1449677781-7997-1-git-send-email-subhransu.s.prusty@intel.com> <1449677781-7997-5-git-send-email-subhransu.s.prusty@intel.com> <20160108140933.GT6588@sirena.org.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id C113826040E for ; Fri, 8 Jan 2016 15:48:05 +0100 (CET) In-Reply-To: <20160108140933.GT6588@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: patches.audio@intel.com, Vinod Koul , alsa-devel@alsa-project.org, "Subhransu S. Prusty" , lgirdwood@gmail.com List-Id: alsa-devel@alsa-project.org On Fri, 08 Jan 2016 15:09:33 +0100, Mark Brown wrote: > > On Wed, Dec 09, 2015 at 09:46:12PM +0530, Subhransu S. Prusty wrote: > > > +static int hdac_hdmi_eld_limit_formats(struct snd_pcm_runtime *runtime, > > + void *eld) > > +{ > > + u64 formats = SNDRV_PCM_FMTBIT_S16; > > + int i; > > + const u8 *sad, *eld_buf = eld; > > + > > + sad = drm_eld_sad(eld_buf); > > + if (!sad) > > + goto format_constraint; > > + > > + for (i = drm_eld_sad_count(eld_buf); i > 0; i--, sad += 3) { > > + if (sad_format(sad) == 1) { /* AUDIO_CODING_TYPE_LPCM */ > > switch (sad_format(sad)) { > case AUDIO_CODING_TYPE_LPCM: > > > + > > + /* 20 bit and 24 bit */ > > + if (sad_sample_bits_lpcm(sad) & 0x6) > > + formats |= SNDRV_PCM_FMTBIT_S32; > > + } > > + } > > I really don't have a clear idea what the above is supposed to do or why > this is specific to HDAC and not handled... > > > - return 0; > > + return snd_pcm_hw_constraint_eld(substream->runtime, > > + dai_map->pin->eld.eld_buffer); > > > ...here. The PCM format cannot be determined uniquely as it depends on the container type and endianness. So this can't be implemented in a generic helper. Takashi