diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2017-04-27 12:02:28 -0400 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2017-05-03 09:21:44 -0400 |
commit | bb4ac5a0ecaeeef0229c69f6c935be2ee70abfec (patch) | |
tree | f19387905e7bdf4173b9e5b3912229e6d225d427 /sound/x86 | |
parent | a8562e4dec9c835e3c3b77e2ebfcef89dff9efb4 (diff) |
ALSA: x86: Prepare LPE audio ctls for multiple PCMs
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>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-10-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/x86')
-rw-r--r-- | sound/x86/intel_hdmi_audio.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index c2b78621852e..69e10845633a 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) | |||
1609 | /* | 1609 | /* |
1610 | * Jack interface | 1610 | * Jack interface |
1611 | */ | 1611 | */ |
1612 | static int had_create_jack(struct snd_intelhad *ctx) | 1612 | static int had_create_jack(struct snd_intelhad *ctx, |
1613 | struct snd_pcm *pcm) | ||
1613 | { | 1614 | { |
1615 | char hdmi_str[32]; | ||
1614 | int err; | 1616 | int err; |
1615 | 1617 | ||
1616 | err = snd_jack_new(ctx->card, "HDMI/DP", SND_JACK_AVOUT, &ctx->jack, | 1618 | snprintf(hdmi_str, sizeof(hdmi_str), |
1619 | "HDMI/DP,pcm=%d", pcm->device); | ||
1620 | |||
1621 | err = snd_jack_new(ctx->card, hdmi_str, SND_JACK_AVOUT, &ctx->jack, | ||
1617 | true, false); | 1622 | true, false); |
1618 | if (err < 0) | 1623 | if (err < 0) |
1619 | return err; | 1624 | return err; |
@@ -1793,7 +1798,17 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) | |||
1793 | 1798 | ||
1794 | /* create controls */ | 1799 | /* create controls */ |
1795 | for (i = 0; i < ARRAY_SIZE(had_controls); i++) { | 1800 | for (i = 0; i < ARRAY_SIZE(had_controls); i++) { |
1796 | ret = snd_ctl_add(card, snd_ctl_new1(&had_controls[i], ctx)); | 1801 | struct snd_kcontrol *kctl; |
1802 | |||
1803 | kctl = snd_ctl_new1(&had_controls[i], ctx); | ||
1804 | if (!kctl) { | ||
1805 | ret = -ENOMEM; | ||
1806 | goto err; | ||
1807 | } | ||
1808 | |||
1809 | kctl->id.device = pcm->device; | ||
1810 | |||
1811 | ret = snd_ctl_add(card, kctl); | ||
1797 | if (ret < 0) | 1812 | if (ret < 0) |
1798 | goto err; | 1813 | goto err; |
1799 | } | 1814 | } |
@@ -1805,7 +1820,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) | |||
1805 | if (ret < 0) | 1820 | if (ret < 0) |
1806 | goto err; | 1821 | goto err; |
1807 | 1822 | ||
1808 | ret = had_create_jack(ctx); | 1823 | ret = had_create_jack(ctx, pcm); |
1809 | if (ret < 0) | 1824 | if (ret < 0) |
1810 | goto err; | 1825 | goto err; |
1811 | 1826 | ||