コード例 #1
0
static void lcm_init(void)
{
int kk =0;
	#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);

	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
  hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif
    MDELAY(100);


    SET_RESET_PIN(1);
    SET_RESET_PIN(0);
    MDELAY(10);//10
    SET_RESET_PIN(1);
    MDELAY(50);//50
     kk = lcm_check_id();
	if(kk == 1)
	{
            push_table(lcm_initialization_setting_ykl, sizeof(lcm_initialization_setting_ykl) / sizeof(struct LCM_setting_table), 1);
	}
	else
	{
           push_table(lcm_initialization_setting, sizeof(lcm_initialization_setting) / sizeof(struct LCM_setting_table), 1);
	}
}
static void lcm_init(void)
{
	int flag=0;
	
#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);
	
	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
	hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif
	MDELAY(100);
	
	SET_RESET_PIN(1);
	SET_RESET_PIN(0);
	MDELAY(1);
	SET_RESET_PIN(1);
	MDELAY(10);

    Lcd_Log("mycat otm8018b flag=%d  \n",flag);
	push_table(lcm_initialization_setting, sizeof(lcm_initialization_setting) / sizeof(struct LCM_setting_table), 1);
}
static void lcm_init(void)
{
#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);

	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
 	hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif

#ifdef BUILD_LK
	printf("MYCAT ILI9608 lk lcm_init\n");
#else
	printk("MYCAT ILI9608  kernel lcm_init\n");
#endif
    SET_RESET_PIN(1);
    MDELAY(1);
    SET_RESET_PIN(0);
    MDELAY(20);
    SET_RESET_PIN(1);
    MDELAY(120);
		push_table(lcm_initialization_setting, sizeof(lcm_initialization_setting) / sizeof(struct LCM_setting_table), 1);
    //init_lcm_registers();
}
static unsigned int lcm_compare_id(void)
{
	int i;
#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);

	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
       hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif
  MDELAY(100);
  	mt_set_gpio_mode(GPIO_LCD_PIN_ID, GPIO_MODE_00);
	 mt_set_gpio_dir(GPIO_LCD_PIN_ID, GPIO_DIR_IN);
	//mt_set_gpio_pull_enable(GPIO_LCD_PIN_ID, 1);
	//mt_set_gpio_pull_select(GPIO_LCD_PIN_ID, GPIO_PULL_UP);	
  	
 	i=mt_get_gpio_in(GPIO_LCD_PIN_ID);  
#ifdef BUILD_LK
	printf("MYCAT NT35512 lk  lcm_compare_id=%d\n",i);
#else
     printk("MYCAT NT35512 kernel  lcm_compare_id=%d\n",i);
#endif
	if(i == 1)
		return 1;
	else
    		return 1;
}
コード例 #5
0
static void lcm_init(void)
{
#ifdef BUILD_LK
    upmu_set_rg_vgp2_vosel(5);
    upmu_set_rg_vgp2_en(1);
    MDELAY(50);
		
    upmu_set_rg_vgp3_vosel(3);
    upmu_set_rg_vgp3_en(1); 
#else
    hwPowerOn(MT6323_POWER_LDO_VGP2,VOL_2800,"LCM28");
    hwPowerOn(MT6323_POWER_LDO_VGP3,VOL_1800,"LCM18");
#endif
    MDELAY(100);

    config_gpio();
    SET_RESET_PIN(1);
    MDELAY(10);
    SET_RESET_PIN(0);
    MDELAY(20);
    SET_RESET_PIN(1);
    MDELAY(50);

    init_lcm_registers();
}
コード例 #6
0
static void lcm_init(void)
{
	unsigned int data_array[64];
	
	#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);

	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
       hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif

    mt_set_gpio_mode(59,GPIO_MODE_00);
    mt_set_gpio_dir(59,GPIO_DIR_OUT);
    mt_set_gpio_out(59,GPIO_OUT_ONE);
 MDELAY(10);//Must > 10ms
	 mt_set_gpio_out(59,GPIO_OUT_ZERO);
 MDELAY(10);//Must > 10ms
	  mt_set_gpio_out(59,GPIO_OUT_ONE);
   MDELAY(120);//Must > 120m

    push_table(lcm_initialization_setting, sizeof(lcm_initialization_setting) / sizeof(struct LCM_setting_table), 1);
}
static unsigned int lcm_compare_id(void)
{
	int   array[4];
		char  buffer[5];
		unsigned int id=0;
	#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);

	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
  hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif
    MDELAY(100);	
		SET_RESET_PIN(0);
		MDELAY(200);
		SET_RESET_PIN(1);
		MDELAY(200);
		
	array[0] = 0x00083700;// read id return two byte,version and id
	dsi_set_cmdq(array, 1, 1);

	read_reg_v2(0xA1,buffer,4);
	
	id=(buffer[2]<<8)+buffer[3];

	return (LCM_ID == id)?1:0;
}
コード例 #8
0
/* VGP2 3.0v LDO enable */
static void ldo_3v0_on(void)
{

#ifdef BUILD_UBOOT 
	#error "not implemeted"
#elif defined(BUILD_LK)
    #if defined(_Y70_Rev_A_)    // Y70 Rev.A board
	upmu_set_rg_vgp1_vosel(6);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
	upmu_set_rg_vgp1_en(1);    
    #elif defined(_Y70_Rev_B_)  // Y70 Rev.B board    
	upmu_set_rg_vgp2_vosel(6);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
	upmu_set_rg_vgp2_en(1);
    #else               // Y70 Rev.A-2 board
	upmu_set_rg_vgp2_vosel(6);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
	upmu_set_rg_vgp2_en(1);	
    #endif /* _Y70_Rev_A_ */
#else
    #if defined(_Y70_Rev_A_)    // Y70 Rev.A board
	hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_3000, "3V0_TOUCH_VDD");	    
    #elif defined(_Y70_Rev_B_)  // Y70 Rev.B board        
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_3000, "3V0_MTK_LCD_VCC");	
    #else               // Y70 Rev.A-2 board
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_3000, "3V0_LCD_VCC_MTK_S");	
    #endif /* _Y70_Rev_A_ */
