#include <sound/pcm_params.h>
#include <sound/initval.h>
#include <sound/control.h>
+#include <sound/jack.h>
#include <drm/drm_edid.h>
#include <drm/intel_lpe_audio.h>
#include "intel_hdmi_audio.h"
}
had_build_channel_allocation_map(intelhaddata);
+
+ snd_jack_report(intelhaddata->jack, SND_JACK_AVOUT);
}
/* process hot unplug, called from wq with mutex locked */
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
out:
+ snd_jack_report(intelhaddata->jack, 0);
if (substream)
had_substream_put(intelhaddata);
kfree(intelhaddata->chmap->chmap);
pm_runtime_put(ctx->dev);
}
+/*
+ * Jack interface
+ */
+static int had_create_jack(struct snd_intelhad *ctx)
+{
+ int err;
+
+ err = snd_jack_new(ctx->card, "HDMI/DP", SND_JACK_AVOUT, &ctx->jack,
+ true, false);
+ if (err < 0)
+ return err;
+ ctx->jack->private_data = ctx;
+ return 0;
+}
+
/*
* PM callbacks
*/
if (ret < 0)
goto err;
+ ret = had_create_jack(ctx);
+ if (ret < 0)
+ goto err;
+
ret = snd_card_register(card);
if (ret)
goto err;