tvafe: lower shutdown power for tl1 [1/1]

PD#SWPL-6165

Problem:
TL1 vdee power too high when shutdown

Solution:
close bandgap when shut down for tl1
close vafe ctrl
close adc pll

Verify:
X301

Change-Id: I374bbe09ecdd456ea07f1fda3391acd4ab0bc949
Signed-off-by: Nian Jing <nian.jing@amlogic.com>

Conflicts:
	drivers/amlogic/media/vout/vdac/vdac_dev.c
This commit is contained in:
Nian Jing
2019-03-27 19:04:53 +08:00
committed by Luke Go
parent c120aa81ed
commit 9b63ffb463
9 changed files with 33 additions and 14 deletions

View File

@@ -786,6 +786,7 @@ static void aml_atvdemod_shutdown(struct platform_device *pdev)
struct aml_atvdemod_device *dev = platform_get_drvdata(pdev);
v4l2_frontend_shutdown(&dev->v4l2_fe);
adc_pll_down();
pr_info("%s: OK.\n", __func__);
}

View File

@@ -3080,7 +3080,8 @@ static int leave_mode(enum aml_fe_n_mode_t mode)
}
}
adc_set_pll_cntl(0, 0x04, NULL);
adc_set_pll_cntl(0, 0x4, NULL);
adc_set_pll_cntl(0, 0x8, NULL);
demod_mode_para = UNKNOWN;
/* should disable the adc ref signal for demod */
/*vdac_enable(0, 0x2);*/
@@ -3736,6 +3737,7 @@ static void aml_dtvdemod_shutdown(struct platform_device *pdev)
leave_mode(nmode);
dtvdd_devp->state = DTVDEMOD_ST_IDLE;
}
adc_pll_down();
}

View File

@@ -485,7 +485,7 @@ void adc_dpll_setup(int clk_a, int clk_b, int clk_sys, int dvb_mode)
/* debug only */
/*printk("adcpllctl=0x%x\n",adc_pll_cntl.d32);*/
sts_pll = adc_set_pll_cntl(1, 0x0c, &ddemod_pll);
sts_pll = adc_set_pll_cntl(1, 0x8, &ddemod_pll);
if (sts_pll < 0) {
/*set pll fail*/
PR_ERR("%s:set pll fail! please check!\n", __func__);

View File

@@ -1485,6 +1485,11 @@ static int tvafe_drv_resume(struct platform_device *pdev)
static void tvafe_drv_shutdown(struct platform_device *pdev)
{
if (tvafe_cpu_type() == CPU_TYPE_TL1) {
W_APB_BIT(TVFE_VAFE_CTRL0, 0, 19, 1);
W_APB_BIT(TVFE_VAFE_CTRL1, 0, 8, 1);
}
adc_pll_down();
tvafe_pr_info("tvafe_drv_shutdown ok.\n");
}

View File

@@ -32,7 +32,7 @@
/* ************************************************* */
/* *** macro definitions ********************************************* */
/* *********************************************************** */
#define TVAFE_VER "Ref.2019/03/18"
#define TVAFE_VER "Ref.2019/03/29"
/* used to set the flag of tvafe_dev_s */
#define TVAFE_FLAG_DEV_OPENED 0x00000010

View File

@@ -41,8 +41,6 @@
#define VAFE_CLK_SELECT 24
#define VAFE_CLK_SELECT_WIDTH 2
static unsigned int adc_pll_chg;
/* TOP */
@@ -599,6 +597,21 @@ void tvafe_enable_avout(enum tvin_port_e port, bool enable)
}
}
void adc_pll_down(void)
{
if (!adc_pll_chg &&
tvafe_cpu_type() == CPU_TYPE_TL1 &&
R_HIU_BIT(HHI_ADC_PLL_CNTL0_TL1, 28, 1)) {
W_HIU_BIT(HHI_ADC_PLL_CNTL0_TL1, 0, 28, 1);
tvafe_pr_info("%s: ok\n", __func__);
}
}
/*module_sel*/
/*ADC_EN_ATV_DEMOD 0x1*/
/*ADC_EN_TVAFE 0x2*/
/*ADC_EN_DTV_DEMOD 0x4*/
/*ADC_EN_DTV_DEMODPLL 0x8*/
int adc_set_pll_cntl(bool on, unsigned int module_sel, void *pDtvPara)
{
unsigned int adc_pll_lock_cnt = 0;

View File

@@ -137,7 +137,7 @@
#define ADC_EN_ATV_DEMOD 0x1
#define ADC_EN_TVAFE 0x2
#define ADC_EN_DTV_DEMOD 0x4
#define ADC_EN_DTV_DEMODPLL 0xC
#define ADC_EN_DTV_DEMODPLL 0x8
#define LOG_ADC_CAL
/* #define LOG_VGA_EDID */

View File

@@ -749,7 +749,7 @@ static void amvdac_drv_shutdown(struct platform_device *pdev)
if (s_vdac_data->cpu_id == VDAC_CPU_TXL ||
s_vdac_data->cpu_id == VDAC_CPU_TXLX)
cntl1 = 0x0;
else if (s_vdac_data->cpu_id == VDAC_CPU_TL1)
else if (s_vdac_data->cpu_id >= VDAC_CPU_TL1)
cntl1 = 0x80;
else
cntl1 = 0x8;

View File

@@ -472,13 +472,6 @@ struct tvafe_pin_mux_s {
*function defined applied for other driver
*/
/*
*adc pll ctl, atv demod & tvafe use the same adc module
* module index: atv demod:0x01; tvafe:0x2
*/
/* extern void adc_set_pll_cntl(bool on, unsigned int module_sel);*/
struct dfe_adcpll_para {
unsigned int adcpllctl;
unsigned int demodctl;
@@ -509,6 +502,11 @@ struct rx_audio_stat_s {
bool afifo_thres_pass;
};
extern void adc_pll_down(void);
/*ADC_EN_ATV_DEMOD 0x1*/
/*ADC_EN_TVAFE 0x2*/
/*ADC_EN_DTV_DEMOD 0x4*/
/*ADC_EN_DTV_DEMODPLL 0x8*/
extern int adc_set_pll_cntl(bool on, unsigned int module_sel, void *pDtvPara);
extern void tvafe_set_ddemod_default(void);/* add for dtv demod*/
extern void rx_get_audio_status(struct rx_audio_stat_s *aud_sts);