问题描述
由前一篇文章https://blog.csdn.net/jay547063443/article/details/142059700?fromshare=blogdetail&sharetype=blogdetail&sharerId=142059700&sharerefer=PC&sharesource=jay547063443&sharefrom=from_link,移植HDMI-IN部分驱动后出现:
1.HDMI-IN图形延迟 出图慢 rkCamera2应用自动跳出等问题
2.HDMIN-IN无声
解决方案:
问题一:
kernel\drivers\media\i2c\rk628\rk628_hdmirx.c
int rk628_is_avi_ready(struct rk628 *rk628, bool avi_rcv_rdy)
{
u8 i;
u32 val, avi_pb = 0;
u8 cnt = 0, max_cnt = 2;
u32 hdcp_ctrl_val = 0;
if (rk628->version >= RK628F_VERSION)
return 1;
+
+ if (rk628->version >= RK628D_VERSION)
+ return 1;
+
rk628_i2c_read(rk628, HDMI_RX_HDCP_CTRL, &val);
if ((val & HDCP_ENABLE_MASK))
max_cnt = 5;
问题二:
首先确保上层hardware\rockchip\audio\tinyalsa_hal\audio_hw.c声卡有添加,以我的声卡为例子
其次这里不要修改为rk628,还是用原来的hdmirx
最后添加如下kernelq驱动部分补丁:
From b027f3089f3a84198788363540dcaae52949c4a2 Mon Sep 17 00:00:00 2001
From: Shunhua Lan <lsh@rock-chips.com>
Date: Fri, 27 Sep 2024 16:47:41 +0800
Subject: [PATCH] media: i2c: rk628: repair cts n interrupt loss
Change-Id: I9603a1733555b535f0542ca6677e9cb27647a399
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
---
diff --git a/drivers/media/i2c/rk628/rk628_csi_v4l2.c b/drivers/media/i2c/rk628/rk628_csi_v4l2.c
index 86f35b7..bb91f0c 100644
--- a/drivers/media/i2c/rk628/rk628_csi_v4l2.c
+++ b/drivers/media/i2c/rk628/rk628_csi_v4l2.c
@@ -1567,6 +1567,24 @@
return -EINVAL;
}
+ if (csi->rk628->version < RK628F_VERSION) {
+ if (rk628_audio_ctsnints_enabled(audio_info)) {
+ rk628_i2c_read(csi->rk628, HDMI_RX_PDEC_ISTS, &pdec_ints);
+ if (pdec_ints & (ACR_N_CHG_ICLR | ACR_CTS_CHG_ICLR)) {
+ rk628_csi_isr_ctsn(audio_info, pdec_ints);
+ pdec_ints &= ~(ACR_CTS_CHG_ICLR | ACR_CTS_CHG_ICLR);
+ *handled = true;
+ }
+ }
+ if (rk628_audio_fifoints_enabled(audio_info)) {
+ rk628_i2c_read(csi->rk628, HDMI_RX_AUD_FIFO_ISTS, &fifo_ints);
+ if (fifo_ints & 0x18) {
+ rk628_csi_isr_fifoints(audio_info, fifo_ints);
+ *handled = true;
+ }
+ }
+ }
+
if (!csi->vid_ints_en)
return 0;
@@ -1579,7 +1597,7 @@
/* clear interrupts */
rk628_i2c_write(csi->rk628, HDMI_RX_MD_ICLR, 0xffffffff);
- rk628_i2c_write(csi->rk628, HDMI_RX_PDEC_ICLR, 0xffffffff);
+ rk628_i2c_write(csi->rk628, HDMI_RX_PDEC_ICLR, 0xff3fffff);
if (!rk628_is_general_isr(csi, md_ints, pdec_ints))
return 0;
@@ -1595,22 +1613,6 @@
return 0;
}
- if (csi->rk628->version < RK628F_VERSION) {
- if (rk628_audio_ctsnints_enabled(audio_info)) {
- if (pdec_ints & (ACR_N_CHG_ICLR | ACR_CTS_CHG_ICLR)) {
- rk628_csi_isr_ctsn(audio_info, pdec_ints);
- pdec_ints &= ~(ACR_CTS_CHG_ICLR | ACR_CTS_CHG_ICLR);
- *handled = true;
- }
- }
- if (rk628_audio_fifoints_enabled(audio_info)) {
- rk628_i2c_read(csi->rk628, HDMI_RX_AUD_FIFO_ISTS, &fifo_ints);
- if (fifo_ints & 0x18) {
- rk628_csi_isr_fifoints(audio_info, fifo_ints);
- *handled = true;
- }
- }
- }
v4l2_dbg(1, debug, sd, "%s: md_ints: %#x, pdec_ints:%#x, plugin: %d\n",
__func__, md_ints, pdec_ints, plugin);