}
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)
hdev->HWOp.CntlConfig(hdev,
CONF_HDMI_DVI_MODE, HDMI_MODE);
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])
/*
* 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;
/* 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);
/* 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 */
}
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);
#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