author | hongmin hua <hongmin.hua@amlogic.com> | 2018-11-16 10:06:42 (GMT) |
---|---|---|
committer | hongmin hua <hongmin.hua@amlogic.com> | 2018-11-22 08:19:15 (GMT) |
commit | 086909a38ae320a0691463c1b157da21a91076bc (patch) | |
tree | 9bc937ae26ad9e064aedcb2c2a569967550fb5ef | |
parent | 307d1fbded12b652d1cd43d16ef26d1a435bd99c (diff) | |
download | common-086909a38ae320a0691463c1b157da21a91076bc.zip common-086909a38ae320a0691463c1b157da21a91076bc.tar.gz common-086909a38ae320a0691463c1b157da21a91076bc.tar.bz2 |
hdmirx: add the phy addr update with tx hpd
PD#OTT-204
Problem:
phy addr doesn't change with tx plug
Solution:
add the phy addr update with tx hpd
Verify:
atom
Change-Id: I9414b6c874ad82544c6830ff7882024babe5c39d
Signed-off-by: hongmin hua <hongmin.hua@amlogic.com>
4 files changed, 35 insertions, 13 deletions
diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h index fb37a2f..eae4f61 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h @@ -46,7 +46,7 @@ * * */ -#define RX_VER2 "ver.2018/09/06" +#define RX_VER2 "ver.2018/11/22" /*print type*/ #define LOG_EN 0x01 diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c index aeacfca..9a49ebe 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c @@ -38,6 +38,7 @@ #include <linux/arm-smccc.h> /* Local include */ +#include "hdmi_rx_repeater.h" #include "hdmi_rx_drv.h" #include "hdmi_rx_hw.h" #include "hdmi_rx_edid.h" @@ -1194,8 +1195,7 @@ void rx_hdcp14_config(const struct hdmi_rx_hdcp *hdcp) rx_pr("hdcp1.4 normal mode\n"); } if (rx.chip_id != CHIP_ID_TXHD) { - hdmirx_wr_bits_dwc(DWC_HDCP_RPT_CTRL, - REPEATER, hdcp->repeat ? 1 : 0); + rx_set_repeat_signal(hdcp->repeat); /* nothing attached downstream */ hdmirx_wr_dwc(DWC_HDCP_RPT_BSTATUS, 0); } diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c index 47bff53..b77f77c 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c @@ -102,8 +102,26 @@ bool hdmirx_is_key_write(void) void rx_check_repeat(void) { - if (!hdmirx_repeat_support()) + if (!hdmirx_repeat_support()) { + if (rx.hdcp.repeat != repeat_plug) { + rx.hdcp.repeat = repeat_plug; + if (!repeat_plug) { + memset(&receive_edid, 0, sizeof(receive_edid)); + up_phy_addr = 0; + new_edid = true; + } + if (rx.open_fg) + rx_set_cur_hpd(0); + } + + if (new_edid) { + hdmi_rx_top_edid_update(); + if (rx.open_fg) + rx_send_hpd_pulse(); + new_edid = 0; + } return; + } if (rx.hdcp.repeat != repeat_plug) { rx_set_repeat_signal(repeat_plug); @@ -301,8 +319,11 @@ bool rx_set_repeat_aksv(unsigned char *data, int len, int depth, void rx_set_repeat_signal(bool repeat) { - rx.hdcp.repeat = repeat; - hdmirx_wr_bits_dwc(DWC_HDCP_RPT_CTRL, REPEATER, repeat); + if (hdmirx_repeat_support()) { + rx.hdcp.repeat = repeat; + hdmirx_wr_bits_dwc(DWC_HDCP_RPT_CTRL, REPEATER, repeat); + } else + hdmirx_wr_bits_dwc(DWC_HDCP_RPT_CTRL, REPEATER, 0); } bool rx_set_receive_hdcp(unsigned char *data, int len, int depth, @@ -323,7 +344,8 @@ EXPORT_SYMBOL(rx_set_receive_hdcp); void rx_repeat_hpd_state(bool plug) { - repeat_plug = plug; + if (!hdmirx_repeat_support()) + repeat_plug = plug; } EXPORT_SYMBOL(rx_repeat_hpd_state); @@ -335,8 +357,11 @@ EXPORT_SYMBOL(rx_repeat_hdcp_ver); void rx_edid_physical_addr(int a, int b, int c, int d) { - up_phy_addr = ((d & 0xf) << 12) | ((c & 0xf) << 8) | ((b & - 0xf) << 4) | (a & 0xf); + if (!hdmirx_repeat_support()) { + up_phy_addr = ((d & 0xf) << 12) | ((c & 0xf) << 8) | ((b & + 0xf) << 4) | (a & 0xf); + new_edid = true; + } } EXPORT_SYMBOL(rx_edid_physical_addr); diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c index f6959ab..923ee51 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c @@ -1810,10 +1810,7 @@ void hdmirx_open_port(enum tvin_port_e port) //rx.wait_no_sig_cnt = 0; vic_check_en = true; dvi_check_en = true; - if (hdmirx_repeat_support()) - rx.hdcp.repeat = repeat_plug; - else - rx.hdcp.repeat = 0; + rx.hdcp.repeat = repeat_plug; if ((pre_port != rx.port) || (rx_get_cur_hpd_sts() == 0) || |