drm/rockchip: cdn-dp: add hdmi-codec jack event
authorChris Zhong <zyw@rock-chips.com>
Thu, 24 Nov 2016 06:22:51 +0000 (14:22 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 20 Dec 2016 12:13:48 +0000 (20:13 +0800)
Use HDMI connection / disconnection notifications to update an ALSA
jack object.

Change-Id: Ia18537be1ddb899b7ac490560bf91d7de83eae02
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
drivers/gpu/drm/rockchip/cdn-dp-core.c

index 316a7ca26b0a162f6577b86556fc4a999e22d3fc..32a4e5f2cafad813240a904c4009fd02608ee41f 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/component.h>
 #include <linux/extcon.h>
 #include <linux/firmware.h>
+#include <linux/hdmi-notifier.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
 #include <linux/mfd/syscon.h>
@@ -653,6 +654,8 @@ static void cdn_dp_encoder_enable(struct drm_encoder *encoder)
        }
 out:
        mutex_unlock(&dp->lock);
+       if (!ret)
+               hdmi_event_connect(dp->dev);
 }
 
 static void cdn_dp_encoder_disable(struct drm_encoder *encoder)
@@ -669,6 +672,7 @@ static void cdn_dp_encoder_disable(struct drm_encoder *encoder)
                }
        }
        mutex_unlock(&dp->lock);
+       hdmi_event_disconnect(dp->dev);
 
        /*
         * In the following 2 cases, we need to run the event_work to re-enable