From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jackson Subject: Re: [PATCH v9 3/4] ASoC: tda998x: add a codec to the HDMI transmitter Date: Fri, 09 Jan 2015 17:39:08 +0000 Message-ID: <54B0123C.9070800@arm.com> References: <23b36acc1f769418a06f3e929eba288b5911da12.1420628786.git.moinejf@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <23b36acc1f769418a06f3e929eba288b5911da12.1420628786.git.moinejf@free.fr> 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: Jean-Francois Moine , Mark Brown , Russell King - ARM Linux Cc: "devicetree@vger.kernel.org" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Jyri Sarha , Dave Airlie List-Id: devicetree@vger.kernel.org On 01/07/15 10:51, Jean-Francois Moine wrote: > This patch adds a CODEC to the NXP TDA998x HDMI transmitter. > > The CODEC handles both I2S and S/PDIF inputs. > It maintains the audio format and rate constraints according > to the HDMI device parameters (EDID) and sets dynamically the input > ports in the TDA998x I2C driver on start/stop audio streaming. > > Signed-off-by: Jean-Francois Moine > --- [snip] > +static int tda998x_codec_startup(struct snd_pcm_substream *substream, > + struct snd_soc_dai *dai) > +{ > + struct snd_pcm_runtime *runtime = substream->runtime; > + struct snd_pcm_hw_constraint_list *rate_constraints; > + u8 *sad; /* Short Audio Descriptor (3 bytes) */ [...] > + snd_pcm_hw_constraint_minmax(runtime, > + SNDRV_PCM_HW_PARAM_CHANNELS, > + 1, sad[SAD_MX_CHAN_I]); In the light of our discussions elsewhere [1], shouldn't this be constrained by the number of hardware channels that the TDA998x supports too? That is, the maximum number of channels should be the lesser of sd[SAD_MX_CHAN_I] and number_of_I2S channels (or S/PDIF channels if so configured). Andrew [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2015-January/086090.html