#endif

}
コード例 #9
0
/* VCAMD 1.8v LDO enable */
static void ldo_1v8io_on(void)
{
#ifdef BUILD_UBOOT 
	#error "not implemeted"
#elif defined(BUILD_LK) 	
    if ( g_PCBver==HW_REV_B )
    {
    	upmu_set_rg_vgp1_vosel(3);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
    	upmu_set_rg_vgp1_en(1);        
    }
    else if ( g_PCBver==HW_REV_A_2 )
    {
    	upmu_set_rg_vcamd_vosel(3);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
    	upmu_set_rg_vcamd_en(1);        
    }
    else    //( g_PCBver==HW_REV_A )
    {
    	upmu_set_rg_vgp2_vosel(3);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
    	upmu_set_rg_vgp2_en(1);
    }
#else
    if ( g_PCBver==HW_REV_B )
    {
    	hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_1800, "1V8_MTK_LCD_IO");	        
    }
    else if ( g_PCBver==HW_REV_A_2 )
    {
    	hwPowerOn(MT6323_POWER_LDO_VCAMD, VOL_1800, "1V8_LCD_VIO_MTK_S");	        
    }
    else    //( g_PCBver==HW_REV_A )
    {
    	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_1800, "1V8_LCD_VIO_MTK_S");	        
    }    
#endif 
}
コード例 #10
0
/* VCAMD 1.8v LDO enable */
static void ldo_1v8io_on(void)
{
#ifdef BUILD_UBOOT 
	#error "not implemeted"
#elif defined(BUILD_LK) 	
    #if defined(_Y70_Rev_A_)    // Y70 Rev.A board
	upmu_set_rg_vgp2_vosel(3);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
	upmu_set_rg_vgp2_en(1);
    #elif defined(_Y70_Rev_B_)  // Y70 Rev.B board
	upmu_set_rg_vgp1_vosel(3);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
	upmu_set_rg_vgp1_en(1);
    #else               // Y70 Rev.A-2 board
	upmu_set_rg_vcamd_vosel(3);  // VGP2_SEL= 101 : 2.8V , 110 : 3.0V
	upmu_set_rg_vcamd_en(1);
    #endif /* _Y70_Rev_A_ */
#else
    #if defined(_Y70_Rev_A_)    // Y70 Rev.A board
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_1800, "1V8_LCD_VIO_MTK_S");	    
    #elif defined(_Y70_Rev_B_)  // Y70 Rev.B board
	hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_1800, "1V8_MTK_LCD_IO");	
    #else               // Y70 Rev.A-2 board
	hwPowerOn(MT6323_POWER_LDO_VCAMD, VOL_1800, "1V8_LCD_VIO_MTK_S");	
    #endif /* _Y70_Rev_A_ */
