コード例 #1
0
void Ana_Set_Reg(kal_uint32 offset, kal_uint32 value, kal_uint32 mask)
{
   volatile kal_uint32 address = (offset);
   volatile kal_uint32 *Analog_Register = (volatile kal_uint32 *)address;

   volatile kal_uint32 val_tmp;
   PRINTK_ANA_REG("Ana_Set_Reg offset=%x, value=%x, mask=%x \n",offset,value,mask);
   val_tmp = READ_REGISTER_UINT32(Analog_Register);
   val_tmp &= (~mask);
   mt65xx_reg_sync_writel(val_tmp,Analog_Register);
   val_tmp = READ_REGISTER_UINT32(Analog_Register);
   val_tmp |= (value&mask);
   mt65xx_reg_sync_writel(val_tmp,Analog_Register);

}
コード例 #2
0
void Ana_Set_Reg(kal_uint32 offset, kal_uint32 value, kal_uint32 mask)
{
   volatile kal_uint32 address = (offset);
   volatile kal_uint32 *Analog_Register = (volatile kal_uint32 *)address;
   volatile kal_uint32 val_tmp;

   AudDrv_ANA_Clk_On();
   val_tmp = READ_REGISTER_UINT32(Analog_Register);
   val_tmp &= (~mask);
   val_tmp |= (value&mask);
   mt65xx_reg_sync_writel(val_tmp,Analog_Register);
   AudDrv_ANA_Clk_Off();

   //Back Ana Reg
   Ana_Backup_Reg(address,val_tmp);
   if(Ana_Check_Backup_Memory(offset)==0){
       xlog_printk(ANDROID_LOG_INFO, "Sound","Fail to backup Ana Register @Offset=0x%x\n",offset);
   }

/*
   *Analog_Register &= (~mask);
   dsb();
   *Analog_Register |= (value&mask);
   dsb();
*/
}
コード例 #3
0
ファイル: test.c プロジェクト: ferhung/p201-mediatek
static u32 read_u32_cnt(void)
{
    //printf("(yjdbg) 0xf0008030: 0x%x\n", READ_REGISTER_UINT32(0xf0008030));
    //printf("(yjdbg) 0xf0008034: 0x%x\n", READ_REGISTER_UINT32(0xf0008034));
    //printf("(yjdbg) 0xf0008020: 0x%x\n", READ_REGISTER_UINT32(0xf0008020));
    //printf("(yjdbg) 0xf0008024: 0x%x\n", READ_REGISTER_UINT32(0xf0008024));
    return READ_REGISTER_UINT32(0xf0008008 + TIMEIDX*0x10);
}
コード例 #4
0
kal_uint32 Afe_Get_Reg(kal_uint32 offset)
{
   volatile kal_uint32 address = (AFE_BASE+offset);
   volatile kal_uint32 *Analog_Register = (volatile kal_uint32 *)address;
   volatile kal_uint32 val_tmp;
   val_tmp = READ_REGISTER_UINT32(Analog_Register);
   PRINTK_AFE_REG("Afe_Get_Reg offset=%x, value=%d \n",offset,*value);
   return val_tmp;
}
コード例 #5
0
/*****************************************************************************
*                        F U N C T I O N   D E F I N I T I O N
******************************************************************************
*/
void Afe_Set_Reg(kal_uint32 offset, kal_uint32 value , kal_uint32 mask)
{
   volatile kal_uint32 address = (AFE_BASE+offset);
   volatile kal_uint32 *AFE_Register = (volatile kal_uint32*)address;

   volatile kal_uint32 val_tmp;
   PRINTK_AFE_REG("Afe_Set_Reg offset=%x, value=%x, mask=%x \n",offset,value,mask);
   val_tmp = READ_REGISTER_UINT32(AFE_Register);
   val_tmp &= (~mask);
   /*
   mt65xx_reg_sync_writel(val_tmp,AFE_Register);
   val_tmp = READ_REGISTER_UINT32(AFE_Register);
   */
   val_tmp |= (value&mask);
   mt65xx_reg_sync_writel(val_tmp,AFE_Register);
/*
   *AFE_Register &= (~mask);
   dsb();
   *AFE_Register |= (value&mask);
   dsb();
*/
}