SND_SOC_DAPM_HP("Headphone Jack", NULL),
};
+static struct snd_soc_jack daisy_hdmi_jack;
+
static int get_hdmi(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;
struct snd_soc_card *card = codec->card;
struct device_node *dn = card->dev->of_node;
+ struct audio_codec_plugin *plugin;
if (dn) {
enum of_gpio_flags flags;
&daisy_hp_jack_gpio);
}
+ plugin = daisy_dapm_controls[0].private_value;
+ if (plugin)
+ snd_soc_jack_new(codec, "HDMI Jack",
+ SND_JACK_AVOUT, &daisy_hdmi_jack);
+
/* Microphone BIAS is needed to power the analog mic.
* MICBIAS2 is connected to analog mic (MIC3, which is in turn
* connected to MIC2 via 'External MIC') on Daisy.
snd_soc_jack_gpio_detect(&daisy_hp_jack_gpio);
}
+static int daisy_hdmi_jack_report(int plugged)
+{
+ snd_soc_jack_report(&daisy_hdmi_jack,
+ plugged ? SND_JACK_AVOUT : 0,
+ SND_JACK_AVOUT);
+ return 0;
+}
+
static struct snd_soc_dai_link daisy_dai[] = {
{ /* Primary DAI i/f */
.name = "MAX98095 RX",
return -EFAULT;
else
*pplugin = plugin;
+
+ plugin->jack_cb = daisy_hdmi_jack_report;
+
return 0;
}
{
struct hdmi_audio_context *ctx = container_of(work,
struct hdmi_audio_context, hotplug_work.work);
+ int plugged;
snd_printdd("[%d] %s plugged %d\n",
__LINE__, __func__, atomic_read(&ctx->plugged));
- if (atomic_read(&ctx->plugged)) {
+ plugged = atomic_read(&ctx->plugged);
+ if (plugged) {
hdmi_audio_control(ctx, false);
hdmi_conf_init(ctx);
hdmi_audio_init(ctx);
if (ctx->enabled)
hdmi_audio_control(ctx, true);
}
+
+ if (ctx->plugin.jack_cb)
+ ctx->plugin.jack_cb(plugged);
}
static irqreturn_t hdmi_audio_irq_handler(int irq, void *arg)