#endif 
}
static unsigned int lcm_compare_id(void)
{
        unsigned int array[4];
        unsigned char buffer[1];
        unsigned char id_high=0;
        unsigned char id_midd=0;
        unsigned char id_low=0;
        unsigned int id=0;
	Lcd_Log("lcm_compare_id\n");
#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);
	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);
	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
	hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif
	MDELAY(50);

#ifdef BUILD_LK
	printf("MYCAT ILI9608 lk lcm_init\n");
#else
      printk("MYCAT ILI9608  kernel lcm_init\n");
#endif
    SET_RESET_PIN(1);
    MDELAY(30);
    SET_RESET_PIN(0);
    MDELAY(50);
    SET_RESET_PIN(1);
    MDELAY(120);

        array[0]=0x00063902;
        array[1]=0x0698ffff;
        array[2]=0x00000104;
        dsi_set_cmdq(array, 3, 1);
        MDELAY(10);

        array[0]=0x00023700;
        dsi_set_cmdq(array, 1, 1);
        //read_reg_v2(0x04, buffer, 3);//if read 0x04,should get 0x008000,that is both OK.
    
        read_reg_v2(0x00, buffer,1);
        id_high = buffer[0]; ///////////////////////0x98

        read_reg_v2(0x01, buffer,1);
        id_midd = buffer[0]; ///////////////////////0x06

        read_reg_v2(0x02, buffer,1);
        id_low = buffer[0]; ////////////////////////0x04

        id = (id_high << 16) | (id_midd << 8) | id_low;
        
        Lcd_Log("id=0x%x,get_lcd_id=%d \n",id,get_lcd_id());
//        return (LCM_ID == id)?1:0;
        //return (get_lcd_id()==1)?1:0;
	return (LCM_ID == id&&get_lcd_id()==0)?1:0;
        }
