From 905dc65b1fce8fb602a117c71d83876dac07ce5a Mon Sep 17 00:00:00 2001 From: yicheng shen Date: Thu, 17 Oct 2019 16:40:41 +0800 Subject: [PATCH] hdmirx: Optimize hdmirx power consumption [1/1] PD#SWPL-10073 Problem: The power consumption of hdmirx need to be optimized when there're no deviced connected. Solution: Power off hdmirx phy/pll when no rx input Verify: TL1/TM2 Change-Id: Iba34e3a4cd72c2fd72ff05f608114179ae59055c Signed-off-by: yicheng shen --- .../media/vin/tvin/hdmirx/hdmi_rx_drv.h | 2 +- .../media/vin/tvin/hdmirx/hdmi_rx_hw.c | 25 ++++++++++++++++--- 2 files changed, 22 insertions(+), 5 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 148e4d8b4066..289569020e0a 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h @@ -47,7 +47,7 @@ * * */ -#define RX_VER2 "ver.2019/09/11" +#define RX_VER2 "ver.2019/10/17" /*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 cb31828bba4e..5f49a57c9447 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c @@ -4023,6 +4023,26 @@ void rx_phy_rxsense_pulse(unsigned int t1, unsigned int t2, bool en) mdelay(t2); } +void aml_phy_power_off(void) +{ + /* pll power down */ + wr_reg_hhi_bits(HHI_HDMIRX_APLL_CNTL0, _BIT(28), 0); + wr_reg_hhi_bits(HHI_HDMIRX_APLL_CNTL0, _BIT(29), 1); + + /* phy power down */ + wr_reg_hhi(HHI_HDMIRX_PHY_MISC_CNTL0, 0x32037800); + wr_reg_hhi(HHI_HDMIRX_PHY_MISC_CNTL1, 0x1000000); + wr_reg_hhi(HHI_HDMIRX_PHY_MISC_CNTL2, 0x62208002); + wr_reg_hhi(HHI_HDMIRX_PHY_MISC_CNTL3, 0x7); + wr_reg_hhi(HHI_HDMIRX_PHY_DCHA_CNTL0, 0x1e); + wr_reg_hhi(HHI_HDMIRX_PHY_DCHA_CNTL1, 0x10000800); + wr_reg_hhi(HHI_HDMIRX_PHY_DCHD_CNTL0, 0x200000); + wr_reg_hhi(HHI_HDMIRX_PHY_DCHD_CNTL1, 0x0); + + if (log_level & VIDEO_LOG) + rx_pr("%s\n", __func__); +} + void rx_phy_power_on(unsigned int onoff) { if (onoff) @@ -4032,10 +4052,7 @@ void rx_phy_power_on(unsigned int onoff) if (rx.chip_id >= CHIP_ID_TL1) { /*the enable of these regs are in phy init*/ if (onoff == 0) { - wr_reg_hhi_bits(HHI_HDMIRX_APLL_CNTL0, _BIT(28), onoff); - /*close termination 3.3v*/ - wr_reg_hhi_bits(HHI_HDMIRX_PHY_MISC_CNTL0, - MSK(3, 0), onoff); + aml_phy_power_off(); } } } -- 2.20.1