From 94dd525b0213cd73ee6ddbbb865ed6b0040e3241 Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Thu, 28 Dec 2017 16:32:30 +0800 Subject: [PATCH] drm/bridge/synopsys: Report hdmi HPD to userspace for cec When hdmi HPD is occurred, call cec_notifier_repo_cec_hpd. Change-Id: If2047121c8ccf55e9a49fa4c3c4ec2187248a593 Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index fa2ac02d197c..11b79d9e6daa 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -322,8 +322,19 @@ static void repo_hpd_event(struct work_struct *p_work) hdmi->rxsense = true; mutex_unlock(&hdmi->mutex); - if (hdmi->bridge.dev) - drm_helper_hpd_irq_event(hdmi->bridge.dev); + if (hdmi->bridge.dev) { + bool change; + + change = drm_helper_hpd_irq_event(hdmi->bridge.dev); + +#ifdef CONFIG_CEC_NOTIFIER + if (change) + cec_notifier_repo_cec_hpd(hdmi->cec_notifier, + hdmi->hpd_state, + ktime_get()); +#endif + } + #ifdef CONFIG_SWITCH if (hdmi->hpd_state) switch_set_state(&hdmi->switchdev, 1);