コード例 #12
0
static void lcm_resume(void)
{

	unsigned int data_array[16];
	#ifdef BUILD_LK
		printf("%s, LK \n", __func__);
	#else
		pr_debug("%s, kernel", __func__);
	#endif
	
#ifdef BUILD_LK
	//printf("[LK/LCM] lcm_resume() enter\n");
	//VGP6 3.3V
	pmic_config_interface(0x424, 0x1, 0x1, 15); 
	pmic_config_interface(0x45a, 0x07, 0x07, 5);
	//vgp4 1.8V
	pmic_config_interface(0x420, 0x1, 0x1, 15); 
	pmic_config_interface(0x43c, 0x03, 0x07, 5);
#else
	hwPowerOn(MT65XX_POWER_LDO_VGP6, VOL_3300, "LCM");
	hwPowerOn(MT65XX_POWER_LDO_VGP4, VOL_1800, "LCM");
#endif

	mt_set_gpio_mode(GPIO_LCD_RST_EN, GPIO_MODE_00);
	mt_set_gpio_dir(GPIO_LCD_RST_EN, GPIO_DIR_OUT);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
	MDELAY(20);
		
	mt_set_gpio_mode(GPIO_LCD_STB_EN, GPIO_MODE_00);
	mt_set_gpio_dir(GPIO_LCD_STB_EN, GPIO_DIR_OUT);
	mt_set_gpio_out(GPIO_LCD_STB_EN, GPIO_OUT_ONE);
	MDELAY(20);
//#endif

	//unsigned int data_array[16];
	//lcm_init();
	MDELAY(50); 
	
	SET_RESET_PIN(1);
	SET_RESET_PIN(0);
	MDELAY(1);
	SET_RESET_PIN(1);


	init_lcm_registers();

	data_array[0] = 0x00101500; // Sleep Out
	dsi_set_cmdq(data_array, 1, 1);
	MDELAY(20);

	data_array[0] = 0x00290500; // Display On
	dsi_set_cmdq(data_array, 1, 1);

}
コード例 #13
0
static void lcm_init(void)
{

	#ifdef BUILD_LK
		printf("%s, LK \n", __func__);
	#else
		pr_debug("%s, kernel", __func__);
	#endif
	
	#ifdef BUILD_LK
		//printf("[LK/LCM] lcm_init() enter\n");
	//VGP6 3.3V
	pmic_config_interface(0x424, 0x1, 0x1, 15); 
	pmic_config_interface(0x45a, 0x07, 0x07, 5);
	//vgp4 1.8V
	pmic_config_interface(0x420, 0x1, 0x1, 15); 
	pmic_config_interface(0x43c, 0x03, 0x07, 5);
	
	mt_set_gpio_mode(GPIO_LCD_RST_EN, GPIO_MODE_00);
	mt_set_gpio_dir(GPIO_LCD_RST_EN, GPIO_DIR_OUT);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
	MDELAY(20);
	
	mt_set_gpio_mode(GPIO_LCD_STB_EN, GPIO_MODE_00);
	mt_set_gpio_dir(GPIO_LCD_STB_EN, GPIO_DIR_OUT);
	mt_set_gpio_out(GPIO_LCD_STB_EN, GPIO_OUT_ONE);
	MDELAY(20);

	/*MDELAY(50); 
	
	SET_RESET_PIN(1);
	SET_RESET_PIN(0);
	MDELAY(1);
	SET_RESET_PIN(1);


	init_lcm_registers();*/
	#else
	
	hwPowerOn(MT65XX_POWER_LDO_VGP6, VOL_3300, "LCM");
	hwPowerOn(MT65XX_POWER_LDO_VGP4, VOL_1800, "LCM");
	#endif 

	MDELAY(50); 
	
	SET_RESET_PIN(1);
	SET_RESET_PIN(0);
	MDELAY(1);
	SET_RESET_PIN(1);


	init_lcm_registers();
}
static unsigned int lcm_compare_id(void)
{
#if defined(BUILD_LK)
		upmu_set_rg_vgp2_vosel(5);
		upmu_set_rg_vgp2_en(1);
		
		upmu_set_rg_vgp3_vosel(3);
		upmu_set_rg_vgp3_en(1);	
#else
		hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
		hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif
    int array[4];
    char buffer[1];
    char id_high=0;
    char id_midd=0;
    char id_low=0;
    int id=0;

    //Do reset here
    SET_RESET_PIN(1);
    SET_RESET_PIN(0);
    MDELAY(25);       
    SET_RESET_PIN(1);
    MDELAY(50);      
   
    array[0]=0x00063902;
    array[1]=0x0698ffff;
    array[2]=0x00000104;
    dsi_set_cmdq(array, 3, 1);
    MDELAY(10);

    array[0]=0x00023700;
    dsi_set_cmdq(array, 1, 1);
    //read_reg_v2(0x04, buffer, 3);//if read 0x04,should get 0x008000,that is both OK.

    read_reg_v2(0x00, buffer,1);
    id_high = buffer[0]; ///////////////////////0x98

    read_reg_v2(0x01, buffer,1);
    id_midd = buffer[0]; ///////////////////////0x06

    read_reg_v2(0x02, buffer,1);
    id_low = buffer[0]; ////////////////////////0x04

    id = (id_high << 16) | (id_midd << 8) | id_low;
    
    Lcd_Log("wqcat %s, 0x00=0x%x,0x01=0x%x,0x02=0x%x,id=0x%x\n", __func__, id_high,id_midd,id_low,id);
    return (LCM_ID == id&&get_lcd_id()==1)?1:0;
    //return (get_lcd_id()==1)?1:0;

}
static unsigned int lcm_compare_id()
{
//	return 1;
#if 0	
    unsigned int id = 0, id2 = 0;
    unsigned char buffer[2];
    unsigned int data_array[16];

#if defined(BUILD_LK)
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);

	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
	hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_2800, "Lance_LCM");
       hwPowerOn(MT6323_POWER_LDO_VGP3, VOL_1800, "Lance_LCM");
#endif
    MDELAY(100);


    SET_RESET_PIN(1);
    MDELAY(20);
    SET_RESET_PIN(0);
    MDELAY(50);
    SET_RESET_PIN(1);
    MDELAY(100);

    //*************Enable CMD2 Page1  *******************//
    data_array[0]=0x00043902;
    data_array[1]=0x6983ffb9;//52AA55F0;
    //data_array[2]=0x00000108;
    dsi_set_cmdq(data_array, 3, 1);
    MDELAY(10);

    data_array[0] = 0x00023700;// read id return two byte,version and id
    dsi_set_cmdq(data_array, 1, 1);
    MDELAY(10);

    read_reg_v2(0xF4, buffer, 2);
    id = buffer[0]; //we only need ID

    Lcd_Log("\n %s HX8369A 0x%x , 0x%x , 0x%x \n",__func__,buffer[0],buffer[1],id);

    return (id == LCM_ID)?1:0;
