All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jyri Sarha <jsarha@ti.com>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	liam.r.girdwood@linux.intel.com, tomi.valkeinen@ti.com,
	arnaud.pouliquen@st.com, dri-devel@lists.freedesktop.org,
	peter.ujfalusi@ti.com, tony@atomide.com, broonie@kernel.org,
	bcousson@baylibre.com, rmk+kernel@arm.linux.org.uk,
	linux-omap@vger.kernel.org
Subject: Applied "ALSA: pcm: add IEC958 channel status helper for hw_params" to the asoc tree
Date: Wed, 06 Apr 2016 14:42:35 -0700	[thread overview]
Message-ID: <E1anvDf-0008Iw-Ad@finisterre> (raw)
In-Reply-To: <c8b96b9eac96b5dee2bdd4b7fc3ee724ce069a81.1459431292.git.jsarha@ti.com>

The patch

   ALSA: pcm: add IEC958 channel status helper for hw_params

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 4a4436573a6669516f73bac25016683d396ed4c4 Mon Sep 17 00:00:00 2001
From: Jyri Sarha <jsarha@ti.com>
Date: Thu, 31 Mar 2016 16:35:58 +0300
Subject: [PATCH] ALSA: pcm: add IEC958 channel status helper for hw_params

Add IEC958 channel status helper that gets the audio properties from
snd_pcm_hw_params instead of snd_pcm_runtime. This is needed to
produce the channel status bits already in audio stream configuration
phase.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/pcm_iec958.h |  2 ++
 sound/core/pcm_iec958.c    | 64 ++++++++++++++++++++++++++++++++++------------
 2 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/include/sound/pcm_iec958.h b/include/sound/pcm_iec958.h
index 0eed397aca8e..36f023acb201 100644
--- a/include/sound/pcm_iec958.h
+++ b/include/sound/pcm_iec958.h
@@ -6,4 +6,6 @@
 int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
 	size_t len);
 
+int snd_pcm_create_iec958_consumer_hw_params(struct snd_pcm_hw_params *params,
+					     u8 *cs, size_t len);
 #endif
diff --git a/sound/core/pcm_iec958.c b/sound/core/pcm_iec958.c
index 36b2d7aca1bd..e016871a978f 100644
--- a/sound/core/pcm_iec958.c
+++ b/sound/core/pcm_iec958.c
@@ -9,30 +9,18 @@
 #include <linux/types.h>
 #include <sound/asoundef.h>
 #include <sound/pcm.h>
+#include <sound/pcm_params.h>
 #include <sound/pcm_iec958.h>
 
