.io_init = rk29_backlight_io_init,
.io_deinit = rk29_backlight_io_deinit,
.min_brightness = 48,
+ .delay_ms = 0,
.pwm_suspend = rk29_backlight_pwm_suspend,
.pwm_resume = rk29_backlight_pwm_resume,
};
{
int ret = 0;
+ if(LCD_STB_PIN !=INVALID_GPIO)
+ {
+ ret = gpio_request(LCD_STB_PIN, NULL);
+ if (ret != 0)
+ {
+ gpio_free(LCD_STB_PIN);
+ printk(KERN_ERR "request lcd en pin fail!\n");
+ return -1;
+ }
+ else
+ {
+ gpio_direction_output(LCD_STB_PIN, LCD_STB_VALUE);
+ }
+ }
+
+ msleep(100);
if(LCD_CS_PIN !=INVALID_GPIO)
{
ret = gpio_request(LCD_CS_PIN, NULL);
}
}
- if(LCD_STB_PIN !=INVALID_GPIO)
- {
- ret = gpio_request(LCD_STB_PIN, NULL);
- if (ret != 0)
- {
- gpio_free(LCD_STB_PIN);
- printk(KERN_ERR "request lcd en pin fail!\n");
- return -1;
- }
- else
- {
- gpio_direction_output(LCD_STB_PIN, LCD_STB_VALUE);
- }
- }
return 0;
}
static int rk_fb_io_disable(void)
{
+ if(LCD_STB_PIN !=INVALID_GPIO)
+ {
+ gpio_set_value(LCD_STB_PIN, !LCD_STB_VALUE);
+ }
+ msleep(50);
if(LCD_CS_PIN !=INVALID_GPIO)
{
gpio_set_value(LCD_CS_PIN, !LCD_CS_VALUE);
{
gpio_set_value(LCD_EN_PIN, !LCD_EN_VALUE);
}
- if(LCD_STB_PIN !=INVALID_GPIO)
- {
- gpio_set_value(LCD_STB_PIN, !LCD_STB_VALUE);
- }
+
return 0;
}
static int rk_fb_io_enable(void)
{
+ if(LCD_STB_PIN !=INVALID_GPIO)
+ {
+ gpio_set_value(LCD_STB_PIN, LCD_STB_VALUE);
+ }
+ msleep(50);
if(LCD_CS_PIN !=INVALID_GPIO)
{
gpio_set_value(LCD_CS_PIN, LCD_CS_VALUE);
{
gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
}
- if(LCD_STB_PIN !=INVALID_GPIO)
- {
- gpio_set_value(LCD_STB_PIN, LCD_STB_VALUE);
- }
return 0;
}
static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = {
.dc_det_pin = RK30_PIN0_PB2,
.batt_low_pin = RK30_PIN0_PB1,
- .charge_set_pin = INVALID_GPIO,
+ .charge_set_pin = RK30_PIN2_PA7,
.charge_ok_pin = RK30_PIN0_PA6,
.dc_det_level = GPIO_LOW,
.charge_ok_level = GPIO_HIGH,
+ .charge_set_level = GPIO_HIGH,
};
static struct platform_device rk30_device_adc_battery = {
};
#endif
-#define PMIC_TYPE_WM8326 1
-#define PMIC_TYPE_TPS65910 2
int __sramdata g_pmic_type = 0;
#ifdef CONFIG_I2C1_RK30
#ifdef CONFIG_MFD_WM831X_I2C
void __sramfunc board_pmu_suspend(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_suspend();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_suspend();
#endif
}
void __sramfunc board_pmu_resume(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_resume();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_resume();
#endif
}
}
//end of i2c
+#define POWEROFF_CHARGING_ANIMATION (1)
#define POWER_ON_PIN RK30_PIN0_PA0 //power_hold
static void rk30_pm_power_off(void)
{
- printk(KERN_ERR "rk30_pm_power_off start...\n");
+#if POWEROFF_CHARGING_ANIMATION
+ int pwr_cnt = 0;
+ struct rk30_adc_battery_platform_data *batt_plat_data = &rk30_adc_battery_platdata;
+ if (gpio_get_value (batt_plat_data->dc_det_pin) ==
+ batt_plat_data->dc_det_level) {
+ printk("AC Charging, try to restart...\n");
+ while (1) {
+ if (gpio_get_value (batt_plat_data->dc_det_pin) !=
+ batt_plat_data->dc_det_level ) {
+ pwr_cnt = 0;
+ break;
+ }
+ if (pwr_cnt++ > 40)
+ break;
+ mdelay(50);
+ }
+ if (pwr_cnt > 40) {
+ printk("AC Charging, will restart system...\n");
+ arm_pm_restart(0, NULL);
+ }
+ }
+#endif
+
+ printk("rk30_pm_power_off start...\n");
gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
#if defined(CONFIG_MFD_WM831X)
wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000); //set sys_pwr 0
*/
static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
#if 0
- {.frequency = 252 * 1000, .cpu_volt = 1075 * 1000, .logic_volt = 1125 * 1000},//0.975V/1.000V
+ {.frequency = 252 * 1000, .cpu_volt = 1075 * 1000, .logic_volt = 1125 * 1000},
#endif
- {.frequency = 504 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1100 * 1000},//0.975V/1.000V
- {.frequency = 816 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1100 * 1000},//1.000V/1.025V
- {.frequency = 1200 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1100 * 1000},//1.100V/1.050V
+ {.frequency = 504 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1100 * 1000},
+ {.frequency = 816 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1100 * 1000},
+ {.frequency = 1200 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1100 * 1000},
#if 0
- {.frequency = 1008 * 1000, .cpu_volt = 1125 * 1000, .logic_volt = 1150 * 1000},//1.025V/1.050V
- {.frequency = 1272 * 1000, .cpu_volt = 1225 * 1000, .logic_volt = 1200 * 1000},//1.150V/1.100V
- {.frequency = 1416 * 1000, .cpu_volt = 1300 * 1000, .logic_volt = 1200 * 1000},//1.225V/1.100V
- {.frequency = 1512 * 1000, .cpu_volt = 1350 * 1000, .logic_volt = 1250 * 1000},//1.300V/1.150V
- {.frequency = 1608 * 1000, .cpu_volt = 1425 * 1000, .logic_volt = 1300 * 1000},//1.325V/1.175V
+ {.frequency = 1008 * 1000, .cpu_volt = 1125 * 1000, .logic_volt = 1150 * 1000},
+ {.frequency = 1272 * 1000, .cpu_volt = 1225 * 1000, .logic_volt = 1200 * 1000},
+ {.frequency = 1416 * 1000, .cpu_volt = 1300 * 1000, .logic_volt = 1200 * 1000},
+ {.frequency = 1512 * 1000, .cpu_volt = 1350 * 1000, .logic_volt = 1250 * 1000},
+ {.frequency = 1608 * 1000, .cpu_volt = 1425 * 1000, .logic_volt = 1300 * 1000},
#endif
{.frequency = CPUFREQ_TABLE_END},
};
static struct cpufreq_frequency_table dvfs_gpu_table[] = {
{.frequency = 266 * 1000, .index = 1000 * 1000},
{.frequency = 400 * 1000, .index = 1000 * 1000},
+ {.frequency = 600 * 1000, .index = 1200 * 1000},
{.frequency = CPUFREQ_TABLE_END},
};