cec: for support multi-logical address [1/1]

PD#SWPL-418

Problem:
cec: support multi-logical address

Solution:
if working on multi-logical address, enable two ip
1.enable cec_a, cec_b
2.enable two interrupt
3.enable two pinmux oa_7, ao_8
4.cec_a only send all msg
5.cec_b only receive all msg
6.discard ceca broadcast msg

Verify:
r311
r321
p321

Change-Id: I1dc93429876ede951657102bcd7d41a500946719
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
This commit is contained in:
Yong Qin
2018-11-06 09:31:51 +08:00
committed by Dongjin Kim
parent f3d70ea9b2
commit b39cc3109c
10 changed files with 572 additions and 249 deletions

View File

@@ -1002,6 +1002,7 @@
cec_osd_string = "AML_TV"; /* Max Chars: 14 */
port_num = <4>; /*all port number*/
/*ee_cec;*/
cec_sel = <2>;
output = <1>; /*output port number*/
/*arc support port:bit 0-3, according to portmap*/
arc_port_mask = <0x8>;
@@ -1009,9 +1010,9 @@
0 199 1>;
interrupt-names = "hdmi_aocecb","hdmi_aocec";
pinctrl-names = "default","hdmitx_aocecb","cec_pin_sleep";
pinctrl-0=<&hdmitx_aocec>;
pinctrl-1=<&hdmitx_aocecb>;
pinctrl-2=<&hdmitx_aocecb>;
pinctrl-0=<&hdmitx_aocec &hdmitx_aocecb1>;
pinctrl-1=<&hdmitx_aocec &hdmitx_aocecb1>;
pinctrl-2=<&hdmitx_aocec &hdmitx_aocecb1>;
reg = <0xFF80023c 0x4
0xFF800000 0x400>;
reg-names = "ao_exit","ao";

View File

@@ -992,15 +992,16 @@
cec_osd_string = "AML_TV"; /* Max Chars: 14 */
port_num = <4>; /*all port number*/
/*ee_cec;*/
cec_sel = <2>;
output = <1>;
arc_port_mask = <0x8>;
interrupts = <0 205 1
0 199 1>;
interrupt-names = "hdmi_aocecb","hdmi_aocec";
pinctrl-names = "default","hdmitx_aocecb","cec_pin_sleep";
pinctrl-0=<&hdmitx_aocec>;
pinctrl-1=<&hdmitx_aocecb>;
pinctrl-2=<&hdmitx_aocecb>;
pinctrl-0=<&hdmitx_aocec &hdmitx_aocecb1>;
pinctrl-1=<&hdmitx_aocec &hdmitx_aocecb1>;
pinctrl-2=<&hdmitx_aocec &hdmitx_aocecb1>;
reg = <0x0 0xFF80023c 0x0 0x4
0x0 0xFF800000 0x0 0x400>;
reg-names = "ao_exit","ao";

View File

@@ -1001,6 +1001,7 @@
cec_osd_string = "AML_TV"; /* Max Chars: 14 */
port_num = <4>; /*all port number*/
/*ee_cec;*/
cec_sel = <2>;
output = <1>; /*output port number*/
/*arc support port:bit 0-3, according to portmap*/
arc_port_mask = <0x8>;
@@ -1008,9 +1009,9 @@
0 199 1>;
interrupt-names = "hdmi_aocecb","hdmi_aocec";
pinctrl-names = "default","hdmitx_aocecb","cec_pin_sleep";
pinctrl-0=<&hdmitx_aocec>;
pinctrl-1=<&hdmitx_aocecb>;
pinctrl-2=<&hdmitx_aocecb>;
pinctrl-0=<&hdmitx_aocec &hdmitx_aocecb1>;
pinctrl-1=<&hdmitx_aocec &hdmitx_aocecb1>;
pinctrl-2=<&hdmitx_aocec &hdmitx_aocecb1>;
reg = <0x0 0xFF80023c 0x0 0x4
0x0 0xFF800000 0x0 0x400>;
reg-names = "ao_exit","ao";

File diff suppressed because it is too large Load Diff

View File