#else
    Lcd_Log("mycat xxxxxx get_lcd_id=0x%x\n",get_lcd_id());
    return (get_lcd_id()==1)?1:0;
#endif
}
コード例 #16
0
static unsigned int lcm_compare_id(void)
{
   unsigned int id = 0, id2 = 0;
    unsigned char buffer[3];
    unsigned int data_array[16];

#ifdef BUILD_LK
	upmu_set_rg_vgp2_vosel(5);
	upmu_set_rg_vgp2_en(1);

	upmu_set_rg_vgp3_vosel(3);
	upmu_set_rg_vgp3_en(1);	
#else
  hwPowerOn(MT6323_POWER_LDO_VGP2,VOL_2800,"LCM");
	hwPowerOn(MT6323_POWER_LDO_VGP3,VOL_1800,"LCM");
#endif
    MDELAY(100);

    SET_RESET_PIN(1);  //NOTE:should reset LCM firstly
    MDELAY(10);
    SET_RESET_PIN(0);
    MDELAY(50);
    SET_RESET_PIN(1);
    MDELAY(180);	
    

  /*  data_array[0]=0x00043902;
    data_array[1]=0x1698FFFF;
    dsi_set_cmdq(data_array, 2, 1);
    MDELAY(20); */
    
    data_array[0] = 0x00043700;// read id return two byte,version and id
    dsi_set_cmdq(data_array, 1, 1);
    MDELAY(20); 
    
    read_reg_v2(0xD3, buffer, 4);
    id = buffer[2]; //we only need ID
    id2= buffer[1] << 8 | buffer[2]; //we test buffer 1
    
 
    Lcd_Log("MYCAT ILI9806 A40318 %s, id=0x%x,id2=0x%x\n", __func__, id,id2);
 
 
    return (LCM_ID == id2)?1:0;
	//return 1;

	   // return (get_lcd_id()==1)?1:0;

}
コード例 #17
0
static void lcm_init_power(void)
{
#ifdef BUILD_LK
    mt6325_upmu_set_rg_vgp1_en(1);
    dprintf(0, "vgp3 on\n");
    MDELAY(1);
    mt6325_upmu_set_rg_vgp3_vosel(3);
    mt6325_upmu_set_rg_vgp3_en(1);
#else
    printk("vgp3 on\n");
    hwPowerOn(MT6325_POWER_LDO_VGP1, VOL_3000, "TOUCH");
    hwPowerOn(MT6325_POWER_LDO_VGP3, VOL_1800, "LCD");
#endif
    MDELAY(5);
}
コード例 #18
0
static void fts_6x06_hw_init(void)
{
#ifdef TPD_POWER_SOURCE_CUSTOM
    hwPowerOn(TPD_POWER_SOURCE_CUSTOM, VOL_2800, "TP");
#else
	hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_2800, "TP");
#endif
	msleep(2);  
	
	//Reset CTP
	mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO);
	mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT);
	mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ONE);
	msleep(30);
}
コード例 #19
0
static unsigned int lcm_compare_id(void)
{
	unsigned int id;
	unsigned char buffer[5];
	unsigned int array[5];
#ifdef BUILD_LK
	upmu_set_rg_vgp6_vosel(6);
	upmu_set_rg_vgp6_en(1);
#else
	hwPowerOn(MT65XX_POWER_LDO_VGP6, VOL_2800, "LCM");
#endif

	mt_set_gpio_mode(GPIO_LCD_RST_EN, GPIO_MODE_00);
	mt_set_gpio_dir(GPIO_LCD_RST_EN, GPIO_DIR_OUT);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
	MDELAY(10);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ZERO);
	MDELAY(10);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
	MDELAY(100);

	push_table(lcm_compare_id_setting,
		   sizeof(lcm_compare_id_setting) /
		   sizeof(struct LCM_setting_table), 1);

	read_reg_v2(0xc5, buffer, 2);
	id = ((buffer[0] << 8) | buffer[1]);
