The state readout of the OLDI transmitters needs to know how the firmware configured them, but the dispc helpers only allow to program the OLDI configuration register of a video port with tidss_configure_oldi() and to clear it with tidss_disable_oldi().
Add tidss_get_oldi_config() to read that register back. This is only needed by the OLDI state readout, which hasn't been tested yet, and should be folded into the dispc readout helpers if that one gets merged. Signed-off-by: Maxime Ripard <[email protected]> --- drivers/gpu/drm/tidss/tidss_dispc.c | 5 +++++ drivers/gpu/drm/tidss/tidss_dispc.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index 8e61216d4532..f7309daec908 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -495,10 +495,15 @@ int tidss_configure_oldi(struct tidss_device *tidss, u32 hw_videoport, void tidss_disable_oldi(struct tidss_device *tidss, u32 hw_videoport) { dispc_vp_write(tidss->dispc, hw_videoport, DISPC_VP_DSS_OLDI_CFG, 0); } +u32 tidss_get_oldi_config(struct tidss_device *tidss, u32 hw_videoport) +{ + return dispc_vp_read(tidss->dispc, hw_videoport, DISPC_VP_DSS_OLDI_CFG); +} + /* * TRM gives bitfields as start:end, where start is the higher bit * number. For example 7:0 */ diff --git a/drivers/gpu/drm/tidss/tidss_dispc.h b/drivers/gpu/drm/tidss/tidss_dispc.h index 4abcb9e679ac..c54ab9a92894 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.h +++ b/drivers/gpu/drm/tidss/tidss_dispc.h @@ -100,10 +100,11 @@ extern const struct dispc_features dispc_am65x_feats; extern const struct dispc_features dispc_j721e_feats; int tidss_configure_oldi(struct tidss_device *tidss, u32 hw_videoport, u32 oldi_cfg); void tidss_disable_oldi(struct tidss_device *tidss, u32 hw_videoport); +u32 tidss_get_oldi_config(struct tidss_device *tidss, u32 hw_videoport); unsigned int dispc_pclk_diff(unsigned long rate, unsigned long real_rate); void dispc_set_irqenable(struct dispc_device *dispc, dispc_irq_t mask); dispc_irq_t dispc_read_and_clear_irqstatus(struct dispc_device *dispc); -- 2.56.1
