[alsa-devel] [PATCH v8 0/5] ASoC: MT8173 HDMI jack detection
Hi,
now that kernel v4.8-rc1 is released and includes the new CEC framework in drivers/staging/media/cec, I wonder how to proceed with this. To allow the ASoC drivers to present HDMI cable connection state as an ALSA jack, and to allow them to update sink capabilities when it signals an EDID change, we need a notification mechanism between CEC/HDMI, and ALSA drivers.
I had used Russell's hdmi notification prototype to let the CEC/HDMI drivers notify the hdmi-codec and ASoC machine drivers of changes. The mtk_cec driver currently is just a placeholder that only handles the HPD interrupts.
Should the notifications be integrated with the CEC framework for those devices that do have CEC support?
Changes since v7 ("ASoC: MT8173 HDMI codec support"): - Dropped the already applied ELD control and machine driver patches - Dropped the N/CTS helper patch for now, as the helpers don't exist yet. - Lock ELD mutex while copying ELD in hdmi_eld_ctl_get
regards Philipp
Philipp Zabel (5): video: rmk's HDMI notification prototype ASoC: hdmi-codec: Use HDMI notifications to add jack support ASoC: mediatek: Add jack detection support to mt8173-rt5650-rt5676 machine driver ASoC: mediatek: Add jack detection support to the mt8173-rt5650 machine driver drm/mediatek: hdmi: issue notifications
drivers/gpu/drm/mediatek/mtk_cec.c | 11 +++ drivers/gpu/drm/mediatek/mtk_hdmi.c | 3 + drivers/video/Kconfig | 3 + drivers/video/Makefile | 1 + drivers/video/hdmi-notifier.c | 61 ++++++++++++++++ include/linux/hdmi-notifier.h | 44 ++++++++++++ include/sound/hdmi-codec.h | 6 ++ sound/soc/codecs/Kconfig | 1 + sound/soc/codecs/hdmi-codec.c | 88 +++++++++++++++++++++--- sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 21 ++++++ sound/soc/mediatek/mt8173/mt8173-rt5650.c | 21 ++++++ 11 files changed, 252 insertions(+), 8 deletions(-) create mode 100644 drivers/video/hdmi-notifier.c create mode 100644 include/linux/hdmi-notifier.h
This is Russell's HDMI notification prototype [1], currently waiting for the HDMI CEC situation to resolve.
The use case for the notifications on MediaTek MT8173 is to let the (dis)connection notifications control an ALSA jack object.
No Signed-off-by since this is not my code, and still up for discussion.
[1] https://patchwork.kernel.org/patch/8351501/ --- drivers/video/Kconfig | 3 +++ drivers/video/Makefile | 1 + drivers/video/hdmi-notifier.c | 61 +++++++++++++++++++++++++++++++++++++++++++ include/linux/hdmi-notifier.h | 44 +++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 drivers/video/hdmi-notifier.c create mode 100644 include/linux/hdmi-notifier.h
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 3c20af9..1ee7b9f 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -36,6 +36,9 @@ config VIDEOMODE_HELPERS config HDMI bool
+config HDMI_NOTIFIERS + bool + if VT source "drivers/video/console/Kconfig" endif diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 9ad3c17..65f5649 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_VGASTATE) += vgastate.o obj-$(CONFIG_HDMI) += hdmi.o +obj-$(CONFIG_HDMI_NOTIFIERS) += hdmi-notifier.o
obj-$(CONFIG_VT) += console/ obj-$(CONFIG_LOGO) += logo/ diff --git a/drivers/video/hdmi-notifier.c b/drivers/video/hdmi-notifier.c new file mode 100644 index 0000000..a233359 --- /dev/null +++ b/drivers/video/hdmi-notifier.c @@ -0,0 +1,61 @@ +#include <linux/export.h> +#include <linux/hdmi-notifier.h> +#include <linux/notifier.h> +#include <linux/string.h> + +static BLOCKING_NOTIFIER_HEAD(hdmi_notifier); + +int hdmi_register_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&hdmi_notifier, nb); +} +EXPORT_SYMBOL_GPL(hdmi_register_notifier); + +int hdmi_unregister_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_unregister(&hdmi_notifier, nb); +} +EXPORT_SYMBOL_GPL(hdmi_unregister_notifier); + +void hdmi_event_connect(struct device *dev) +{ + struct hdmi_event_base base; + + base.source = dev; + + blocking_notifier_call_chain(&hdmi_notifier, HDMI_CONNECTED, &base); +} +EXPORT_SYMBOL_GPL(hdmi_event_connect); + +void hdmi_event_disconnect(struct device *dev) +{ + struct hdmi_event_base base; + + base.source = dev; + + blocking_notifier_call_chain(&hdmi_notifier, HDMI_DISCONNECTED, &base); +} +EXPORT_SYMBOL_GPL(hdmi_event_disconnect); + +void hdmi_event_new_edid(struct device *dev, const void *edid, size_t size) +{ + struct hdmi_event_new_edid new_edid; + + new_edid.base.source = dev; + new_edid.edid = edid; + new_edid.size = size; + + blocking_notifier_call_chain(&hdmi_notifier, HDMI_NEW_EDID, &new_edid); +} +EXPORT_SYMBOL_GPL(hdmi_event_new_edid); + +void hdmi_event_new_eld(struct device *dev, const void *eld) +{ + struct hdmi_event_new_eld new_eld; + + new_eld.base.source = dev; + memcpy(new_eld.eld, eld, sizeof(new_eld.eld)); + + blocking_notifier_call_chain(&hdmi_notifier, HDMI_NEW_ELD, &new_eld); +} +EXPORT_SYMBOL_GPL(hdmi_event_new_eld); diff --git a/include/linux/hdmi-notifier.h b/include/linux/hdmi-notifier.h new file mode 100644 index 0000000..9c5ad49 --- /dev/null +++ b/include/linux/hdmi-notifier.h @@ -0,0 +1,44 @@ +#ifndef LINUX_HDMI_NOTIFIER_H +#define LINUX_HDMI_NOTIFIER_H + +#include <linux/types.h> + +enum { + HDMI_CONNECTED, + HDMI_DISCONNECTED, + HDMI_NEW_EDID, + HDMI_NEW_ELD, +}; + +struct hdmi_event_base { + struct device *source; +}; + +struct hdmi_event_new_edid { + struct hdmi_event_base base; + const void *edid; + size_t size; +}; + +struct hdmi_event_new_eld { + struct hdmi_event_base base; + unsigned char eld[128]; +}; + +union hdmi_event { + struct hdmi_event_base base; + struct hdmi_event_new_edid edid; + struct hdmi_event_new_eld eld; +}; + +struct notifier_block; + +int hdmi_register_notifier(struct notifier_block *nb); +int hdmi_unregister_notifier(struct notifier_block *nb); + +void hdmi_event_connect(struct device *dev); +void hdmi_event_disconnect(struct device *dev); +void hdmi_event_new_edid(struct device *dev, const void *edid, size_t size); +void hdmi_event_new_eld(struct device *dev, const void *eld); + +#endif
On Thu, Aug 11, 2016 at 11:20:23AM +0200, Philipp Zabel wrote:
This is Russell's HDMI notification prototype [1], currently waiting for the HDMI CEC situation to resolve.
The use case for the notifications on MediaTek MT8173 is to let the (dis)connection notifications control an ALSA jack object.
No Signed-off-by since this is not my code, and still up for discussion.
Well, I have two drivers (both CEC drivers) which use this, and I still don't see any alternative solution to the problem that this patch is solving.
I don't think it's really a CEC problem - there's three bits to HDMI that need to track each others state - the video, audio and CEC paths.
While the video and audio paths may be one block, the CEC path may actually be a separate block. For example, the TDA998x devices integrate the HDMI video/audio block along with a TDA9950 on the same device - the TDA9950 being a CEC engine. The TDA9950 is also available as a separate device, and even when integrated with HDMI, it appears on the I2C bus as a seperate device.
So, splitting the functionality is definitely the right model. We just need some way to keep each blocks state in sync. What's provided in this patch is the simple solution which seems to work for the use cases we have.
I think, in light of no comments against this approach, and no other approach being available, that this is good enough justification to merge this, especially as it is blocking other work.
So... if people want to give me reviewed-by/acked-bys, I'll add them to my patch, and I'll post that and the dw-hdmi and tda9950 CEC drivers.
Am Donnerstag, den 11.08.2016, 11:18 +0100 schrieb Russell King - ARM Linux:
On Thu, Aug 11, 2016 at 11:20:23AM +0200, Philipp Zabel wrote:
This is Russell's HDMI notification prototype [1], currently waiting for the HDMI CEC situation to resolve.
The use case for the notifications on MediaTek MT8173 is to let the (dis)connection notifications control an ALSA jack object.
No Signed-off-by since this is not my code, and still up for discussion.
Well, I have two drivers (both CEC drivers) which use this, and I still don't see any alternative solution to the problem that this patch is solving.
I don't think it's really a CEC problem - there's three bits to HDMI that need to track each others state - the video, audio and CEC paths.
While the video and audio paths may be one block, the CEC path may actually be a separate block. For example, the TDA998x devices integrate the HDMI video/audio block along with a TDA9950 on the same device - the TDA9950 being a CEC engine. The TDA9950 is also available as a separate device, and even when integrated with HDMI, it appears on the I2C bus as a seperate device.
So, splitting the functionality is definitely the right model. We just need some way to keep each blocks state in sync. What's provided in this patch is the simple solution which seems to work for the use cases we have.
Yes, it works fine for the MT8173 use case.
I think, in light of no comments against this approach, and no other approach being available, that this is good enough justification to merge this, especially as it is blocking other work.
So... if people want to give me reviewed-by/acked-bys, I'll add them to my patch, and I'll post that and the dw-hdmi and tda9950 CEC drivers.
Acked-by: Philipp Zabel p.zabel@pengutronix.de
regards Philipp
Use HDMI connection / disconnection notifications to update an ALSA jack object. Also make a copy of the ELD block after every change.
Signed-off-by: Philipp Zabel p.zabel@pengutronix.de --- Changes since v7: - Lock ELD mutex while copying ELD in hdmi_eld_ctl_get --- include/sound/hdmi-codec.h | 6 +++ sound/soc/codecs/Kconfig | 1 + sound/soc/codecs/hdmi-codec.c | 88 +++++++++++++++++++++++++++++++++++++++---- 3 files changed, 87 insertions(+), 8 deletions(-)
diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 530c57b..0fd2e38 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -98,6 +98,12 @@ struct hdmi_codec_pdata { void *data; };
+struct snd_soc_codec; +struct snd_soc_jack; + +int hdmi_codec_set_jack_detect(struct snd_soc_codec *codec, + struct snd_soc_jack *jack); + #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec"
#endif /* __HDMI_CODEC_H__ */ diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 1cd6ab3..f8c5e3e 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -508,6 +508,7 @@ config SND_SOC_HDMI_CODEC select SND_PCM_ELD select SND_PCM_IEC958 select HDMI + select HDMI_NOTIFIERS
config SND_SOC_ES8328 tristate "Everest Semi ES8328 CODEC" diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index f27d115..973892b 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -12,9 +12,12 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ +#include <linux/hdmi-notifier.h> #include <linux/module.h> +#include <linux/notifier.h> #include <linux/string.h> #include <sound/core.h> +#include <sound/jack.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> @@ -27,11 +30,16 @@ struct hdmi_codec_priv { struct hdmi_codec_pdata hcd; struct snd_soc_dai_driver *daidrv; + struct snd_soc_jack *jack; struct hdmi_codec_daifmt daifmt[2]; struct mutex current_stream_lock; struct snd_pcm_substream *current_stream; struct snd_pcm_hw_constraint_list ratec; + struct mutex eld_lock; uint8_t eld[MAX_ELD_BYTES]; + struct device *dev; + struct notifier_block nb; + unsigned int jack_status; };
static const struct snd_soc_dapm_widget hdmi_widgets[] = { @@ -65,7 +73,9 @@ static int hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol, struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
+ mutex_lock(&hcp->eld_lock); memcpy(ucontrol->value.bytes.data, hcp->eld, sizeof(hcp->eld)); + mutex_unlock(&hcp->eld_lock);
return 0; } @@ -103,7 +113,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); - int ret = 0; + int ret;
dev_dbg(dai->dev, "%s()\n", __func__);
@@ -122,17 +132,15 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, }
if (hcp->hcd.ops->get_eld) { + mutex_lock(&hcp->eld_lock); ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data, hcp->eld, sizeof(hcp->eld)); - - if (!ret) { + if (!ret) ret = snd_pcm_hw_constraint_eld(substream->runtime, hcp->eld); - if (ret) - return ret; - } + mutex_unlock(&hcp->eld_lock); } - return 0; + return ret; }
static void hdmi_codec_shutdown(struct snd_pcm_substream *substream, @@ -355,6 +363,63 @@ static struct snd_soc_codec_driver hdmi_codec = { .num_dapm_routes = ARRAY_SIZE(hdmi_routes), };
+static void hdmi_codec_jack_report(struct hdmi_codec_priv *hcp, + unsigned int jack_status) +{ + if (!hcp->jack) + return; + + if (jack_status != hcp->jack_status) { + snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT); + hcp->jack_status = jack_status; + } +} + +static int hdmi_codec_notify(struct notifier_block *nb, unsigned long event, + void *data) +{ + struct hdmi_codec_priv *hcp = container_of(nb, struct hdmi_codec_priv, + nb); + union hdmi_event *event_block = data; + + if (hcp->dev->parent != event_block->base.source) + return NOTIFY_OK; + + if (!hcp->jack) + return NOTIFY_OK; + + switch (event) { + case HDMI_CONNECTED: + hdmi_codec_jack_report(hcp, SND_JACK_LINEOUT); + break; + case HDMI_DISCONNECTED: + hdmi_codec_jack_report(hcp, 0); + break; + case HDMI_NEW_ELD: + hdmi_codec_jack_report(hcp, SND_JACK_LINEOUT); + mutex_lock(&hcp->eld_lock); + memcpy(hcp->eld, event_block->eld.eld, sizeof(hcp->eld)); + mutex_unlock(&hcp->eld_lock); + break; + } + + return NOTIFY_OK; +} + +int hdmi_codec_set_jack_detect(struct snd_soc_codec *codec, + struct snd_soc_jack *jack) +{ + struct hdmi_codec_priv *hcp = snd_soc_codec_get_drvdata(codec); + + hcp->jack = jack; + hcp->nb.notifier_call = hdmi_codec_notify; + + hdmi_register_notifier(&hcp->nb); + + return 0; +} +EXPORT_SYMBOL_GPL(hdmi_codec_set_jack_detect); + static int hdmi_codec_probe(struct platform_device *pdev) { struct hdmi_codec_pdata *hcd = pdev->dev.platform_data; @@ -383,6 +448,7 @@ static int hdmi_codec_probe(struct platform_device *pdev)
hcp->hcd = *hcd; mutex_init(&hcp->current_stream_lock); + mutex_init(&hcp->eld_lock);
hcp->daidrv = devm_kzalloc(dev, dai_count * sizeof(*hcp->daidrv), GFP_KERNEL); @@ -399,6 +465,8 @@ static int hdmi_codec_probe(struct platform_device *pdev) if (hcd->spdif) hcp->daidrv[i] = hdmi_spdif_dai;
+ dev_set_drvdata(dev, hcp); + ret = snd_soc_register_codec(dev, &hdmi_codec, hcp->daidrv, dai_count); if (ret) { @@ -407,12 +475,16 @@ static int hdmi_codec_probe(struct platform_device *pdev) return ret; }
- dev_set_drvdata(dev, hcp); + hcp->dev = dev; + return 0; }
static int hdmi_codec_remove(struct platform_device *pdev) { + struct hdmi_codec_priv *hcp = platform_get_drvdata(pdev); + + hdmi_unregister_notifier(&hcp->nb); snd_soc_unregister_codec(&pdev->dev); return 0; }
On Thu, Aug 11, 2016 at 11:20:24AM +0200, Philipp Zabel wrote:
Use HDMI connection / disconnection notifications to update an ALSA jack object. Also make a copy of the ELD block after every change.
Acked-by: Mark Brown broonie@kernel.org
Signed-off-by: Philipp Zabel p.zabel@pengutronix.de --- sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c index 1b8b2a7..707eeaf 100644 --- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c +++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c @@ -18,6 +18,7 @@ #include <linux/gpio.h> #include <linux/of_gpio.h> #include <sound/soc.h> +#include <sound/hdmi-codec.h> #include <sound/jack.h> #include "../../codecs/rt5645.h" #include "../../codecs/rt5677.h" @@ -131,6 +132,25 @@ static struct snd_soc_dai_link_component mt8173_rt5650_rt5676_codecs[] = { }, };
+static struct snd_soc_jack mt8173_hdmi_card_jack; + +static int mt8173_hdmi_init(struct snd_soc_pcm_runtime *runtime) +{ + struct snd_soc_card *card = runtime->card; + struct snd_soc_codec *codec = runtime->codec; + int ret; + + /* enable jack detection */ + ret = snd_soc_card_jack_new(card, "HDMI Jack", SND_JACK_LINEOUT, + &mt8173_hdmi_card_jack, NULL, 0); + if (ret) { + dev_err(card->dev, "Can't new HDMI Jack %d\n", ret); + return ret; + } + + return hdmi_codec_set_jack_detect(codec, &mt8173_hdmi_card_jack); +} + enum { DAI_LINK_PLAYBACK, DAI_LINK_CAPTURE, @@ -195,6 +215,7 @@ static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = { .no_pcm = 1, .codec_dai_name = "i2s-hifi", .dpcm_playback = 1, + .init = mt8173_hdmi_init, }, /* rt5676 <-> rt5650 intercodec link: Sets rt5676 I2S2 as master */ [DAI_LINK_INTERCODEC] = {
On Thu, Aug 11, 2016 at 11:20:25AM +0200, Philipp Zabel wrote:
Signed-off-by: Philipp Zabel p.zabel@pengutronix.de
Acked-by: Mark Brown broonie@kernel.org
Signed-off-by: Philipp Zabel p.zabel@pengutronix.de --- sound/soc/mediatek/mt8173/mt8173-rt5650.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c b/sound/soc/mediatek/mt8173/mt8173-rt5650.c index ba65f41..64ae9ad 100644 --- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c +++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c @@ -18,6 +18,7 @@ #include <linux/gpio.h> #include <linux/of_gpio.h> #include <sound/soc.h> +#include <sound/hdmi-codec.h> #include <sound/jack.h> #include "../../codecs/rt5645.h"
@@ -166,6 +167,25 @@ static struct snd_soc_dai_link_component mt8173_rt5650_codecs[] = { }, };
+static struct snd_soc_jack mt8173_hdmi_card_jack; + +static int mt8173_hdmi_init(struct snd_soc_pcm_runtime *runtime) +{ + struct snd_soc_card *card = runtime->card; + struct snd_soc_codec *codec = runtime->codec; + int ret; + + /* enable jack detection */ + ret = snd_soc_card_jack_new(card, "HDMI Jack", SND_JACK_LINEOUT, + &mt8173_hdmi_card_jack, NULL, 0); + if (ret) { + dev_err(card->dev, "Can't new HDMI Jack %d\n", ret); + return ret; + } + + return hdmi_codec_set_jack_detect(codec, &mt8173_hdmi_card_jack); +} + enum { DAI_LINK_PLAYBACK, DAI_LINK_CAPTURE, @@ -228,6 +248,7 @@ static struct snd_soc_dai_link mt8173_rt5650_dais[] = { .no_pcm = 1, .codec_dai_name = "i2s-hifi", .dpcm_playback = 1, + .init = mt8173_hdmi_init, }, };
On Thu, Aug 11, 2016 at 11:20:26AM +0200, Philipp Zabel wrote:
Signed-off-by: Philipp Zabel p.zabel@pengutronix.de
Acked-by: Mark Brown broonie@kernel.org
Issue hot-plug detection, EDID update, and ELD update notifications from the CEC and HDMI drivers.
Signed-off-by: Philipp Zabel p.zabel@pengutronix.de --- drivers/gpu/drm/mediatek/mtk_cec.c | 11 +++++++++++ drivers/gpu/drm/mediatek/mtk_hdmi.c | 3 +++ 2 files changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c index 7a3eb8c..f78a73c 100644 --- a/drivers/gpu/drm/mediatek/mtk_cec.c +++ b/drivers/gpu/drm/mediatek/mtk_cec.c @@ -13,6 +13,7 @@ */ #include <linux/clk.h> #include <linux/delay.h> +#include <linux/hdmi-notifier.h> #include <linux/io.h> #include <linux/interrupt.h> #include <linux/platform_device.h> @@ -105,6 +106,12 @@ void mtk_cec_set_hpd_event(struct device *dev, cec->hdmi_dev = hdmi_dev; cec->hpd_event = hpd_event; spin_unlock_irqrestore(&cec->lock, flags); + + /* Initial notification event to set jack state */ + if (mtk_cec_hpd_high(dev)) + hdmi_event_connect(hdmi_dev); + else + hdmi_event_disconnect(hdmi_dev); }
bool mtk_cec_hpd_high(struct device *dev) @@ -179,6 +186,10 @@ static irqreturn_t mtk_cec_htplg_isr_thread(int irq, void *arg) if (cec->hpd != hpd) { dev_dbg(dev, "hotplug event! cur hpd = %d, hpd = %d\n", cec->hpd, hpd); + if (hpd) + hdmi_event_connect(cec->hdmi_dev); + else + hdmi_event_disconnect(cec->hdmi_dev); cec->hpd = hpd; mtk_cec_hpd_event(cec, hpd); } diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 334562d..478aa73 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -20,6 +20,7 @@ #include <linux/clk.h> #include <linux/delay.h> #include <linux/hdmi.h> +#include <linux/hdmi-notifier.h> #include <linux/i2c.h> #include <linux/io.h> #include <linux/kernel.h> @@ -1225,9 +1226,11 @@ static int mtk_hdmi_conn_get_modes(struct drm_connector *conn) hdmi->dvi_mode = !drm_detect_monitor_audio(edid);
drm_mode_connector_update_edid_property(conn, edid); + hdmi_event_new_edid(hdmi->dev, edid, sizeof(*edid));
ret = drm_add_edid_modes(conn, edid); drm_edid_to_eld(conn, edid); + hdmi_event_new_eld(hdmi->dev, conn->eld); kfree(edid); return ret; }
participants (3)
-
Mark Brown
-
Philipp Zabel
-
Russell King - ARM Linux