#if defined(BUILD_LK)
	printf
	    ("%s, [rm68180_boe60_wcl]  buffer[0] = [0x%d] buffer[2] = [0x%d] ID = [0x%d]\n",
	     __func__, buffer[0], buffer[1], id);
#endif

	return ((LCM_RM68180_ID == id)? 1 : 0);
}
コード例 #20
0
static void lcm_init(void)
{
#ifndef BUILD_LK
    printk("vgp3 on\n");
    hwPowerOn(MT6325_POWER_LDO_VGP3, VOL_1800, "LCD");
#endif
    MDELAY(200);

    /*-----------------DSV start---------------------*/
    mt_set_gpio_mode(GPIO_DW8768_ENP, GPIO_MODE_00);
    mt_set_gpio_dir(GPIO_DW8768_ENP, GPIO_DIR_OUT);
    mt_set_gpio_out(GPIO_DW8768_ENP, GPIO_OUT_ONE);
    mt_set_gpio_mode(GPIO_DW8768_ENN, GPIO_MODE_00);
    mt_set_gpio_dir(GPIO_DW8768_ENN, GPIO_DIR_OUT);
    mt_set_gpio_out(GPIO_DW8768_ENN, GPIO_OUT_ONE);
    MDELAY(20);
    /*-----------------DSV end---------------------*/

    mt_set_gpio_out(GPIO_LCM_RST, GPIO_OUT_ONE);
    MDELAY(20);

    mt_set_gpio_out(GPIO_LCM_RST, GPIO_OUT_ZERO);
    MDELAY(2);

    mt_set_gpio_out(GPIO_LCM_RST, GPIO_OUT_ONE);
    MDELAY(20);

    push_table(lcm_initialization_setting, sizeof(lcm_initialization_setting) / sizeof(struct LCM_setting_table), 1);
}
コード例 #21
0
static void lcm_init(void)
{
	unsigned char buffer[5];
	unsigned int array[16];
#ifdef BUILD_LK
	upmu_set_rg_vgp6_vosel(6);
	upmu_set_rg_vgp6_en(1);
#else
	hwPowerOn(MT65XX_POWER_LDO_VGP6, VOL_3300, "LCM");
#endif
#if 0
	SET_RESET_PIN(1);
	MDELAY(1);
	SET_RESET_PIN(0);
	MDELAY(10);
	SET_RESET_PIN(1);
	MDELAY(60);
#else
	mt_set_gpio_mode(GPIO_LCD_RST_EN, GPIO_MODE_00);
	mt_set_gpio_dir(GPIO_LCD_RST_EN, GPIO_DIR_OUT);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
	MDELAY(10);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ZERO);
	MDELAY(50);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
	MDELAY(120);
