drm/rockchip: vop: add support to read regs from mcu panel

The reading function can be used for debugging while trying
to bring up the mcu panel, or reading some specific status
regs during the frame blanking period, and etc.

Change-Id: I29b153a78aa4a0ebb64f3156a37fddc67986bb49
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
This commit is contained in:
Damon Ding
2024-07-19 17:07:02 +08:00
committed by Tao Huang
parent add998a29e
commit 116a45108a
2 changed files with 8 additions and 1 deletions

View File

@@ -3168,10 +3168,11 @@ static void vop_mcu_mode_setup(struct drm_crtc *crtc)
VOP_CTRL_SET(vop, mcu_rw_pend, vop->mcu_timing.mcu_rw_pend);
}
static void vop_crtc_send_mcu_cmd(struct drm_crtc *crtc, u32 type, u32 value)
static void vop_crtc_send_mcu_cmd(struct drm_crtc *crtc, u32 type, u32 value)
{
struct drm_display_mode *adjusted_mode;
struct vop *vop = NULL;
uint32_t val = 0;
if (!crtc)
return;
@@ -3200,6 +3201,11 @@ static void vop_crtc_send_mcu_cmd(struct drm_crtc *crtc, u32 type, u32 value)
VOP_CTRL_SET(vop, mcu_rs, 1);
VOP_CTRL_SET(vop, mcu_rw_bypass_port, value);
break;
case MCU_RDDATA:
VOP_CTRL_SET(vop, mcu_rs, 1);
val = VOP_CTRL_GET(vop, mcu_rw_bypass_port);
DRM_DEBUG_DRIVER("mcu read reg[0x%02x] = 0x%02x", value, val);
break;
case MCU_SETBYPASS:
VOP_CTRL_SET(vop, mcu_bypass, value ? 1 : 0);
break;

View File

@@ -694,6 +694,7 @@ enum _vop_rgb2rgb_conv_mode {
enum _MCU_IOCTL {
MCU_WRCMD = 0,
MCU_WRDATA,
MCU_RDDATA,
MCU_SETBYPASS,
};