drm/bridge: ti-sn65dsi86: Implement wait_hpd_asserted

This bridge doesn't actually implement HPD due to it being way too slow
but instead expects the panel driver to wait enough to assume HPD is
asserted. However some panels (such as the generic 'edp-panel') expect
the bridge to deal with the delay and pass maximum delay to the aux
instead.

In order to support such panels, add a dummy implementation of wait
that would just sleep the maximum delay and assume no failure has
happened.

Signed-off-by: Nikita Travkin <nikita@trvn.ru>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230408082014.235425-1-nikita@trvn.ru
This commit is contained in:
Nikita Travkin
2023-04-08 13:20:14 +05:00
committed by Douglas Anderson
parent 91c249b2b9
commit 34c1aeb579

View File

@@ -618,6 +618,24 @@ exit:
return len; return len;
} }
static int ti_sn_aux_wait_hpd_asserted(struct drm_dp_aux *aux, unsigned long wait_us)
{
/*
* The HPD in this chip is a bit useless (See comment in
* ti_sn65dsi86_enable_comms) so if our driver is expected to wait
* for HPD, we just assume it's asserted after the wait_us delay.
*
* In case we are asked to wait forever (wait_us=0) take conservative
* 500ms delay.
*/
if (wait_us == 0)
wait_us = 500000;
usleep_range(wait_us, wait_us + 1000);
return 0;
}
static int ti_sn_aux_probe(struct auxiliary_device *adev, static int ti_sn_aux_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id) const struct auxiliary_device_id *id)
{ {
@@ -627,6 +645,7 @@ static int ti_sn_aux_probe(struct auxiliary_device *adev,
pdata->aux.name = "ti-sn65dsi86-aux"; pdata->aux.name = "ti-sn65dsi86-aux";
pdata->aux.dev = &adev->dev; pdata->aux.dev = &adev->dev;
pdata->aux.transfer = ti_sn_aux_transfer; pdata->aux.transfer = ti_sn_aux_transfer;
pdata->aux.wait_hpd_asserted = ti_sn_aux_wait_hpd_asserted;
drm_dp_aux_init(&pdata->aux); drm_dp_aux_init(&pdata->aux);
ret = devm_of_dp_aux_populate_ep_devices(&pdata->aux); ret = devm_of_dp_aux_populate_ep_devices(&pdata->aux);