mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
hdmitx: replace I2C_REACTIVE with I2C_RESET logic [1/1]
PD#OTT-3716 Problem: In GX, there is the I2C_REACTIVE method to avoid the I2C hangup issue. But it is fixed in G12, so need replace it. Solution: Replace I2C_REACTIVE with I2C_RESET logic Verify: G12/U212 Change-Id: I1ca2f77a213db0d7de067745b3701816b7c85c27 Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
This commit is contained in:
@@ -3816,7 +3816,8 @@ static void hdmitx_hpd_plugin_handler(struct work_struct *work)
|
||||
}
|
||||
mutex_lock(&setclk_mutex);
|
||||
pr_info(SYS "plugin\n");
|
||||
hdev->HWOp.CntlMisc(hdev, MISC_I2C_REACTIVE, 0);
|
||||
if (hdev->chip_type >= MESON_CPU_ID_G12A)
|
||||
hdev->HWOp.CntlMisc(hdev, MISC_I2C_RESET, 0);
|
||||
hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGIN;
|
||||
/* start reading E-EDID */
|
||||
if (hdev->repeater_tx)
|
||||
@@ -3845,6 +3846,8 @@ static void hdmitx_hpd_plugin_handler(struct work_struct *work)
|
||||
}
|
||||
|
||||
mutex_lock(&getedid_mutex);
|
||||
if (hdev->chip_type < MESON_CPU_ID_G12A)
|
||||
hdev->HWOp.CntlMisc(hdev, MISC_I2C_REACTIVE, 0);
|
||||
mutex_unlock(&getedid_mutex);
|
||||
if (hdev->repeater_tx) {
|
||||
if (check_fbc_special(&hdev->EDID_buf[0])
|
||||
|
||||
@@ -4445,6 +4445,7 @@ static void hdmitx_getediddata(unsigned char *des, unsigned char *src)
|
||||
/*
|
||||
* Note: read 8 Bytes of EDID data every time
|
||||
*/
|
||||
#define EDID_WAIT_TIMEOUT 10
|
||||
static void hdmitx_read_edid(unsigned char *rx_edid)
|
||||
{
|
||||
unsigned int timeout = 0;
|
||||
@@ -4454,6 +4455,7 @@ static void hdmitx_read_edid(unsigned char *rx_edid)
|
||||
|
||||
/* Program SLAVE/ADDR */
|
||||
hdmitx_wr_reg(HDMITX_DWC_I2CM_SLAVE, 0x50);
|
||||
hdmitx_wr_reg(HDMITX_DWC_IH_I2CM_STAT0, 1 << 1);
|
||||
/* Read complete EDID data sequentially */
|
||||
while (byte_num < 128 * blk_no) {
|
||||
hdmitx_wr_reg(HDMITX_DWC_I2CM_ADDRESS, byte_num&0xff);
|
||||
@@ -4467,11 +4469,11 @@ static void hdmitx_read_edid(unsigned char *rx_edid)
|
||||
/* Wait until I2C done */
|
||||
timeout = 0;
|
||||
while ((!(hdmitx_rd_reg(HDMITX_DWC_IH_I2CM_STAT0) & (1 << 1)))
|
||||
&& (timeout < 3)) {
|
||||
&& (timeout < EDID_WAIT_TIMEOUT)) {
|
||||
mdelay(2);
|
||||
timeout++;
|
||||
}
|
||||
if (timeout == 3)
|
||||
if (timeout == EDID_WAIT_TIMEOUT)
|
||||
pr_info(HW "ddc timeout\n");
|
||||
hdmitx_wr_reg(HDMITX_DWC_IH_I2CM_STAT0, 1 << 1);
|
||||
/* Read back 8 bytes */
|
||||
@@ -5154,6 +5156,13 @@ static int hdmitx_cntl_misc(struct hdmitx_dev *hdev, unsigned int cmd,
|
||||
}
|
||||
hdmitx_set_reg_bits(HDMITX_DWC_MC_CLKDIS, !!argv, 6, 1);
|
||||
break;
|
||||
case MISC_I2C_RESET:
|
||||
hdmitx_set_reg_bits(HDMITX_TOP_SW_RESET, 1, 9, 1);
|
||||
usleep_range(1000, 2000);
|
||||
hdmitx_set_reg_bits(HDMITX_TOP_SW_RESET, 0, 9, 1);
|
||||
usleep_range(1000, 2000);
|
||||
hdmi_hwi_init(hdev);
|
||||
break;
|
||||
case MISC_I2C_REACTIVE:
|
||||
hdmitx_hdcp_opr(4);
|
||||
hdmitx_set_reg_bits(HDMITX_DWC_A_HDCPCFG1, 0, 0, 1);
|
||||
|
||||
@@ -542,7 +542,8 @@ struct hdmitx_dev {
|
||||
#define MISC_HDCP_CLKDIS (CMD_MISC_OFFSET + 0x0e)
|
||||
#define MISC_TMDS_RXSENSE (CMD_MISC_OFFSET + 0x0f)
|
||||
#define MISC_I2C_REACTIVE (CMD_MISC_OFFSET + 0x10)
|
||||
#define MISC_READ_AVMUTE_OP (CMD_MISC_OFFSET + 0x11)
|
||||
#define MISC_I2C_RESET (CMD_MISC_OFFSET + 0x11)
|
||||
#define MISC_READ_AVMUTE_OP (CMD_MISC_OFFSET + 0x12)
|
||||
|
||||
/***********************************************************************
|
||||
* Get State //GetState
|
||||
|
||||
Reference in New Issue
Block a user