@@ -40,6 +40,10 @@ enum cec_chip_ver {
#define L_1 1
#define L_2 2
#define L_3 3
#define CEC_A 0
#define CEC_B 1
/*
#define CEC_FUNC_MASK 0
#define ONE_TOUCH_PLAY_MASK 1
@@ -512,7 +516,7 @@ int __attribute__((weak))hdmirx_get_connect_info(void)
#ifdef CONFIG_AMLOGIC_AO_CEC
unsigned int aocec_rd_reg(unsigned long addr);
void aocec_wr_reg(unsigned long addr, unsigned long data);
void cecrx_irq_handle(void);
void cecb_irq_handle(void);
void cec_logicaddr_set(int l_add);
void cec_arbit_bit_time_set(unsigned int bit_set,
unsigned int time_set, unsigned int flag);
@@ -521,6 +525,9 @@ void aocec_irq_enable(bool enable);
extern void dump_reg(void);
#endif
extern void cec_dump_info(void);
extern void cec_hw_reset(void);
extern void cec_hw_reset(unsigned int cec_sel);
extern void cec_restore_logical_addr(unsigned int cec_sel,
unsigned int addr_en);
extern void cec_logicaddr_add(unsigned int cec_sel, unsigned int l_add);
extern void cec_clear_all_logical_addr(unsigned int cec_sel);
#endif /* __AO_CEC_H__ */

View File

@@ -34,7 +34,7 @@
#include "hdmi_rx_edid.h"
#define RX_VER0 "ver.2018-11-01"
#define RX_VER0 "ver.2018-11-8"
/*
*
*
@@ -472,7 +472,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);
extern void cecb_irq_handle(void);
/* user interface */
extern int pc_mode_en;

View File

@@ -2165,26 +2165,28 @@ hdmirx_wr_dwc(DWC_DMI_SW_RST, data32);
void hdmirx_hw_config(void)
{
rx_pr("%s port:%d\n", __func__, rx.port);
control_reset();
/* hdmi_rx_top_edid_update(); */
rx_hdcp_init();
hdmirx_audio_init();
packet_init();
if (rx.chip_id != CHIP_ID_TXHD)
hdmirx_20_init();
DWC_init();
hdmirx_irq_hdcp_enable(true);
hdmirx_phy_init();
hdmirx_wr_top(TOP_INTR_MASKN, top_intr_maskn_value);
rx_pr("%s %d Done!\n", __func__, rx.port);
if (rx.chip_id <= CHIP_ID_TXL)
cec_hw_reset();
rx_pr("%s port:%d\n", __func__, rx.port);
control_reset();
/* hdmi_rx_top_edid_update(); */
rx_hdcp_init();
hdmirx_audio_init();
packet_init();
if (rx.chip_id != CHIP_ID_TXHD)
hdmirx_20_init();
DWC_init();
hdmirx_irq_hdcp_enable(true);
hdmirx_phy_init();
hdmirx_wr_top(TOP_INTR_MASKN, top_intr_maskn_value);
rx_pr("%s %d Done!\n", __func__, rx.port);
/* hdmi reset will cause cec not working*/
/* cec modult need reset */
if (rx.chip_id <= CHIP_ID_TXL)
cec_hw_reset(1);/*1:snps cec*/
}
/*
* hdmirx_hw_probe - hdmirx top/controller/phy init
*/
* hdmirx_hw_probe - hdmirx top/controller/phy init
*/
void hdmirx_hw_probe(void)
{
hdmirx_wr_top(TOP_MEM_PD, 0);

View File

@@ -1193,7 +1193,7 @@ extern void rx_set_cur_hpd(uint8_t val);
extern unsigned int rx_get_hdmi5v_sts(void);
extern unsigned int rx_get_hpd_sts(void);
extern void cec_hw_reset(void);
extern void cec_hw_reset(unsigned int cec_sel);
extern void rx_force_hpd_cfg(uint8_t hpd_level);
extern void rx_force_rxsense_cfg(uint8_t level);
extern void rx_force_hpd_rxsense_cfg(uint8_t level);

View File

@@ -311,7 +311,7 @@ static int hdmi_rx_ctrl_irq_handler(void)
hdmirx_rd_dwc(DWC_AUD_CEC_ISTS) &
hdmirx_rd_dwc(DWC_AUD_CEC_IEN);
if (intr_aud_cec != 0) {
cecrx_irq_handle();
cecb_irq_handle();
hdmirx_wr_dwc(DWC_AUD_CEC_ICLR, intr_aud_cec);
}
}

View File

@@ -314,6 +314,7 @@ struct cec_global_info_t {
unsigned int cec_version;
unsigned char power_status;
unsigned char log_addr;
unsigned int addr_enable;
unsigned char menu_status;
unsigned char osd_name[16];
struct input_dev *remote_cec_dev; /* cec input device */