#endif
	push_table(lcm_initialization_setting,
		   sizeof(lcm_initialization_setting) /
		   sizeof(struct LCM_setting_table), 1);
}
コード例 #22
0
//#define
//Main jobs:
// 1.check for device-specified errors, device not ready.
// 2.Initialize the device if it is opened for the first time.
static int CAM_CAL_Open(struct inode * a_pstInode, struct file * a_pstFile)
{
    CAM_CALDB("[S24CAM_CAL] CAM_CAL_Open\n");
    spin_lock(&g_CAM_CALLock);
    if(g_u4Opened)
    {
        spin_unlock(&g_CAM_CALLock);
		CAM_CALDB("[S24CAM_CAL] Opened, return -EBUSY\n");
        return -EBUSY;
    }
    else
    {
        g_u4Opened = 1;
        atomic_set(&g_CAM_CALatomic,0);
    }
    spin_unlock(&g_CAM_CALLock);


    if(TRUE != hwPowerOn(MT65XX_POWER_LDO_VCAMA, VOL_2800, CAM_CAL_DRVNAME))
    {
        CAM_CALDB("[S24CAM_CAL] Fail to enable analog gain\n");
        return -EIO;
    }

    return 0;
}
コード例 #23
0
static unsigned int lcm_compare_id(void)
{
    unsigned int id = 0;

#ifdef BUILD_LK
			pmic_config_interface(0x0532,5,0x7,5);//add by libo for VGP2 POWER ON
			pmic_config_interface(0x050C,1,0x1,15);
#else
			hwPowerOn(MT6323_POWER_LDO_VGP2,VOL_2800,"LCM");
#endif
			MDELAY(100);
    SET_RESET_PIN(1);
    MDELAY(20);
    SET_RESET_PIN(0);
    MDELAY(20);
    SET_RESET_PIN(1);
    MDELAY(100);
		send_ctrl_cmd(0xDA00);
	 	id = read_data_cmd();
	 	send_ctrl_cmd(0xDB00);
	 	id = read_data_cmd()<<8;
	 	send_ctrl_cmd(0xDC00);
	 	id |= read_data_cmd();

#if defined(BUILD_LK)
	printf("MYCAT Read NT35510 id = %x\n",  id);
#endif

	if(LCM_ID == id)
		return 1;
	else
		return 0;
}
コード例 #24
0
static void lcm_suspend(void)
{
#ifdef BUILD_LK

	printf("[LK/LCM] lcm_suspend() enter\n");

	lcm_set_gpio_output(GPIO_LCM_RST_EN, 0);
	MDELAY(300);
    //AVDD power off
	lcm_set_gpio_output(GPIO_LCM_PWR_EN, 0);
	MDELAY(2);

	//VDD power off ->VGP3_PMU 1.8V
	upmu_set_rg_vgp3_vosel(0);
	upmu_set_rg_vgp3_en(0);	
	MDELAY(20);
	
#elif (defined BUILD_UBOOT)
#else

	printk("[LCM] lcm_suspend() enter\n");

    lcm_set_gpio_output(GPIO_LCM_RST_EN, 0);
	MDELAY(300);
    //AVDD power off
	lcm_set_gpio_output(GPIO_LCM_PWR_EN, 0);
	MDELAY(2);

	//VDD power off ->VGP3_PMU 1.8V
	hwPowerOn(MT6323_POWER_LDO_VGP3 , VOL_1800 ,"LCM");
	MDELAY(20);
	
#endif	 
}
コード例 #25
0
ファイル: dummy_cam_cal.c プロジェクト: Lesozav25/mtk_6572
//#define
//Main jobs:
// 1.check for device-specified errors, device not ready.
// 2.Initialize the device if it is opened for the first time.
static int CAM_CAL_Open(struct inode * a_pstInode, struct file * a_pstFile)
{
    CAM_CALDB("[S24CAM_CAL] CAM_CAL_Open\n");
    spin_lock(&g_CAM_CALLock);
    if(g_u4Opened)
    {
        spin_unlock(&g_CAM_CALLock);
        return -EBUSY;
    }
    else
    {
        g_u4Opened = 1;
        atomic_set(&g_CAM_CALatomic,0);
    }
    spin_unlock(&g_CAM_CALLock);

#if defined(MT6572)
	// do nothing
#else
    if(TRUE != hwPowerOn(MT65XX_POWER_LDO_VCAMA, VOL_2800, "S24CS64A"))
    {
        CAM_CALDB("[CAM_CAL] Fail to enable analog gain\n");
        return -EIO;
    }
#endif	

    return 0;
}
コード例 #26
0
static void lcm_init(void)
{
    unsigned int data_array[16];
#ifdef BUILD_LK
    upmu_set_rg_vgp6_vosel(6);
    upmu_set_rg_vgp6_en(1);
#else
    hwPowerOn(MT65XX_POWER_LDO_VGP6, VOL_3000, "LCM");
#endif
    mt_set_gpio_mode(GPIO_LCD_RST_EN, GPIO_MODE_00);
    mt_set_gpio_dir(GPIO_LCD_RST_EN, GPIO_DIR_OUT);
    mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
    MDELAY(1);
    mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ZERO);
    MDELAY(5);
    mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
    MDELAY(80);

    init_lcm_registers();
#ifdef BUILD_LK
    printf("=====>lcm init for test\n");
#else
    printk("=====>lcm init for test\n");
