mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-05 09:36:39 -04:00
drm/bridge: analogix_dp: Add support for &drm_dp_aux.wait_hpd_asserted()
Add analogix_dpaux_wait_hpd_asserted() to help confirm the HPD state before doing AUX transfers. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20250310104114.2608063-8-damon.ding@rock-chips.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
committed by
Dmitry Baryshkov
parent
e5e9fa9f7a
commit
c8f0b7cb01
@@ -1540,6 +1540,26 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int analogix_dpaux_wait_hpd_asserted(struct drm_dp_aux *aux, unsigned long wait_us)
|
||||
{
|
||||
struct analogix_dp_device *dp = to_dp(aux);
|
||||
int val;
|
||||
int ret;
|
||||
|
||||
if (dp->force_hpd)
|
||||
return 0;
|
||||
|
||||
pm_runtime_get_sync(dp->dev);
|
||||
|
||||
ret = readx_poll_timeout(analogix_dp_get_plug_in_status, dp, val, !val,
|
||||
wait_us / 100, wait_us);
|
||||
|
||||
pm_runtime_mark_last_busy(dp->dev);
|
||||
pm_runtime_put_autosuspend(dp->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct analogix_dp_device *
|
||||
analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
||||
{
|
||||
@@ -1648,6 +1668,7 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
||||
|
||||
dp->aux.name = "DP-AUX";
|
||||
dp->aux.transfer = analogix_dpaux_transfer;
|
||||
dp->aux.wait_hpd_asserted = analogix_dpaux_wait_hpd_asserted;
|
||||
dp->aux.dev = dp->dev;
|
||||
drm_dp_aux_init(&dp->aux);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user