All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sia Jee Heng <jee.heng.sia@intel.com>
To: alsa-devel@alsa-project.org
Cc: broonie@kernel.org, tiwai@suse.com, jee.heng.sia@intel.com,
	pierre-louis.bossart@linux.intel.com
Subject: [PATCH RFC 1/4] ASoC: codec: hdmi-codec: Support IEC958 encoded PCM format
Date: Thu,  4 Feb 2021 09:42:55 +0800	[thread overview]
Message-ID: <20210204014258.10197-2-jee.heng.sia@intel.com> (raw)
In-Reply-To: <20210204014258.10197-1-jee.heng.sia@intel.com>

Existing hdmi-codec driver only support standard pcm format.
Support of IEC958 encoded format pass from ALSA IEC958 plugin is needed
so that the IEC958 encoded data can be streamed to the HDMI chip.

Signed-off-by: Sia Jee Heng <jee.heng.sia@intel.com>
---
 include/sound/hdmi-codec.h    | 5 +++++
 sound/soc/codecs/hdmi-codec.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
index b55970859a13..4b3a1d374b90 100644
--- a/include/sound/hdmi-codec.h
+++ b/include/sound/hdmi-codec.h
@@ -34,6 +34,11 @@ struct hdmi_codec_daifmt {
 	unsigned int frame_clk_inv:1;
 	unsigned int bit_clk_master:1;
 	unsigned int frame_clk_master:1;
+	/* bit_fmt could be standard PCM format or
+	 * IEC958 encoded format. ALSA IEC958 plugin will pass
+	 * IEC958_SUBFRAME format to the underneath driver.
+	 */
+	snd_pcm_format_t bit_fmt;
 };
 
 /*
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 0f3ac22f2cf8..422539f933de 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -489,6 +489,7 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
 	hp.sample_rate = params_rate(params);
 	hp.channels = params_channels(params);
 
+	cf->bit_fmt = params_format(params);
 	return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data,
 				       cf, &hp);
 }
@@ -617,7 +618,8 @@ static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = {
 			 SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE |\
 			 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |\
 			 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\
-			 SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE)
+			 SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |\
+			 SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
 
 static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
 			      struct snd_soc_dai *dai)
-- 
2.18.0


  reply	other threads:[~2021-02-04  2:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  1:42 [PATCH RFC 0/4] Add HDMI support for Intel KeemBay I2S Sia Jee Heng
2021-02-04  1:42 ` Sia Jee Heng [this message]
2021-02-04  1:42 ` [PATCH RFC 2/4] drm: bridge: adv7511: Support I2S IEC958 encoded PCM format Sia Jee Heng
2021-02-04  1:42 ` [PATCH RFC 3/4] dt-bindings: sound: Intel, Keembay-i2s: Add hdmi-i2s compatible string Sia Jee Heng
2021-02-04  1:42 ` [PATCH RFC 4/4] ASoC: Intel: KMB: Support IEC958 encoded PCM format Sia Jee Heng
2021-02-05 16:35 ` [PATCH RFC 0/4] Add HDMI support for Intel KeemBay I2S Mark Brown
2021-02-08  1:25   ` Sia, Jee Heng
2021-02-08 18:38 ` (subset) " Mark Brown

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=20210204014258.10197-2-jee.heng.sia@intel.com \
    --to=jee.heng.sia@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.