]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.154/drm-bridge-adv7511-reset-registers-on-hotplug.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.154 / drm-bridge-adv7511-reset-registers-on-hotplug.patch
CommitLineData
ef332cb8
GKH
1From foo@baz Tue Aug 28 16:10:37 CEST 2018
2From: Sean Paul <seanpaul@chromium.org>
3Date: Tue, 3 Jul 2018 12:56:03 -0400
4Subject: drm/bridge: adv7511: Reset registers on hotplug
5
6From: Sean Paul <seanpaul@chromium.org>
7
8[ Upstream commit 5f3417569165a8ee57654217f73e0160312f409c ]
9
10The bridge loses its hw state when the cable is unplugged. If we detect
11this case in the hpd handler, reset its state.
12
13Reported-by: Rob Clark <robdclark@gmail.com>
14Tested-by: Rob Clark <robdclark@gmail.com>
15Reviewed-by: Archit Taneja <architt@codeaurora.org>
16Signed-off-by: Sean Paul <seanpaul@chromium.org>
17Link: https://patchwork.freedesktop.org/patch/msgid/20180703165648.120401-1-seanpaul@chromium.org
18Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 drivers/gpu/drm/i2c/adv7511.c | 12 ++++++++++++
22 1 file changed, 12 insertions(+)
23
24--- a/drivers/gpu/drm/i2c/adv7511.c
25+++ b/drivers/gpu/drm/i2c/adv7511.c
26@@ -450,6 +450,18 @@ static void adv7511_hpd_work(struct work
27 else
28 status = connector_status_disconnected;
29
30+ /*
31+ * The bridge resets its registers on unplug. So when we get a plug
32+ * event and we're already supposed to be powered, cycle the bridge to
33+ * restore its state.
34+ */
35+ if (status == connector_status_connected &&
36+ adv7511->connector.status == connector_status_disconnected &&
37+ adv7511->powered) {
38+ regcache_mark_dirty(adv7511->regmap);
39+ adv7511_power_on(adv7511);
40+ }
41+
42 if (adv7511->connector.status != status) {
43 adv7511->connector.status = status;
44 drm_kms_helper_hotplug_event(adv7511->connector.dev);