From f962b98214606fbd0708e5a6102d8c9cf710f055 Mon Sep 17 00:00:00 2001 From: Hang Cheng Date: Mon, 22 Apr 2019 20:12:08 +0800 Subject: [PATCH] hdmirx: disable interrupt when suspend or shutdown [1/1] PD#SWPL-7570 Problem: there's frequent interrupt when suspend, and can't enter suspend successfully Solution: disable interrupt when suspend/shutdown Verify: x301 Change-Id: Iad13159da8cf0d48c6374c17df957c26aa177024 Signed-off-by: Hang Cheng --- .../amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c | 3 +++ .../amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h | 2 +- drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c | 27 ++++++++++++++-------- drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h | 1 + 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c index 256024b..125b69e 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c @@ -1737,6 +1737,7 @@ static void rx_phy_suspend(void) /* phy powerdown */ rx_phy_power_on(0); } + hdmirx_top_irq_en(false); } static void rx_phy_resume(void) @@ -1753,6 +1754,7 @@ static void rx_phy_resume(void) hdmirx_phy_init(); pre_port = 0xff; rx.boot_flag = true; + hdmirx_top_irq_en(true); } void rx_emp_resource_allocate(struct device *dev) @@ -2534,6 +2536,7 @@ static void hdmirx_shutdown(struct platform_device *pdev) rx_phy_power_on(0); if (hdcp22_on) hdcp_22_off(); + hdmirx_top_irq_en(false); rx_pr("[hdmirx]: shutdown success\n"); } 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 f135a55..2ee5e2e 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h @@ -41,7 +41,7 @@ * * */ -#define RX_VER1 "ver.2019/04/08" +#define RX_VER1 "ver.2019/04/22" /* * * 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 cd29bb6..5b6ccbf 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c @@ -924,6 +924,15 @@ void hdmirx_irq_hdcp_enable(bool enable) } } +void hdmirx_top_irq_en(bool flag) +{ + if (flag) + hdmirx_wr_top(TOP_INTR_MASKN, + top_intr_maskn_value); + else + hdmirx_wr_top(TOP_INTR_MASKN, 0); +} + /* * rx_get_audinfo - get aduio info */ @@ -2409,7 +2418,7 @@ void hdmirx_hw_config(void) if (rx.chip_id >= CHIP_ID_TL1) aml_phy_switch_port(); hdmirx_phy_init(); - hdmirx_wr_top(TOP_INTR_MASKN, top_intr_maskn_value); + hdmirx_top_irq_en(true); rx_pr("%s %d Done!\n", __func__, rx.port); /* hdmi reset will cause cec not working*/ /* cec modult need reset */ @@ -2423,7 +2432,7 @@ void hdmirx_hw_config(void) void hdmirx_hw_probe(void) { hdmirx_wr_top(TOP_MEM_PD, 0); - hdmirx_wr_top(TOP_INTR_MASKN, 0); + hdmirx_top_irq_en(false); hdmirx_wr_top(TOP_SW_RESET, 0); clk_init(); TOP_init(); @@ -2443,7 +2452,7 @@ void hdmirx_hw_probe(void) hdmirx_phy_init(); hdmirx_wr_top(TOP_PORT_SEL, 0x10); hdmirx_wr_top(TOP_INTR_STAT_CLR, ~0); - hdmirx_wr_top(TOP_INTR_MASKN, top_intr_maskn_value); + hdmirx_top_irq_en(true); /* rx_pr("%s Done!\n", __func__); */ } @@ -3372,22 +3381,22 @@ uint32_t aml_phy_pll_band(uint32_t cableclk, static const uint32_t phy_misci[][4] = { /* 0xd7 0xd8 0xe0 0xe1 */ { /* 24~45M */ - 0x3007707f, 0x00000080, 0x02218000, 0x00000010, + 0x3003707f, 0x00000080, 0x02218000, 0x00000010, }, { /* 45~74.5M */ - 0x3007707f, 0x00000080, 0x02218000, 0x00000010, + 0x3003707f, 0x00000080, 0x02218000, 0x00000010, }, { /* 77~155M */ - 0x3007707f, 0x00000080, 0x02218000, 0x00000010, + 0x3003707f, 0x00000080, 0x02218000, 0x00000010, }, { /* 155~340M */ - 0x3007707f, 0x00000080, 0x02218000, 0x00000010, + 0x3003707f, 0x00000080, 0x02218000, 0x00000010, }, { /* 340~525M */ - 0x3007707f, 0x007f0080, 0x02218000, 0x00000010, + 0x3003707f, 0x007f0080, 0x02218000, 0x00000010, }, { /* 525~600M */ - 0x3007707f, 0x007f8080, 0x02218000, 0x00000010, + 0x3003707f, 0x007f8080, 0x02218000, 0x00000010, }, }; diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h index a46032b..6b404ea 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h @@ -1299,6 +1299,7 @@ extern void rx_get_audio_N_CTS(uint32_t *N, uint32_t *CTS); extern void rx_run_eq(void); extern bool rx_eq_done(void); extern bool is_tmds_valid(void); +extern void hdmirx_top_irq_en(bool flag); #endif -- 2.7.4