/* VGP2 3.0v LDO enable */ static void ldo_3v0_on(void) { #ifdef BUILD_UBOOT #error "not implemeted" #elif defined(BUILD_LK) upmu_set_rg_vgp1_vosel(6); /* VGP2_SEL= 101 : 2.8V , 110 : 3.0V */ upmu_set_rg_vgp1_en(1); #else upmu_set_rg_vgp1_vosel(6); // VGP2_SEL= 101 : 2.8V , 110 : 3.0V upmu_set_rg_vgp1_en(1); //hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_3000, "3V0_TOUCH_VDD"); #endif }
static void lcm_init(void) { #ifdef BUILD_LK printf("[LK/LCM] lcm_init() enter \n"); lcm_set_gpio_output(GPIO_LCM_RST, 0); MDELAY(20); lcm_set_gpio_output(GPIO_LCM_RST, 1); MDELAY(50); //VDD power on ->VGP1_PMU 2.0V upmu_set_rg_vgp1_vosel(0x4); upmu_set_rg_vgp1_en(0x1); MDELAY(20); //AVDD power on lcm_set_gpio_output(GPIO_LCM_PWR_EN, 1); MDELAY(20); #elif (defined BUILD_UBOOT) #else printk("[Kernel/LCM] lcm_init() enter \n"); #endif }
/* 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 }
/* 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 }
/* 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 }
void lvds_power_init(void) { upmu_set_rg_vgp1_vosel(7);//7=3.3v upmu_set_rg_vgp1_en(1);// //upmu_set_rg_vgp6_vosel(7);//7=3.3v //upmu_set_rg_vgp6_en(1);// }
static void lcd_power_en(unsigned char enabled) { if (enabled) { #ifdef BUILD_LK /* VGP2_PMU 3V */ /* pmic_config_interface(DIGLDO_CON29, 0x6, PMIC_RG_VGP2_VOSEL_MASK, PMIC_RG_VGP2_VOSEL_SHIFT); pmic_config_interface(DIGLDO_CON8, 0x1, PMIC_RG_VGP2_EN_MASK, PMIC_RG_VGP2_EN_SHIFT); */ upmu_set_rg_vgp1_vosel(0x3); upmu_set_rg_vgp1_en(0x1); #else /* upmu_set_rg_vgp2_vosel(0x6); upmu_set_rg_vgp2_en(0x1); */ upmu_set_rg_vgp1_vosel(0x3); upmu_set_rg_vgp1_en(0x1); #endif mt_set_gpio_out(GPIO_LCM_PWR, GPIO_OUT_ONE); } else { #ifdef BUILD_LK /* VGP2_PMU 3V */ /* pmic_config_interface(DIGLDO_CON8, 0x0, PMIC_RG_VGP2_EN_MASK, PMIC_RG_VGP2_EN_SHIFT); pmic_config_interface(DIGLDO_CON29, 0x0, PMIC_RG_VGP2_VOSEL_MASK, PMIC_RG_VGP2_VOSEL_SHIFT); */ upmu_set_rg_vgp1_en(0); upmu_set_rg_vgp1_vosel(0); #else //upmu_set_rg_vgp2_en(0x0); //upmu_set_rg_vgp2_vosel(0x0); upmu_set_rg_vgp1_en(0); upmu_set_rg_vgp1_vosel(0); #endif mt_set_gpio_out(GPIO_LCM_PWR, GPIO_OUT_ZERO); } }
static void lcm_init_power(void) { #ifdef BUILD_LK printf("[LK/LCM] lcm_init_power() enter\n"); lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ONE); MDELAY(20); upmu_set_rg_vgp1_vosel(3); upmu_set_rg_vgp1_en(0x1); #else printk("[Kernel/LCM] lcm_init_power() enter\n"); lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ONE); MDELAY(20); #endif }
/* VGP2 3.0v LDO enable */ static void ldo_3v0_on(void) { #if 1 //defined(TARGET_S7) #ifdef BUILD_UBOOT #error "not implemeted" #elif defined(BUILD_LK) upmu_set_rg_vgp1_vosel(6); // VGP2_SEL= 101 : 2.8V , 110 : 3.0V upmu_set_rg_vgp1_en(1); #else hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_3000, "3V0_TOUCH_VDD"); #endif #else mt_set_gpio_mode(GPIO_LCM_PWR, GPIO_LCM_PWR_M_GPIO); mt_set_gpio_pull_enable(GPIO_LCM_PWR, GPIO_PULL_ENABLE); mt_set_gpio_dir(GPIO_LCM_PWR, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_LCM_PWR, GPIO_OUT_ONE); #endif }
static void lcm_resume_power(void) { #ifdef BUILD_LK printf("[LK/LCM] lcm_resume_power() enter\n"); lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ONE); MDELAY(20); upmu_set_rg_vgp1_vosel(3); upmu_set_rg_vgp1_en(0x1); #else printk("[Kernel/LCM] lcm_resume_power() enter\n"); lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ONE); MDELAY(20); hwPowerOn(MT6323_POWER_LDO_VGP1 , VOL_1800 ,"LCM"); MDELAY(20); #endif }
static void lcm_init(void) { upmu_set_rg_vgp1_vosel(3); // set 1.8v for VGP1 upmu_set_rg_vgp1_en(1); // VGP1 power ON MDELAY(1); upmu_set_rg_vcam_af_vosel(5); // set 2.8V for VCAM_AF upmu_set_rg_vcam_af_en(1); // VCAM_AF power ON MDELAY(1); SET_RESET_PIN(1); MDELAY(1); SET_RESET_PIN(0); MDELAY(10); SET_RESET_PIN(1); MDELAY(120); init_lcm_registers(); LCM_PRINT("[LCD] lcm_init \n"); }
static void lcm_resume(void) { #ifdef BUILD_LK printf("[LK/LCM] lcm_resume() enter \n"); lcm_set_gpio_output(GPIO_LCM_RST, 0); MDELAY(20); lcm_set_gpio_output(GPIO_LCM_RST, 1); MDELAY(20); //VGP1_PMU 2.0V upmu_set_rg_vgp1_vosel(0x4); upmu_set_rg_vgp1_en(0x1); MDELAY(20); lcm_set_gpio_output(GPIO_LCM_PWR_EN, 1); MDELAY(20); #elif (defined BUILD_UBOOT) #else printk("[Kernel/LCM] lcm_resume() enter \n"); lcm_set_gpio_output(GPIO_LCM_RST, 0); MDELAY(20); lcm_set_gpio_output(GPIO_LCM_RST, 1); MDELAY(20); hwPowerOn(MT6323_POWER_LDO_VGP1 , VOL_2000 ,"LCM"); MDELAY(20); lcm_set_gpio_output(GPIO_LCM_PWR_EN, 1); MDELAY(20); #endif }
static void lcm_suspend_power(void) { #ifdef BUILD_LK printf("[LK/LCM] lcm_suspend_power() enter\n"); lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ZERO); MDELAY(20); upmu_set_rg_vgp1_vosel(0); upmu_set_rg_vgp1_en(0); #else printk("[Kernel/LCM] lcm_suspend_power() enter\n"); lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ZERO); MDELAY(20); hwPowerDown(MT6323_POWER_LDO_VGP1 ,"LCM"); MDELAY(20); #endif }
static void lcm_suspend(void) { #ifdef BUILD_LK printf("[LK/LCM] lcm_suspend() enter\n"); lcm_set_gpio_output(GPIO_LCM_RST, 0); MDELAY(300); //AVDD power off lcm_set_gpio_output(GPIO_LCM_PWR_EN, 0); MDELAY(2); //VDD power off ->VGP1_PMU 2.0V upmu_set_rg_vgp1_vosel(0); upmu_set_rg_vgp1_en(0); MDELAY(20); #elif (defined BUILD_UBOOT) #else printk("[LCM] lcm_suspend() enter\n"); lcm_set_gpio_output(GPIO_LCM_RST, 0); MDELAY(300); //AVDD power off lcm_set_gpio_output(GPIO_LCM_PWR_EN, 0); MDELAY(2); if(fgisFirst == TRUE) { fgisFirst = FALSE; hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_2000, "LCM"); } //VDD power off ->VGP1_PMU 2.0V hwPowerDown(MT6323_POWER_LDO_VGP1, "LCM"); MDELAY(20); #endif }
/* VGP2 3.0v LDO enable */ static void ldo_3v0_on(void) { #ifdef BUILD_UBOOT #error "not implemeted" #elif defined(BUILD_LK) if ( g_PCBver==HW_REV_B ) { upmu_set_rg_vgp2_vosel(6); // VGP2_SEL= 101 : 2.8V , 110 : 3.0V upmu_set_rg_vgp2_en(1); } else if ( g_PCBver==HW_REV_A_2 ) { upmu_set_rg_vgp2_vosel(6); // VGP2_SEL= 101 : 2.8V , 110 : 3.0V upmu_set_rg_vgp2_en(1); } else //( g_PCBver==HW_REV_A ) { upmu_set_rg_vgp1_vosel(6); // VGP2_SEL= 101 : 2.8V , 110 : 3.0V upmu_set_rg_vgp1_en(1); } #else if ( g_PCBver==HW_REV_B ) { hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_3000, "3V0_MTK_LCD_VCC"); } else if ( g_PCBver==HW_REV_A_2 ) { hwPowerOn(MT6323_POWER_LDO_VGP2, VOL_3000, "3V0_LCD_VCC_MTK_S"); } else //( g_PCBver==HW_REV_A ) { hwPowerOn(MT6323_POWER_LDO_VGP1, VOL_3000, "3V0_TOUCH_VDD"); } #endif }