static void lcd_power_en(unsigned char enabled)
{
    if(enabled)
    {      
      #ifdef BUILD_LK
        //VGP6 3.3V
        pmic_config_interface(DIGLDO_CON33, 0x07, PMIC_RG_VGP6_VOSEL_MASK, PMIC_RG_VGP6_VOSEL_SHIFT);  
        pmic_config_interface(DIGLDO_CON12, 0x1, PMIC_RG_VGP6_EN_MASK, PMIC_RG_VGP6_EN_SHIFT); 
      #else
        upmu_set_rg_vgp6_en(0x1);
	      upmu_set_rg_vgp6_vosel(0x7);
      #endif
      MDELAY(20);
    
      mt_set_gpio_mode(GPIO_LCD_BL_EN, GPIO_MODE_00);
      mt_set_gpio_dir(GPIO_LCD_BL_EN, GPIO_DIR_OUT);
      mt_set_gpio_out(GPIO_LCD_BL_EN, GPIO_OUT_ONE);   
    }
    else
    {
      mt_set_gpio_mode(GPIO_LCD_BL_EN, GPIO_MODE_00);
      mt_set_gpio_dir(GPIO_LCD_BL_EN, GPIO_DIR_OUT);
      mt_set_gpio_out(GPIO_LCD_BL_EN, GPIO_OUT_ZERO);
      MDELAY(20);            
      #ifdef BUILD_LK
        //VGP6 3.3V
        pmic_config_interface(DIGLDO_CON12, 0x0, PMIC_RG_VGP6_EN_MASK, PMIC_RG_VGP6_EN_SHIFT); 
        pmic_config_interface(DIGLDO_CON33, 0x0, PMIC_RG_VGP6_VOSEL_MASK, PMIC_RG_VGP6_VOSEL_SHIFT);   
      #else
        upmu_set_rg_vgp6_en(0x0);
	      upmu_set_rg_vgp6_vosel(0x0);
      #endif     	
    }
}
예제 #2
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);
}
예제 #3
0
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
MDELAY(120);

#if 0
	SET_RESET_PIN(1);
	MDELAY(1);
	SET_RESET_PIN(0);
	MDELAY(10);
	SET_RESET_PIN(1);
	MDELAY(10);
#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(10);
	mt_set_gpio_out(GPIO_LCD_RST_EN, GPIO_OUT_ONE);
	MDELAY(120);
#endif
	init_lcm_registers();
}
예제 #4
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);

}
예제 #5
0
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);
}
예제 #6
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);
}
예제 #7
0
static unsigned int lcm_compare_id()
{
	unsigned int id = 0;
	unsigned char buffer[6], buffer1[2];
	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

	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);

	array[0]=0x00023902;
	array[1]=0x00000000;
	dsi_set_cmdq(array, 2, 1);
	array[0]=0x00043902;
	array[1]=0x010980ff;
	dsi_set_cmdq(array, 2, 1);
	array[0]=0x00023902;
	array[1]=0x00008000;
	dsi_set_cmdq(array, 2, 1);
	array[0]=0x00033902;
	array[1]=0x000980ff;
	dsi_set_cmdq(array, 2, 1);

	array[0] = 0x00053700;// set return byte number
	dsi_set_cmdq(array, 1, 1);

	read_reg_v2(0xA1, &buffer, 5);
	array[0] = 0x00013700;// set return byte number
	dsi_set_cmdq(array, 1, 1);
	array[0]=0x00023902;
	array[1]=0x00005000;
	dsi_set_cmdq(array, 2, 1);
	MDELAY(1);
	read_reg_v2(0xF8, &buffer1, 1);
	id = (buffer[2] << 16) | (buffer[3] << 8) | buffer1[0];
#if defined(BUILD_LK)
	printf
	    ("%s, buffer[0]=0x%x,buffer[1]=0x%x,buffer[2]=0x%x,buffer[3]=0x%x buffer[4]=0x%x buffer1[0]=0x%x id = 0x%x\n",
	     __func__, buffer[0], buffer[1], buffer[2], buffer[3],
	     buffer[4], buffer1[0], id);