#endif
    //push_table(lcm_initialization_setting, sizeof(lcm_initialization_setting) / sizeof(struct LCM_setting_table), 1);

}
コード例 #27
0
int hdmi_drv_power_on(void)
{
    int ret = 0;
	HDMI_FUNC();
	mt65xx_eint_mask(CUST_EINT_MHL_NUM);

#if 1
	SiiMhlTxHwGpioResume();
	//pmic_config_interface(0x87,0x1,0x01,0x0);
/* Vanzo:lubaoquan on: Tue, 21 May 2013 22:35:29 +0800
 * TODO: replace this line with your comment
 */
	hwPowerOn(MT65XX_POWER_LDO_VGP5, VOL_1200, "HDMI");
// End of Vanzo: lubaoquan
#endif

	//msleep(100);
    SiiMhlTxHwReset(5,5);

	//xuecheng
	HalInstallCheckDeviceCB(SiiCheckDevice);
    HalAcquireIsrLock();
    siHdmiTx_VideoSel(HDMI_720P60);
    siHdmiTx_AudioSel(I2S_44);
    ret = SiiMhlTxInitialize(EVENT_POLL_INTERVAL_MS);
    HalReleaseIsrLock();
	mt65xx_eint_unmask(CUST_EINT_MHL_NUM);
    return ret;
}
コード例 #28
0
INT32 mtk_wcn_consys_hw_vcn28_ctrl(UINT32 enable)
{
	if (enable) {
		/*in co-clock mode,need to turn on vcn28 when fm on */
#if CONSYS_PMIC_CTRL_ENABLE
#if defined(CONFIG_MTK_PMIC_LEGACY)
		hwPowerOn(MT6328_POWER_LDO_VCN28, VOL_2800, "wcn_drv");
#else
		if (reg_VCN28) {
			regulator_set_voltage(reg_VCN28, VOL_2800, VOL_2800);
			if (regulator_enable(reg_VCN28))
				WMT_PLAT_ERR_FUNC("WMT do VCN28 PMIC on fail!\n");
		}
#endif
#endif
		WMT_PLAT_INFO_FUNC("turn on vcn28 for fm/gps usage in co-clock mode\n");
	} else {
		/*in co-clock mode,need to turn off vcn28 when fm off */
#if CONSYS_PMIC_CTRL_ENABLE
#if defined(CONFIG_MTK_PMIC_LEGACY)
		hwPowerDown(MT6328_POWER_LDO_VCN28, "wcn_drv");
#else
		if (reg_VCN28)
			regulator_disable(reg_VCN28);
#endif
#endif
		WMT_PLAT_INFO_FUNC("turn off vcn28 for fm/gps usage in co-clock mode\n");
	}
	return 0;
}
コード例 #29
0
ファイル: lg4591_lg_dsi.c プロジェクト: Lesozav25/ZOPO-TSN
static void lcm_init(void)
{
#ifdef BUILD_LK
        upmu_set_rg_vgp6_vosel(6);
        upmu_set_rg_vgp6_en(1);
#else
    hwPowerOn(MT65XX_POWER_LDO_VGP6, VOL_3000, "LCM");
#endif

    mt_set_gpio_mode(GPIO74, GPIO_MODE_00);
    mt_set_gpio_dir(GPIO74, GPIO_DIR_OUT);
    mt_set_gpio_out(GPIO74, GPIO_OUT_ZERO);

    mt_set_gpio_mode(GPIO_LCD_RST_EN, GPIO_MODE_00);
    mt_set_gpio_dir(GPIO_LCD_RST_EN, GPIO_DIR_OUT);
    mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
    MDELAY(10);
    mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ZERO);
    MDELAY(10);
    mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
    MDELAY(120);

	init_lcm_registers();

	//push_table(lcm_initialization_setting, sizeof(lcm_initialization_setting) / sizeof(struct LCM_setting_table), 1);
}
static unsigned int lcm_compare_id(void)
{
    unsigned int id = 0;

#ifdef BUILD_LK
		pmic_config_interface(0x0532,5,0x7,5);//add by libo for VGP2 POWER ON
		pmic_config_interface(0x050C,1,0x1,15);
#else
		hwPowerOn(MT6323_POWER_LDO_VGP2,VOL_2800,"LCM");
#endif
		MDELAY(100);


    SET_RESET_PIN(1);
    MDELAY(20);
    SET_RESET_PIN(0);
    MDELAY(20);
    SET_RESET_PIN(1);
    MDELAY(100);

		send_ctrl_cmd(0xA100);
		read_data_cmd();
		read_data_cmd();
		read_data_cmd();
		id = read_data_cmd();
		id = (id<<8) | read_data_cmd();
    Lcd_Log("mycat READ OTM8009 LCD ID2%s, id = 0x%x\n", __func__, id);

    return (LCM_ID == id)?1:0;

}