-/**
- * snd_pcm_create_iec958_consumer - create consumer format IEC958 channel status
- * @runtime: pcm runtime structure with ->rate filled in
- * @cs: channel status buffer, at least four bytes
- * @len: length of channel status buffer
- *
- * Create the consumer format channel status data in @cs of maximum size
- * @len corresponding to the parameters of the PCM runtime @runtime.
- *
- * Drivers may wish to tweak the contents of the buffer after creation.
- *
- * Returns: length of buffer, or negative error code if something failed.
- */
-int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
-	size_t len)
+static int create_iec958_consumer(uint rate, uint sample_width,
+				  u8 *cs, size_t len)
 {
 	unsigned int fs, ws;
 
 	if (len < 4)
 		return -EINVAL;
 
-	switch (runtime->rate) {
+	switch (rate) {
 	case 32000:
 		fs = IEC958_AES3_CON_FS_32000;
 		break;
@@ -59,7 +47,7 @@ int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
 	}
 
 	if (len > 4) {
-		switch (snd_pcm_format_width(runtime->format)) {
+		switch (sample_width) {
 		case 16:
 			ws = IEC958_AES4_CON_WORDLEN_20_16;
 			break;
@@ -92,4 +80,46 @@ int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
 
 	return len;
 }
+
+/**
+ * snd_pcm_create_iec958_consumer - create consumer format IEC958 channel status
+ * @runtime: pcm runtime structure with ->rate filled in
+ * @cs: channel status buffer, at least four bytes
+ * @len: length of channel status buffer
+ *
+ * Create the consumer format channel status data in @cs of maximum size
+ * @len corresponding to the parameters of the PCM runtime @runtime.
+ *
+ * Drivers may wish to tweak the contents of the buffer after creation.
+ *
+ * Returns: length of buffer, or negative error code if something failed.
+ */
+int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
+	size_t len)
+{
+	return create_iec958_consumer(runtime->rate,
+				      snd_pcm_format_width(runtime->format),
+				      cs, len);
+}
 EXPORT_SYMBOL(snd_pcm_create_iec958_consumer);
+
+/**
+ * snd_pcm_create_iec958_consumer_hw_params - create IEC958 channel status
+ * @hw_params: the hw_params instance for extracting rate and sample format
+ * @cs: channel status buffer, at least four bytes
+ * @len: length of channel status buffer
+ *
+ * Create the consumer format channel status data in @cs of maximum size
+ * @len corresponding to the parameters of the PCM runtime @runtime.
+ *
+ * Drivers may wish to tweak the contents of the buffer after creation.
+ *
+ * Returns: length of buffer, or negative error code if something failed.
+ */
+int snd_pcm_create_iec958_consumer_hw_params(struct snd_pcm_hw_params *params,
+					     u8 *cs, size_t len)
+{
+	return create_iec958_consumer(params_rate(params), params_width(params),
+				      cs, len);
+}
+EXPORT_SYMBOL(snd_pcm_create_iec958_consumer_hw_params);
-- 
2.8.0.rc3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-04-06 21:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31 13:35 [PATCH v9 0/7] Implement generic ASoC HDMI codec and use it in tda998x Jyri Sarha
2016-03-31 13:35 ` [PATCH v9 1/7] ALSA: pcm: add IEC958 channel status helper for hw_params Jyri Sarha
2016-03-31 13:42   ` Takashi Iwai
2016-04-06 21:42   ` Mark Brown [this message]
2016-03-31 13:35 ` [PATCH v9 2/7] ALSA: pcm: Allow 32 bit sample format in IEC958 channel status helper Jyri Sarha
     [not found]   ` <44ee7ac5c0ddb4d25ac1bd4f189d328f8205e4a0.1459431292.git.jsarha-l0cyMroinI0@public.gmane.org>
2016-03-31 13:43     ` Takashi Iwai
2016-04-06 21:42   ` Applied "ALSA: pcm: Allow 32 bit sample format in IEC958 channel status helper" to the asoc tree Mark Brown
2016-03-31 13:36 ` [PATCH v9 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders Jyri Sarha
2016-04-13  8:06   ` Arnaud Pouliquen
     [not found]   ` <636486b25db48fa13ae640516cdebe7bcfea0d23.1459431292.git.jsarha-l0cyMroinI0@public.gmane.org>
2016-04-14  5:31     ` [alsa-devel] " PC Liao
2016-04-19 10:42   ` Jyri Sarha
     [not found]     ` <57160B9F.9090907-l0cyMroinI0@public.gmane.org>
2016-04-19 10:54       ` Mark Brown
2016-03-31 13:36 ` [PATCH v9 4/7] ASoC: hdmi-codec: Add audio abort() callback for video side to use Jyri Sarha
2016-04-13  8:31   ` Arnaud Pouliquen
2016-04-14  6:21     ` Jyri Sarha
2016-03-31 13:36 ` [PATCH v9 5/7] drm/i2c: tda998x: Improve tda998x_configure_audio() audio related pdata Jyri Sarha
2016-03-31 13:36 ` [PATCH v9 6/7] drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding Jyri Sarha
2016-04-01 18:37   ` Rob Herring
2016-03-31 13:36 ` [PATCH v9 7/7] ARM: dts: am335x-boneblack: Add HDMI audio support Jyri Sarha
2016-04-13  7:02 ` [PATCH v9 0/7] Implement generic ASoC HDMI codec and use it in tda998x Mark Brown
2016-04-13  7:53   ` Jyri Sarha
2016-04-13 17:26     ` 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=E1anvDf-0008Iw-Ad@finisterre \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --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 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.