summaryrefslogtreecommitdiff
authorJinping Wang <jinping.wang@amlogic.com>2019-05-24 02:08:10 (GMT)
committer Jinping Wang <jinping.wang@amlogic.com>2019-05-24 02:08:10 (GMT)
commite226781fc22bb432f72e7ebfcdba3fc44ec73dac (patch)
treecfbfadf9ff8b305b1c6a350dd0b11b282f2a7554
parent9766ee7df8d30db8edb4a2d861bfc7b990c5c8cb (diff)
downloadcommon-e226781fc22bb432f72e7ebfcdba3fc44ec73dac.zip
common-e226781fc22bb432f72e7ebfcdba3fc44ec73dac.tar.gz
common-e226781fc22bb432f72e7ebfcdba3fc44ec73dac.tar.bz2
cec: set the phy port the same as ui id [1/1]
BUG=133186173 Problem: the atom switch wrong channel when portid and input deviceid mapping wrong Solution: set the phy port the same as ui id add the port map for connect status Verify: atom Change-Id: I4b80adb8c57ed7c4f0229b99c317adab2abfc77a Signed-off-by: Jinping Wang <jinping.wang@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/cec/hdmi_ao_cec.c16
-rw-r--r--drivers/amlogic/cec/hdmi_ao_cec.h4
2 files changed, 13 insertions, 7 deletions
diff --git a/drivers/amlogic/cec/hdmi_ao_cec.c b/drivers/amlogic/cec/hdmi_ao_cec.c
index 5b7daca..2fefa65 100644
--- a/drivers/amlogic/cec/hdmi_ao_cec.c
+++ b/drivers/amlogic/cec/hdmi_ao_cec.c
@@ -2418,7 +2418,7 @@ static ssize_t hdmitx_cec_write(struct file *f, const char __user *buf,
static void init_cec_port_info(struct hdmi_port_info *port,
struct ao_cec_dev *cec_dev)
{
- unsigned int a, b, c, d, e = 0;
+ unsigned int a, b, c = 0, d, e = 0;
unsigned int phy_head = 0xf000, phy_app = 0x1000, phy_addr;
struct hdmitx_dev *tx_dev;
@@ -2470,7 +2470,7 @@ static void init_cec_port_info(struct hdmi_port_info *port,
port[e].type = HDMI_OUTPUT;
} else {
port[e].type = HDMI_INPUT;
- port[e].port_id = a + 1;
+ port[e].port_id = c;/*a + 1; phy port - ui id*/
}
port[e].cec_supported = 1;
/* set ARC feature according mask */
@@ -2540,7 +2540,7 @@ static long hdmitx_cec_ioctl(struct file *f,
void __user *argp = (void __user *)arg;
unsigned int tmp;
struct hdmi_port_info *port;
- unsigned int a, b, c, d;
+ unsigned int a, b, c, d, i = 0;
struct hdmitx_dev *tx_dev;
/*unsigned int tx_hpd;*/
@@ -2675,8 +2675,14 @@ static long hdmitx_cec_ioctl(struct file *f,
/* mixed for rx & tx */
/* a is current port idx, 0: tx device */
if (a != 0) {
- tmp = hdmirx_get_connect_info();
- if (tmp & (1 << (a - 1)))
+ tmp = hdmirx_get_connect_info() & 0xF;
+ for (i = 0; i < CEC_PHY_PORT_NUM; i++) {
+ if (((cec_dev->port_seq >> i*4) & 0xF) == a)
+ break;
+ }
+ CEC_INFO("phy port:%d, ui port:%d\n", i, a);
+
+ if ((tmp & (1 << i)) && (a != 0xF))
tmp = 1;
else
tmp = 0;
diff --git a/drivers/amlogic/cec/hdmi_ao_cec.h b/drivers/amlogic/cec/hdmi_ao_cec.h
index 21a6ec4..312ef3e 100644
--- a/drivers/amlogic/cec/hdmi_ao_cec.h
+++ b/drivers/amlogic/cec/hdmi_ao_cec.h
@@ -19,14 +19,14 @@
#define __AO_CEC_H__
-#define CEC_DRIVER_VERSION "Ver 2018/09/06\n"
+#define CEC_DRIVER_VERSION "Ver 2019/05/24\n"
#define CEC_FRAME_DELAY msecs_to_jiffies(400)
#define CEC_DEV_NAME "cec"
#define CEC_EARLY_SUSPEND (1 << 0)
#define CEC_DEEP_SUSPEND (1 << 1)
-
+#define CEC_PHY_PORT_NUM 4
#define HR_DELAY(n) (ktime_set(0, n * 1000 * 1000))
#define L_1 1