Skip to content

Commit

Permalink
drm/bridge: adv7511: Reset registers on hotplug
Browse files Browse the repository at this point in the history
The bridge loses its hw state when the cable is unplugged. If we detect
this case in the hpd handler, reset its state.

Reported-by: Rob Clark <[email protected]>
Tested-by: Rob Clark <[email protected]>
Reviewed-by: Archit Taneja <[email protected]>
Signed-off-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
atseanpaul committed Jul 9, 2018
1 parent 3156b53 commit 5f34175
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ static void adv7511_hpd_work(struct work_struct *work)
else
status = connector_status_disconnected;

/*
* The bridge resets its registers on unplug. So when we get a plug
* event and we're already supposed to be powered, cycle the bridge to
* restore its state.
*/
if (status == connector_status_connected &&
adv7511->connector.status == connector_status_disconnected &&
adv7511->powered) {
regcache_mark_dirty(adv7511->regmap);
adv7511_power_on(adv7511);
}

if (adv7511->connector.status != status) {
adv7511->connector.status = status;
if (status == connector_status_disconnected)
Expand Down

0 comments on commit 5f34175

Please sign in to comment.