#endif
	return (LCM_OTM8009A_HSD45_JQ_ID == id) ? 1 : 0;
}
예제 #8
0
static void lcm_suspend(void)
{
	push_table(lcm_deep_sleep_mode_in_setting,
		   sizeof(lcm_deep_sleep_mode_in_setting) /
		   sizeof(struct LCM_setting_table), 1);
//	SET_RESET_PIN(0);
#ifdef BUILD_LK
	upmu_set_rg_vgp6_en(0);
#else
	hwPowerDown(MT65XX_POWER_LDO_VGP6, "LCM");
#endif
}
예제 #9
0
static void lcm_suspend(void)
{
	unsigned int data_array[16];

	nt35590_DCS_write_1A_0P(0x28);
	MDELAY(100);
	nt35590_DCS_write_1A_0P(0x10);
	MDELAY(100);
#ifdef BUILD_LK
	upmu_set_rg_vgp6_en(0);
#else
	hwPowerDown(MT65XX_POWER_LDO_VGP6, "LCM");
#endif
}
static void lcm_suspend(void)
{
	unsigned int data_array[16];

	data_array[0] = 0x00280500;	// Display Off
	dsi_set_cmdq(&data_array, 1, 1);
	MDELAY(120);

	data_array[0] = 0x00100500;	// Sleep In
	dsi_set_cmdq(&data_array, 1, 1);
	MDELAY(200);
#ifdef BUILD_LK
	upmu_set_rg_vgp6_en(0);
#else
	hwPowerDown(MT65XX_POWER_LDO_VGP6, "LCM");
#endif
}
예제 #11
0
static void lcm_suspend(void)
{
	//push_table(lcm_deep_sleep_mode_in_setting, sizeof(lcm_deep_sleep_mode_in_setting) / sizeof(struct LCM_setting_table), 1);
	unsigned int data_array[16];


	data_array[0]=0x00280500; // Display Off
	dsi_set_cmdq(&data_array, 1, 1);

	data_array[0] = 0x00100500; // Sleep In
	dsi_set_cmdq(&data_array, 1, 1);
#ifdef BUILD_LK
        upmu_set_rg_vgp6_en(0);
#else
        hwPowerDown(MT65XX_POWER_LDO_VGP6, "LCM");
#endif

}
static unsigned int lcm_compare_id(void)
{
	unsigned int id0, id1, id2, id3, id4;
	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);

	// Set Maximum return byte = 1
	array[0] = 0x00053700;
	dsi_set_cmdq(array, 1, 1);

	read_reg_v2(0xA1, buffer, 5);
	id0 = buffer[0];
	id1 = buffer[1];
	id2 = buffer[2];
	id3 = buffer[3];
	id4 = buffer[4];

#if defined(BUILD_LK)
	printf("%s, Module ID = {%x, %x, %x, %x, %x} \n", __func__, id0,
	       id1, id2, id3, id4);
#else
	printk("%s, Module ID = {%x, %x, %x, %x,%x} \n", __func__, id0,
	       id1, id2, id3, id4);
#endif

	return (LCM_OTM1283_ID == ((id2 << 8) | id3)) ? 1 : 0;
}
예제 #13
0
static unsigned int lcm_compare_id(void)
{
    unsigned int id=0;
    unsigned char buffer[2];
    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_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);

    array[0]=0x00043902;//Enable external Command
    array[1]=0x9283FFB9;
    dsi_set_cmdq(&array, 2, 1);


    array[0] = 0x00023700;// return byte number
    dsi_set_cmdq(&array, 1, 1);


    read_reg_v2(0xF4, buffer, 2);
    id = buffer[0];

#ifdef BUILD_LK
    printf("=====>compare id for test %s, id = 0x%08x\n", __func__, id);
#else
    printk("=====>compare id for test %s, id = 0x%08x\n", __func__, id);
#endif

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

}
예제 #14
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(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(150);

	init_lcm_registers();
}
예제 #15
0
static unsigned int lcm_compare_id(void)
{
	unsigned int id = 0;
	unsigned char buffer[2];
	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_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);

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

	read_reg_v2(0xF4, buffer, 2);
	id = buffer[0];		//we only need ID
#ifdef BUILD_LK
	printf("%s, LK nt35590 debug: nt35590 id = 0x%08x\n", __func__,
	       id);
#else
	printk("%s, kernel nt35590 horse debug: nt35590 id = 0x%08x\n",
	       __func__, id);
