From: Jyri Sarha <jsarha@ti.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
peter.ujfalusi@ti.com, moinejf@free.fr, airlied@linux.ie,
tomi.valkeinen@ti.com, dri-devel@lists.freedesktop.org,
liam.r.girdwood@linux.intel.com, tony@atomide.com,
broonie@kernel.org, bcousson@baylibre.com,
linux-omap@vger.kernel.org
Subject: Re: [PATCH RFC v3 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders
Date: Mon, 17 Aug 2015 09:50:53 +0300 [thread overview]
Message-ID: <55D1844D.1060806@ti.com> (raw)
In-Reply-To: <20150814095741.GG7576@n2100.arm.linux.org.uk>
On 08/14/15 12:57, Russell King - ARM Linux wrote:
> On Fri, Aug 14, 2015 at 12:30:41PM +0300, Jyri Sarha wrote:
>> +static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
>> + struct snd_pcm_hw_params *params,
>> + struct snd_soc_dai *dai)
>> +{
>> + struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
>> + struct hdmi_codec_params hp = {
>> + .cea = { 0 },
>
> Unnecessary initialisation - because you are initialising this structure,
> all unnamed fields will be zeroed.
>
True, I just tried to be explicit.
>> + .iec = {
>> + .status = {
>> + IEC958_AES0_CON_NOT_COPYRIGHT,
>> + IEC958_AES1_CON_GENERAL,
>> + IEC958_AES2_CON_SOURCE_UNSPEC,
>> + IEC958_AES3_CON_CLOCK_VARIABLE,
>> + },
>
> ...
>
>> + hdmi_audio_infoframe_init(&hp.cea);
>> + hp.cea.coding_type = HDMI_AUDIO_CODING_TYPE_PCM;
>
> Something tells me here that you haven't read the HDMI specification.
> HDMI says that the coding type will be zero (refer to stream header).
> The same goes for much of the CEA audio infoframe. Please see the
> Audio InfoFrame details in the HDMI specification.
>
Must admit, that I have not read it end to end. Obviously I have missed
a relevant piece of information here. I'll fix that and check the
related items too.
>> + hp.cea.channels = params_channels(params);
>> +
>> + switch (params_width(params)) {
>> + case 16:
>> + hp.iec.status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
>> + hp.cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_16;
>> + break;
>> + case 18:
>> + hp.iec.status[4] |= IEC958_AES4_CON_WORDLEN_22_18;
>> + hp.cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_20;
>> + break;
>> + case 20:
>> + hp.iec.status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
>> + hp.cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_20;
>> + break;
>> + case 24:
>> + case 32:
>> + hp.iec.status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24 |
>> + IEC958_AES4_CON_WORDLEN_24_20;
>
> Why not use the generic code to generate the AES channel status bits?
> See sound/core/pcm_iec958.c.
>
Thanks, I did not know that exist. I'll make use of that.
Best regards,
Jyri
next prev parent reply other threads:[~2015-08-17 6:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-14 9:30 [PATCH RFC v3 0/7] Implement generic ASoC HDMI codec and use it in tda998x Jyri Sarha
2015-08-14 9:30 ` [PATCH RFC v3 1/7] drm/edid: add function to help find SADs, DO NOT MERGE Jyri Sarha
[not found] ` <cover.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14 9:30 ` [PATCH RFC v3 2/7] ASoC: hdmi: Remove obsolete dummy HDMI codec Jyri Sarha
[not found] ` <360a38c83ae2a24620da85b8496b745326d995de.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14 16:10 ` Mark Brown
2015-08-17 7:00 ` Jyri Sarha
2015-08-17 18:46 ` Mark Brown
2015-08-14 9:30 ` [PATCH RFC v3 4/7] drm/i2c: tda998x: Add support of a DT graph of ports Jyri Sarha
2015-08-14 9:30 ` [PATCH RFC v3 6/7] drm/i2c: tda998x: Register ASoC HDMI codec for audio functionality Jyri Sarha
[not found] ` <1e8e3215caa932dab68de8576aee81f5e1008163.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14 10:06 ` Russell King - ARM Linux
2015-08-17 7:25 ` Jyri Sarha
2015-08-14 9:30 ` [PATCH RFC v3 7/7] ARM: dts: am335x-boneblack: Add HDMI audio support Jyri Sarha
2015-08-14 9:30 ` [PATCH RFC v3 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders Jyri Sarha
2015-08-14 9:57 ` Russell King - ARM Linux
2015-08-17 6:50 ` Jyri Sarha [this message]
[not found] ` <ed41a6c0b594866c05e695cc066371d0e3862c7e.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14 16:18 ` Mark Brown
2015-08-17 7:07 ` Jyri Sarha
2015-08-17 18:41 ` Mark Brown
2015-08-17 19:22 ` Jyri Sarha
2015-08-17 7:57 ` Jyri Sarha
2015-08-17 12:59 ` Jyri Sarha
2015-08-14 9:30 ` [PATCH RFC v3 5/7] drm/i2c: tda998x: Remove include/sound/tda998x.h and fix graph parsing Jyri Sarha
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=55D1844D.1060806@ti.com \
--to=jsarha@ti.com \
--cc=airlied@linux.ie \
--cc=alsa-devel@alsa-project.org \
--cc=bcousson@baylibre.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=moinejf@free.fr \
--cc=peter.ujfalusi@ti.com \
--cc=tomi.valkeinen@ti.com \
--cc=tony@atomide.com \
/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).