mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
drm/rockchip: dw-dp: update gpio hpd state when init stage
The gpio hpd state will be mismatch the real state if the cable
plug before init the dp controller. So it need updage the gpio
hpd state when dp controller init.
Fixes: 601aff2337 ("drm/rockchip: dw-dp: optimize the logic to deal with hpd")
Change-Id: I6b7a3d88e2ef70e54ad9465859c1a55205f10c4f
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
This commit is contained in:
@@ -2843,7 +2843,6 @@ static irqreturn_t dw_dp_hpd_irq_handler(int irq, void *arg)
|
||||
dp->hotplug.long_hpd = true;
|
||||
dp->hotplug.status = hpd;
|
||||
dp->hotplug.state = GPIO_STATE_PLUG;
|
||||
schedule_work(&dp->hpd_work);
|
||||
}
|
||||
} else if (dp->hotplug.state == GPIO_STATE_PLUG) {
|
||||
if (!hpd) {
|
||||
@@ -2858,9 +2857,12 @@ static irqreturn_t dw_dp_hpd_irq_handler(int irq, void *arg)
|
||||
dp->hotplug.long_hpd = false;
|
||||
dp->hotplug.status = hpd;
|
||||
dp->hotplug.state = GPIO_STATE_PLUG;
|
||||
schedule_work(&dp->hpd_work);
|
||||
}
|
||||
}
|
||||
|
||||
if (hpd)
|
||||
schedule_work(&dp->hpd_work);
|
||||
|
||||
mutex_unlock(&dp->irq_lock);
|
||||
|
||||
|
||||
@@ -2870,6 +2872,10 @@ static irqreturn_t dw_dp_hpd_irq_handler(int irq, void *arg)
|
||||
static void dw_dp_hpd_init(struct dw_dp *dp)
|
||||
{
|
||||
dp->hotplug.status = dw_dp_detect_no_power(dp);
|
||||
if (dp->hpd_gpio && dp->hotplug.status) {
|
||||
dp->hotplug.state = GPIO_STATE_PLUG;
|
||||
dp->hotplug.long_hpd = true;
|
||||
}
|
||||
|
||||
if (dp->hpd_gpio || dp->force_hpd || dp->usbdp_hpd) {
|
||||
regmap_update_bits(dp->regmap, DPTX_CCTL, FORCE_HPD,
|
||||
|
||||
Reference in New Issue
Block a user