Exemplo n.º 1
0
void adac_startup_seq(void)
{
    /* toggle pdz 0->1 */
    adac_wr_reg(17, adac_rd_reg(17) & ~0x80);
    adac_latch();
    adac_wr_reg(17, adac_rd_reg(17) | 0x80);
    adac_latch();

    /* toggle rstdpz 0->1 */
    adac_wr_reg(0, adac_rd_reg(0) & ~2);
    adac_latch();
    adac_wr_reg(0, adac_rd_reg(0) | 2);
    adac_latch();
}
static void aml_audio_clock_gating_disable(void)
{
	struct snd_soc_codec* codec;
	//printk("***Entered %s:%s\n", __FILE__,__func__);
	//WRITE_CBUS_REG(HHI_GCLK_MPEG0, READ_CBUS_REG(HHI_GCLK_MPEG0)&~(1<<18));
	WRITE_CBUS_REG(HHI_GCLK_MPEG1, READ_CBUS_REG(HHI_GCLK_MPEG1)&~(1<<2)
								    //&~(0xFF<<6)
								    );
	//WRITE_CBUS_REG(HHI_GCLK_MPEG2, READ_CBUS_REG(HHI_GCLK_MPEG2)&~(1<<10));
	//WRITE_CBUS_REG(HHI_GCLK_OTHER, READ_CBUS_REG(HHI_GCLK_OTHER)&~(1<<10)
								    //&~(1<<18)
								    //&~(0x7<<14));
	mute_spk(codec,1);							    
	WRITE_APB_REG(APB_ADAC_POWER_CTRL_REG2, READ_APB_REG(APB_ADAC_POWER_CTRL_REG2)&(~(1<<7)));
	adac_latch();
	
}
static void aml_audio_clock_gating_enable(void)
{
	struct snd_soc_codec* codec;
	printk("***Entered %s:%s\n", __FILE__,__func__);
	//WRITE_CBUS_REG(HHI_GCLK_MPEG0, READ_CBUS_REG(HHI_GCLK_MPEG0)|(1<<18));
	WRITE_CBUS_REG(HHI_GCLK_MPEG1, READ_CBUS_REG(HHI_GCLK_MPEG1)|(1<<2)
								    //|(0xFF<<6)
								    );
	//WRITE_CBUS_REG(HHI_GCLK_MPEG2, READ_CBUS_REG(HHI_GCLK_MPEG2)|(1<<10));
	//WRITE_CBUS_REG(HHI_GCLK_OTHER, READ_CBUS_REG(HHI_GCLK_OTHER)|(1<<10)
								    //|(1<<18)
								    //|(0x7<<14));
	WRITE_APB_REG(APB_ADAC_POWER_CTRL_REG2, READ_APB_REG(APB_ADAC_POWER_CTRL_REG2)|(1<<7));
	if(aml_m3_is_hp_pluged()){
		mute_spk(codec,1);	
	}
	else 
		mute_spk(codec,0);
	adac_latch();
}