All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: [PATCH 09/11] ALSA: x86: Prepare LPE audio ctls for multiple PCMs
Date: Tue, 25 Apr 2017 23:27:28 +0300	[thread overview]
Message-ID: <20170425202730.1384-10-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20170425202730.1384-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

In preparation for register a PCM device for each pipe adjust
link up the ctl elements with the corresponding PCM device.

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 sound/x86/intel_hdmi_audio.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index bfb712444098..a3d15482f07e 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1609,11 +1609,16 @@ static void had_audio_wq(struct work_struct *work)
 /*
  * Jack interface
  */
-static int had_create_jack(struct snd_intelhad *ctx)
+static int had_create_jack(struct snd_intelhad *ctx,
+			   struct snd_pcm *pcm)
 {
+	char hdmi_str[32];
 	int err;
 
-	err = snd_jack_new(ctx->card, "HDMI/DP", SND_JACK_AVOUT, &ctx->jack,
+	snprintf(hdmi_str, sizeof(hdmi_str),
+		 "HDMI/DP,pcm=%d", pcm->device);
+
+	err = snd_jack_new(ctx->card, hdmi_str, SND_JACK_AVOUT, &ctx->jack,
 			   true, false);
 	if (err < 0)
 		return err;
@@ -1793,7 +1798,17 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
 
 	/* create controls */
 	for (i = 0; i < ARRAY_SIZE(had_controls); i++) {
-		ret = snd_ctl_add(card, snd_ctl_new1(&had_controls[i], ctx));
+		struct snd_kcontrol *kctl;
+
+		kctl = snd_ctl_new1(&had_controls[i], ctx);
+		if (!kctl) {
+			ret = -ENOMEM;
+			goto err;
+		}
+
+		kctl->id.device = pcm->device;
+
+		ret = snd_ctl_add(card, kctl);
 		if (ret < 0)
 			goto err;
 	}
@@ -1805,7 +1820,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto err;
 
-	ret = had_create_jack(ctx);
+	ret = had_create_jack(ctx, pcm);
 	if (ret < 0)
 		goto err;
 
-- 
2.10.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-04-25 20:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 20:27 [PATCH 00/11] drm/i915: LPE audio runtime PM and multipipe ville.syrjala
2017-04-25 20:27 ` [PATCH 01/11] drm/i915: Fix runtime PM for LPE audio ville.syrjala
2017-04-25 20:27 ` [PATCH 02/11] ALSA: x86: Clear the pdata.notify_lpe_audio pointer before teardown ville.syrjala
2017-04-25 20:27 ` [PATCH 03/11] drm/i915: Stop pretending to mask/unmask LPE audio interrupts ville.syrjala
2017-04-26  0:27   ` Pierre-Louis Bossart
2017-04-26 13:27     ` Ville Syrjälä
2017-04-25 20:27 ` [PATCH 04/11] drm/i915: Remove the unsued pending_notify from LPE platform data ville.syrjala
2017-04-25 20:27 ` [PATCH 05/11] drm/i915: Replace tmds_clock_speed and link_rate with just ls_clock ville.syrjala
2017-04-26  1:09   ` [alsa-devel] " Pierre-Louis Bossart
2017-04-26 13:28     ` Ville Syrjälä
2017-04-25 20:27 ` [PATCH 06/11] drm/i915: Remove hdmi_connected from LPE audio pdata ville.syrjala
2017-04-25 20:27 ` [PATCH 07/11] drm/i915: Reorganize intel_lpe_audio_notify() arguments ville.syrjala
2017-04-25 20:27 ` [PATCH 08/11] drm/i915: Clean up the LPE audio platform data ville.syrjala
2017-04-25 20:27 ` ville.syrjala [this message]
2017-04-25 20:27 ` [PATCH 10/11] ALSA: x86: Split snd_intelhad into card and PCM specific structures ville.syrjala
2017-04-25 20:27 ` [PATCH 11/11] ALSA: x86: Register multiple PCM devices for the LPE audio card ville.syrjala
2017-04-26  1:58   ` Pierre-Louis Bossart
2017-04-26  7:04     ` [alsa-devel] " Takashi Iwai
2017-04-26  7:19       ` Takashi Iwai
2017-04-26 13:49         ` Ville Syrjälä
2017-04-26 14:04           ` Takashi Iwai
2017-04-25 20:46 ` ✓ Fi.CI.BAT: success for drm/i915: LPE audio runtime PM and multipipe Patchwork
2017-04-26  7:29 ` [PATCH 00/11] " Takashi Iwai
2017-04-26 13:38   ` Ville Syrjälä
2017-04-26 13:47     ` Takashi Iwai
2017-04-26 13:56       ` Ville Syrjälä
2017-04-26 19:59       ` Ville Syrjälä
2017-04-27 16:02 [PATCH v2 00/11] drm/i915: LPE audio runtime PM and multipipe (v2) ville.syrjala
2017-04-27 16:02 ` [PATCH 09/11] ALSA: x86: Prepare LPE audio ctls for multiple PCMs ville.syrjala

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=20170425202730.1384-10-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tiwai@suse.de \
    /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.