#endif

	if (id == LCM_ID_NT35590)
		return 1;
	else
		return 0;
}
예제 #16
0
static unsigned int lcm_compare_id(void)
{
		unsigned int id=0;
		unsigned char buffer[8];
		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_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(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);

		array[0] = 0x00083700;// return byte number
		dsi_set_cmdq(&array, 1, 1);
		MDELAY(10);

		read_reg_v2(0xa1, buffer, 8);
		id = buffer[6]<<8 | buffer[7];

#ifdef BUILD_LK
		printf("=====>for test %s, id = 0x%08x\n", __func__, id);
#else
		printk("=====>fot test %s, id = 0x%08x\n", __func__, id);
#endif

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

}
static void lcd_power_en(unsigned char enabled)
{
  if(enabled)
  { 
  #if 0//def BUILD_LK
    //VGP4 1.8V
    pmic_config_interface(DIGLDO_CON10, 0x1, PMIC_RG_VGP4_EN_MASK, PMIC_RG_VGP4_EN_SHIFT);
    pmic_config_interface(DIGLDO_CON31, 0x03, PMIC_RG_VGP4_VOSEL_MASK, PMIC_RG_VGP4_VOSEL_SHIFT);    
	  MDELAY(1);
    //VGP6 3.3V
    pmic_config_interface(DIGLDO_CON12, 0x1, PMIC_RG_VGP6_EN_MASK, PMIC_RG_VGP6_EN_SHIFT);
    pmic_config_interface(DIGLDO_CON33, 0x07, PMIC_RG_VGP6_VOSEL_MASK, PMIC_RG_VGP6_VOSEL_SHIFT);
  #else
    //VGP4 1.8V
    upmu_set_rg_vgp4_en(0x1);
    upmu_set_rg_vgp4_vosel(0x3);     
    MDELAY(1);
    //VGP6 3.3V    
    upmu_set_rg_vgp6_en(0x1);
    upmu_set_rg_vgp6_vosel(0x7);    
  #endif   

/*
    mt_set_gpio_mode(GPIO_LCD_BIST, GPIO_MODE_00); //BIST PIN, always keep low	       
    mt_set_gpio_dir(GPIO_LCD_BIST, GPIO_DIR_OUT);        
    mt_set_gpio_out(GPIO_LCD_BIST, GPIO_OUT_ZERO);

    mt_set_gpio_mode(GPIO_LCD_MIPI_PANEL_EN, GPIO_MODE_00);	//MIPI_PANEL_EN PIN, always keep low	  
    mt_set_gpio_dir(GPIO_LCD_MIPI_PANEL_EN, GPIO_DIR_OUT);		 
    mt_set_gpio_out(GPIO_LCD_MIPI_PANEL_EN, GPIO_OUT_ZERO);
*/
  }
  else
  {
/*
    mt_set_gpio_mode(GPIO_LCD_BIST, GPIO_MODE_00);        //BIST PIN  
    mt_set_gpio_dir(GPIO_LCD_BIST, GPIO_DIR_OUT);        
    mt_set_gpio_out(GPIO_LCD_BIST, GPIO_OUT_ZERO); 

    mt_set_gpio_mode(GPIO_LCD_MIPI_PANEL_EN, GPIO_MODE_00);     //MIPI_PANEL_EN PIN, always keep low   
    mt_set_gpio_dir(GPIO_LCD_MIPI_PANEL_EN, GPIO_DIR_OUT);        
    mt_set_gpio_out(GPIO_LCD_MIPI_PANEL_EN, GPIO_OUT_ZERO);
*/
    #if 0 //def BUILD_LK
    //VGP4 1.8V
    pmic_config_interface(DIGLDO_CON10, 0x0, PMIC_RG_VGP4_EN_MASK, PMIC_RG_VGP4_EN_SHIFT);
    pmic_config_interface(DIGLDO_CON31, 0x0, PMIC_RG_VGP4_VOSEL_MASK, PMIC_RG_VGP4_VOSEL_SHIFT);    

    MDELAY(55);  //delay 55ms   

    //VGP6 3.3V
    pmic_config_interface(DIGLDO_CON12, 0x0, PMIC_RG_VGP6_EN_MASK, PMIC_RG_VGP6_EN_SHIFT);
    pmic_config_interface(DIGLDO_CON33, 0x0, PMIC_RG_VGP6_VOSEL_MASK, PMIC_RG_VGP6_VOSEL_SHIFT);

	#else
    //VGP6 3.3V    
    upmu_set_rg_vgp6_en(0x0);
    upmu_set_rg_vgp6_vosel(0x0);
    MDELAY(55);  //delay 55ms
    //VGP4 1.8V
    upmu_set_rg_vgp4_en(0x0);
    upmu_set_rg_vgp4_vosel(0x0);     
	#endif
  }
}