AST_HIF_HW_RESULT ast_hif_hw_init(AST_HIF_HW_CONFIG_T* pConfigParam)
{
    DCL_HANDLE gpio_handle;
    GPIO_CTRL_SET_CLK_OUT_T gpio_clk_data;
    ASSERT(pConfigParam != NULL);
    
    ast_gpio_wakeup_pin = gpio_ast_wakeup_pin;
    ast_gpio_rst_pin = gpio_ast_rst_pin;

    //enable 32k to AST1001
    gpio_handle = DclGPIO_Open(DCL_GPIO_CLK, AST_GPIO_CLK32K_MODULE);
    gpio_clk_data.u2ClkNum=AST_GPIO_CLK32K_MODULE;
    gpio_clk_data.u2Mode=mode_f32k_ck;
    DclGPIO_Control(gpio_handle,GPIO_CMD_SET_CLK_OUT,(DCL_CTRL_DATA_T*)&gpio_clk_data);
    DclGPIO_Close(gpio_handle);	
    
    ast_hif_port = AST_HIF_PORT;
    ast_hif_hw_handle = hif_open(AST_HIF_PORT);
    
    ASSERT(ast_hif_hw_handle);
    
    ast_hif_hw_power_ctrl(KAL_TRUE);
    
    ast_hif_hw_config(pConfigParam);
	{
		HIF_REALTIME_CALLBACK_T HifRealTimeCB;
		HifRealTimeCB.realtime_callback_en = KAL_TRUE;
	    hif_ioctl(ast_hif_hw_handle,HIF_IOCTL_REALTIME_CALLBACK,&HifRealTimeCB);
    }
    
    ast_hif_hw_power_ctrl(KAL_FALSE);
    return AST_HIF_HW_RESULT_OK;
}
Exemple #2
0
AST_HIF_HW_RESULT ast_hif_hw_init(AST_HIF_HW_CONFIG_T* pConfigParam)
{
    DCL_HANDLE gpio_handle;
    GPIO_CTRL_SET_CLK_OUT_T gpio_clk_data;
    #if defined(GET_AST_GPIO_CLK32K_LPCEID_BY_DCT_TOOL)
    ast_gpio_dct_init();
    #endif
    
    ASSERT(pConfigParam != NULL);

    //enable 32k to AST1001
    gpio_handle = DclGPIO_Open(DCL_GPIO_CLK, AST_GPIO_CLK32K_MODULE);
    gpio_clk_data.u2ClkNum=AST_GPIO_CLK32K_MODULE;
    gpio_clk_data.u2Mode=mode_f32k_ck;
    DclGPIO_Control(gpio_handle,GPIO_CMD_SET_CLK_OUT,(DCL_CTRL_DATA_T*)&gpio_clk_data);
    DclGPIO_Close(gpio_handle);	
    
    ast_hif_hw_handle = hif_open(AST_HIF_PORT);
    
    ASSERT(ast_hif_hw_handle);
    
    ast_hif_hw_power_ctrl(KAL_TRUE);
    
    ast_hif_hw_config(pConfigParam);
	{
		HIF_REALTIME_CALLBACK_T HifRealTimeCB;
		HIF_ULTRA_HIGH_CTRL_T UltraHighCtrl;
		HifRealTimeCB.realtime_callback_en = KAL_TRUE;
	  hif_ioctl(ast_hif_hw_handle,HIF_IOCTL_REALTIME_CALLBACK,&HifRealTimeCB);
       
    UltraHighCtrl.ultra_high_en = KAL_TRUE;
    hif_ioctl(ast_hif_hw_handle, HIF_IOCTL_ULTRA_HIGH_CTRL, &UltraHighCtrl);	
    }
    
    ast_hif_hw_power_ctrl(KAL_FALSE);
  #if defined(MT6922) && (!defined(__NLD_CENTRAL_CTRL__))
  #if defined(APOLLO22N_E2_EVB)
    set_lcd_driving_current(LCD_DRIVING_16MA);
  #else
    set_lcd_driving_current(LCD_DRIVING_8MA);
  #endif
#endif
    return AST_HIF_HW_RESULT_OK;
}