cec: txl: add cec support for txl

PD#168480: cec: txl: add cec support for txl

Change-Id: I76c4c241aa882f9a454fed8813fd0d733995bf5d
Signed-off-by: hongmin hua <hongmin.hua@amlogic.com>
This commit is contained in:
hongmin hua
2018-06-26 20:40:42 +08:00
committed by Yixun Lan
parent 813c6a2f7a
commit daa52d6fb4
3 changed files with 33 additions and 14 deletions

View File

@@ -442,7 +442,6 @@ void cecrx_irq_handle(void)
if (!ee_cec)
return;
if (cec_dev->plat_data->ee_to_ao)
shift = 16;
/* TX DONE irq, increase tx buffer pointer */
@@ -945,9 +944,9 @@ static int cec_ll_trigle_tx(const unsigned char *msg, int len)
}
cec_timeout_cnt = 0;
return 0;
} else {
CEC_ERR("error msg sts:0x%x\n", reg);
}
CEC_ERR("error msg sts:0x%x\n", reg);
return -1;
}
@@ -1375,10 +1374,9 @@ static int cec_late_check_rx_buffer(void)
CEC_INFO("buffer got unrecorgnized msg\n");
cec_rx_buf_clear();
return 0;
} else {
/*mod_delayed_work(cec_dev->cec_thread, dwork, 0);*/
return 1;
}
return 1;
}
void cec_key_report(int suspend)
@@ -1884,14 +1882,14 @@ static ssize_t port_status_show(struct class *cla,
if (cec_dev->dev_type == DEV_TYPE_PLAYBACK) {
tmp = tx_hpd;
return sprintf(buf, "%x\n", tmp);
} else {
tmp = hdmirx_rd_top(TOP_HPD_PWR5V);
CEC_INFO("TOP_HPD_PWR5V:%x\n", tmp);
tmp >>= 20;
tmp &= 0xf;
tmp |= (tx_hpd << 16);
return sprintf(buf, "%x\n", tmp);
}
tmp = hdmirx_rd_top(TOP_HPD_PWR5V);
CEC_INFO("TOP_HPD_PWR5V:%x\n", tmp);
tmp >>= 20;
tmp &= 0xf;
tmp |= (tx_hpd << 16);
return sprintf(buf, "%x\n", tmp);
}
static ssize_t pin_status_show(struct class *cla,
@@ -2516,6 +2514,11 @@ static const struct cec_platform_data_s cec_g12a_data = {
.ee_to_ao = 1,
};
static const struct cec_platform_data_s cec_txl_data = {
.line_bit = 7,
.ee_to_ao = 0,
};
static const struct of_device_id aml_cec_dt_match[] = {
{
.compatible = "amlogic, amlogic-aocec",
@@ -2529,6 +2532,10 @@ static const struct of_device_id aml_cec_dt_match[] = {
.compatible = "amlogic, aocec-g12a",
.data = &cec_g12a_data,
},
{
.compatible = "amlogic, aocec-txl",
.data = &cec_txl_data,
},
};
#endif

View File

@@ -34,7 +34,7 @@
#include "hdmi_rx_edid.h"
#define RX_VER0 "ver.2018/06/21"
#define RX_VER0 "ver.2018-06-27"
/*
*
*
@@ -413,6 +413,7 @@ extern void rx_send_hpd_pulse(void);
/* irq */
extern void rx_irq_en(bool enable);
extern irqreturn_t irq_handler(int irq, void *params);
extern void cecrx_irq_handle(void);
/* user interface */
extern int pc_mode_en;

View File

@@ -259,6 +259,7 @@ static int hdmi_rx_ctrl_irq_handler(void)
uint32_t intr_hdmi = 0;
uint32_t intr_md = 0;
uint32_t intr_pedc = 0;
uint32_t intr_aud_cec = 0;
/* uint32_t intr_aud_clk = 0; */
uint32_t intr_aud_fifo = 0;
uint32_t intr_hdcp22 = 0;
@@ -298,6 +299,16 @@ static int hdmi_rx_ctrl_irq_handler(void)
hdmirx_rd_dwc(DWC_HDMI2_IEN);
}
if (is_meson_txl_cpu()) {
intr_aud_cec =
hdmirx_rd_dwc(DWC_AUD_CEC_ISTS) &
hdmirx_rd_dwc(DWC_AUD_CEC_IEN);
if (intr_aud_cec != 0) {
cecrx_irq_handle();
hdmirx_wr_dwc(DWC_AUD_CEC_ICLR, intr_aud_cec);
}
}
if (intr_hdcp22 != 0) {
hdmirx_wr_dwc(DWC_HDMI2_ICLR, intr_hdcp22);
skip_frame(skip_frame_cnt);