mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
drm/display: dp-tunnel: use new DCPD access helpers
Switch drm_dp_tunnel.c to use new set of DPCD read / write helpers. Reviewed-by: Lyude Paul <lyude@redhat.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-6-e80ff89593df@oss.qualcomm.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
parent
2554da0de3
commit
95c4ea2e03
|
|
@ -222,7 +222,7 @@ static int read_tunnel_regs(struct drm_dp_aux *aux, struct drm_dp_tunnel_regs *r
|
|||
while ((len = next_reg_area(&offset))) {
|
||||
int address = DP_TUNNELING_BASE + offset;
|
||||
|
||||
if (drm_dp_dpcd_read(aux, address, tunnel_reg_ptr(regs, address), len) < 0)
|
||||
if (drm_dp_dpcd_read_data(aux, address, tunnel_reg_ptr(regs, address), len) < 0)
|
||||
return -EIO;
|
||||
|
||||
offset += len;
|
||||
|
|
@ -913,7 +913,7 @@ static int set_bw_alloc_mode(struct drm_dp_tunnel *tunnel, bool enable)
|
|||
u8 mask = DP_DISPLAY_DRIVER_BW_ALLOCATION_MODE_ENABLE | DP_UNMASK_BW_ALLOCATION_IRQ;
|
||||
u8 val;
|
||||
|
||||
if (drm_dp_dpcd_readb(tunnel->aux, DP_DPTX_BW_ALLOCATION_MODE_CONTROL, &val) < 0)
|
||||
if (drm_dp_dpcd_read_byte(tunnel->aux, DP_DPTX_BW_ALLOCATION_MODE_CONTROL, &val) < 0)
|
||||
goto out_err;
|
||||
|
||||
if (enable)
|
||||
|
|
@ -921,7 +921,7 @@ static int set_bw_alloc_mode(struct drm_dp_tunnel *tunnel, bool enable)
|
|||
else
|
||||
val &= ~mask;
|
||||
|
||||
if (drm_dp_dpcd_writeb(tunnel->aux, DP_DPTX_BW_ALLOCATION_MODE_CONTROL, val) < 0)
|
||||
if (drm_dp_dpcd_write_byte(tunnel->aux, DP_DPTX_BW_ALLOCATION_MODE_CONTROL, val) < 0)
|
||||
goto out_err;
|
||||
|
||||
tunnel->bw_alloc_enabled = enable;
|
||||
|
|
@ -1039,7 +1039,7 @@ static int clear_bw_req_state(struct drm_dp_aux *aux)
|
|||
{
|
||||
u8 bw_req_mask = DP_BW_REQUEST_SUCCEEDED | DP_BW_REQUEST_FAILED;
|
||||
|
||||
if (drm_dp_dpcd_writeb(aux, DP_TUNNELING_STATUS, bw_req_mask) < 0)
|
||||
if (drm_dp_dpcd_write_byte(aux, DP_TUNNELING_STATUS, bw_req_mask) < 0)
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
|
|
@ -1052,7 +1052,7 @@ static int bw_req_complete(struct drm_dp_aux *aux, bool *status_changed)
|
|||
u8 val;
|
||||
int err;
|
||||
|
||||
if (drm_dp_dpcd_readb(aux, DP_TUNNELING_STATUS, &val) < 0)
|
||||
if (drm_dp_dpcd_read_byte(aux, DP_TUNNELING_STATUS, &val) < 0)
|
||||
return -EIO;
|
||||
|
||||
*status_changed = val & status_change_mask;
|
||||
|
|
@ -1095,7 +1095,7 @@ static int allocate_tunnel_bw(struct drm_dp_tunnel *tunnel, int bw)
|
|||
if (err)
|
||||
goto out;
|
||||
|
||||
if (drm_dp_dpcd_writeb(tunnel->aux, DP_REQUEST_BW, request_bw) < 0) {
|
||||
if (drm_dp_dpcd_write_byte(tunnel->aux, DP_REQUEST_BW, request_bw) < 0) {
|
||||
err = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1196,13 +1196,13 @@ static int check_and_clear_status_change(struct drm_dp_tunnel *tunnel)
|
|||
u8 mask = DP_BW_ALLOCATION_CAPABILITY_CHANGED | DP_ESTIMATED_BW_CHANGED;
|
||||
u8 val;
|
||||
|
||||
if (drm_dp_dpcd_readb(tunnel->aux, DP_TUNNELING_STATUS, &val) < 0)
|
||||
if (drm_dp_dpcd_read_byte(tunnel->aux, DP_TUNNELING_STATUS, &val) < 0)
|
||||
goto out_err;
|
||||
|
||||
val &= mask;
|
||||
|
||||
if (val) {
|
||||
if (drm_dp_dpcd_writeb(tunnel->aux, DP_TUNNELING_STATUS, val) < 0)
|
||||
if (drm_dp_dpcd_write_byte(tunnel->aux, DP_TUNNELING_STATUS, val) < 0)
|
||||
goto out_err;
|
||||
|
||||
return 1;
|
||||
|
|
@ -1215,7 +1215,7 @@ static int check_and_clear_status_change(struct drm_dp_tunnel *tunnel)
|
|||
* Check for estimated BW changes explicitly to account for lost
|
||||
* BW change notifications.
|
||||
*/
|
||||
if (drm_dp_dpcd_readb(tunnel->aux, DP_ESTIMATED_BW, &val) < 0)
|
||||
if (drm_dp_dpcd_read_byte(tunnel->aux, DP_ESTIMATED_BW, &val) < 0)
|
||||
goto out_err;
|
||||
|
||||
if (val * tunnel->bw_granularity != tunnel->estimated_bw)
|
||||
|
|
@ -1300,7 +1300,7 @@ int drm_dp_tunnel_handle_irq(struct drm_dp_tunnel_mgr *mgr, struct drm_dp_aux *a
|
|||
{
|
||||
u8 val;
|
||||
|
||||
if (drm_dp_dpcd_readb(aux, DP_TUNNELING_STATUS, &val) < 0)
|
||||
if (drm_dp_dpcd_read_byte(aux, DP_TUNNELING_STATUS, &val) < 0)
|
||||
return -EIO;
|
||||
|
||||
if (val & (DP_BW_REQUEST_SUCCEEDED | DP_BW_REQUEST_FAILED))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user