Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Nikita Travkin and committed by
Douglas Anderson
34c1aeb5 91c249b2

+19
+19
drivers/gpu/drm/bridge/ti-sn65dsi86.c
··· 618 618 return len; 619 619 } 620 620 621 + static int ti_sn_aux_wait_hpd_asserted(struct drm_dp_aux *aux, unsigned long wait_us) 622 + { 623 + /* 624 + * The HPD in this chip is a bit useless (See comment in 625 + * ti_sn65dsi86_enable_comms) so if our driver is expected to wait 626 + * for HPD, we just assume it's asserted after the wait_us delay. 627 + * 628 + * In case we are asked to wait forever (wait_us=0) take conservative 629 + * 500ms delay. 630 + */ 631 + if (wait_us == 0) 632 + wait_us = 500000; 633 + 634 + usleep_range(wait_us, wait_us + 1000); 635 + 636 + return 0; 637 + } 638 + 621 639 static int ti_sn_aux_probe(struct auxiliary_device *adev, 622 640 const struct auxiliary_device_id *id) 623 641 { ··· 645 627 pdata->aux.name = "ti-sn65dsi86-aux"; 646 628 pdata->aux.dev = &adev->dev; 647 629 pdata->aux.transfer = ti_sn_aux_transfer; 630 + pdata->aux.wait_hpd_asserted = ti_sn_aux_wait_hpd_asserted; 648 631 drm_dp_aux_init(&pdata->aux); 649 632 650 633 ret = devm_of_dp_aux_populate_ep_devices(&pdata->aux);