]>
Commit | Line | Data |
---|---|---|
ef332cb8 GKH |
1 | From foo@baz Tue Aug 28 16:10:37 CEST 2018 |
2 | From: Sean Paul <seanpaul@chromium.org> | |
3 | Date: Tue, 3 Jul 2018 12:56:03 -0400 | |
4 | Subject: drm/bridge: adv7511: Reset registers on hotplug | |
5 | ||
6 | From: Sean Paul <seanpaul@chromium.org> | |
7 | ||
8 | [ Upstream commit 5f3417569165a8ee57654217f73e0160312f409c ] | |
9 | ||
10 | The bridge loses its hw state when the cable is unplugged. If we detect | |
11 | this case in the hpd handler, reset its state. | |
12 | ||
13 | Reported-by: Rob Clark <robdclark@gmail.com> | |
14 | Tested-by: Rob Clark <robdclark@gmail.com> | |
15 | Reviewed-by: Archit Taneja <architt@codeaurora.org> | |
16 | Signed-off-by: Sean Paul <seanpaul@chromium.org> | |
17 | Link: https://patchwork.freedesktop.org/patch/msgid/20180703165648.120401-1-seanpaul@chromium.org | |
18 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
19 | Signed-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); |