summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/x86/intel_hdmi_audio.c23
-rw-r--r--sound/x86/intel_hdmi_audio.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 9889cdf3ccf4..a30ca03e49ae 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -37,6 +37,7 @@
37#include <sound/pcm_params.h> 37#include <sound/pcm_params.h>
38#include <sound/initval.h> 38#include <sound/initval.h>
39#include <sound/control.h> 39#include <sound/control.h>
40#include <sound/jack.h>
40#include <drm/drm_edid.h> 41#include <drm/drm_edid.h>
41#include <drm/intel_lpe_audio.h> 42#include <drm/intel_lpe_audio.h>
42#include "intel_hdmi_audio.h" 43#include "intel_hdmi_audio.h"
@@ -1382,6 +1383,8 @@ static void had_process_hot_plug(struct snd_intelhad *intelhaddata)
1382 } 1383 }
1383 1384
1384 had_build_channel_allocation_map(intelhaddata); 1385 had_build_channel_allocation_map(intelhaddata);
1386
1387 snd_jack_report(intelhaddata->jack, SND_JACK_AVOUT);
1385} 1388}
1386 1389
1387/* process hot unplug, called from wq with mutex locked */ 1390/* process hot unplug, called from wq with mutex locked */
@@ -1414,6 +1417,7 @@ static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
1414 snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); 1417 snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
1415 1418
1416 out: 1419 out:
1420 snd_jack_report(intelhaddata->jack, 0);
1417 if (substream) 1421 if (substream)
1418 had_substream_put(intelhaddata); 1422 had_substream_put(intelhaddata);
1419 kfree(intelhaddata->chmap->chmap); 1423 kfree(intelhaddata->chmap->chmap);
@@ -1609,6 +1613,21 @@ static void had_audio_wq(struct work_struct *work)
1609} 1613}
1610 1614
1611/* 1615/*
1616 * Jack interface
1617 */
1618static int had_create_jack(struct snd_intelhad *ctx)
1619{
1620 int err;
1621
1622 err = snd_jack_new(ctx->card, "HDMI/DP", SND_JACK_AVOUT, &ctx->jack,
1623 true, false);
1624 if (err < 0)
1625 return err;
1626 ctx->jack->private_data = ctx;
1627 return 0;
1628}
1629
1630/*
1612 * PM callbacks 1631 * PM callbacks
1613 */ 1632 */
1614 1633
@@ -1780,6 +1799,10 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
1780 if (ret < 0) 1799 if (ret < 0)
1781 goto err; 1800 goto err;
1782 1801
1802 ret = had_create_jack(ctx);
1803 if (ret < 0)
1804 goto err;
1805
1783 ret = snd_card_register(card); 1806 ret = snd_card_register(card);
1784 if (ret) 1807 if (ret)
1785 goto err; 1808 goto err;
diff --git a/sound/x86/intel_hdmi_audio.h b/sound/x86/intel_hdmi_audio.h
index d6ba90fd011d..2d3e389f76b3 100644
--- a/sound/x86/intel_hdmi_audio.h
+++ b/sound/x86/intel_hdmi_audio.h
@@ -130,6 +130,7 @@ struct snd_intelhad {
130 struct work_struct hdmi_audio_wq; 130 struct work_struct hdmi_audio_wq;
131 struct mutex mutex; /* for protecting chmap and eld */ 131 struct mutex mutex; /* for protecting chmap and eld */
132 bool need_reset; 132 bool need_reset;
133 struct snd_jack *jack;
133}; 134};
134 135
135#endif /* _INTEL_HDMI_AUDIO_ */ 136#endif /* _INTEL_HDMI_AUDIO_ */