按power键亮屏速度慢问题
原因及解决方法:
各驱动的resume函数里面的延时,还有充电驱动里面的线程的延时需要重新查看,和原始的代码进行比较;除了一些必要的延时,其他的延时都要去掉,还有一些经常打的log也要去掉,加快按power键亮屏的速度。
如下代码:
alps\mediatek\custom\common\kernel\lcm\hx8379c_dsi_vdo\hx8379c_dsi_vdo.c
staticstructLCM_setting_tablelcm_sleep_out_setting[] = {
// Sleep Out
{0x11, 0, {0x00}},
{REGFLAG_DELAY, 120, {}}, //150
// Display ON
{0x29, 0, {0x00}},
{REGFLAG_DELAY, 10, {}},
{REGFLAG_END_OF_TABLE, 0x00, {}}
};
alps\mediatek\platform\mt6752\kernel\drivers\power\pmic_chr_type_det.c
static void hw_bc11_init(void)
{
/*[eton begin]:Modify by jorgenat 2014-11-11
*[reason]:经测试,在此无需延时300ms,也会造成唤醒速度变慢。
*/
//msleep(300);
/*[eton end]*/
Charger_Detect_Init();
//RG_bc11_BIAS_EN=1
mt6325_upmu_set_rg_bc11_bias_en(0x1);
//RG_bc11_VSRC_EN[1:0]=00
mt6325_upmu_set_rg_bc11_vsrc_en(0x0);
//RG_bc11_VREF_VTH = [1:0]=00
mt6325_upmu_set_rg_bc11_vref_vth(0x0);
……
}
alps\mediatek\custom\common\kernel\touchpanel\ft6336_p2\ft6336_ts.c
static int tpd_resume(structi2c_client *client)
{
intretval = TPD_OK;
char data;
TPD_DEBUG("TPD wake up\n");
#ifdef FTS_GESTURE
chargesture_close= 0;
TPD_DMESG("tpd_resumegesture_switch= %d \r\n", gesture_switch);
printk("tpd_resume()/11\n");
if (gesture_switch== 1)
{
gesture_switch= 0;
printk("%s,setgesture_switchto 0, =%d\n",__func__, gesture_switch);
i2c_smbus_write_i2c_block_data(i2c_client,0xd0, 1, &gesture_close);
printk("tpd_resume()/22\n");
}
#endif
#ifdefTPD_CLOSE_POWER_IN_SLEEP
hwPowerOn(TPD_POWER_SOURCE,VOL_3300,"TP");
#else
#ifdef MT6573
mt_set_gpio_mode(GPIO_CTP_EN_PIN,GPIO_CTP_EN_PIN_M_GPIO);
mt_set_gpio_dir(GPIO_CTP_EN_PIN,GPIO_DIR_OUT);
mt_set_gpio_out(GPIO_CTP_EN_PIN,GPIO_OUT_ONE);
#endif
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_ZERO);
//msleep(20);
mdelay(10);
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(310); //是否可以考虑减小?
#endif
mt_eint_unmask(CUST_EINT_TOUCH_PANEL_NUM);
if((i2c_smbus_read_i2c_block_data(i2c_client,0x00, 1, &data))< 0)
{
TPD_DMESG("resumeI2C transfer error, line: %d\n", __LINE__);
}
tpd_up(0,0,0);
input_sync(tpd->dev);
printk("tpd_resume()/33\n");
TPD_DMESG("TPDwake up done\n");
gesture_switch =0;
printk("%s,setgesture_switchto 1, =%d\n",__func__, gesture_switch);
returnretval;
}
8. sdcard热插拔导致系统重启问题
原因分析:
Sdcard的中断脚接上了3.3V的电压,原本是1.8V的IO口,导致了中断脚电源域电压偏高不稳定,导致不可预知的问题,比如GPU传输失败等;
解决方法:
去掉Sdcard的中断脚连接的电阻,从硬件上断开,如果只是修改codegen.dws文件还是会存在死机重启问题。
9. 80%电量拔电池重开机电量显示不足问题
问题原因及解决方法:
当待机电流很大,比如200mA时,需要在系统唤醒的时battery的resume函数里去重新检测电量,然后用这个电量再进行电量计算,代码如蓝色部分:
重新计算电量,才不会导致80%电量200mA待机电流8小时以上,然后拔电池重新开机电量确实3%的低电的情况。
g_spm_timer = NORMAL_WAKEUP_PERIOD; // 90 min
alps\mediatek\kernel\drivers\power\battery_meter_p2.c
staticintbattery_meter_resume(structplatform_device *dev)
{
#if defined(CONFIG_POWER_EXT)
#elifdefined(SOC_BY_SW_FG) || defined(SOC_BY_HW_FG)
#if defined(SOC_BY_SW_FG)
kal_int32 hw_ocv_after_sleep;
#endif
structtimespecxts, tom,rtc_time_after_sleep;
#ifdef MTK_POWER_EXT_DETECT
if(KAL_TRUE ==bat_is_ext_power())
return 0;
#endif
get_xtime_and_monotonic_and_sleep_offset(&xts,&tom, &rtc_time_after_sleep);
_g_bat_sleep_total_time += rtc_time_after_sleep.tv_sec- g_rtc_time_before_sleep.tv_sec;
battery_xlog_printk(BAT_LOG_CRTI,"[battery_meter_resume] sleep time = %d, g_spm_timer = %d\n",_g_bat_sleep_total_time, g_spm_timer);
#if defined(SOC_BY_HW_FG)
#ifdef MTK_ENABLE_AGING_ALGORITHM
if(bat_is_charger_exist() == KAL_FALSE)
{
battery_aging_check();
}
#endif
#endif
if(_g_bat_sleep_total_time // etonguotao 2014-11-03 // this will keep battery levelno change after sleep long and resume // return 0; } bat_spm_timeout = true; #if defined(SOC_BY_SW_FG) battery_meter_ctrl(BATTERY_METER_CMD_GET_HW_OCV,&hw_ocv_after_sleep); if(_g_bat_sleep_total_time>3600) //1hr { /*[eton begin]: Modify by Jorgen at2014-7-10 [reason]:Fixed the problem that thecapacity will keep a long time at one level */ if(hw_ocv_after_sleep !=g_hw_ocv_before_sleep) { gFG_DOD0 =fgauge_read_d_by_v(hw_ocv_after_sleep); oam_d0 = gFG_DOD0; //etonguotao 2014-11-03 oam_v_ocv_2 =oam_v_ocv_1 = hw_ocv_after_sleep; oam_car_1 =oam_car_1 + (10* (rtc_time_after_sleep.tv_sec -g_rtc_time_before_sleep.tv_sec)/3600);; oam_car_2 =oam_car_1 + (10* (rtc_time_after_sleep.tv_sec -g_rtc_time_before_sleep.tv_sec)/3600);; } else { oam_car_1 =oam_car_1 + (40* (rtc_time_after_sleep.tv_sec -g_rtc_time_before_sleep.tv_sec)/3600); //0.1mAh oam_car_2 =oam_car_2 + (40* (rtc_time_after_sleep.tv_sec -g_rtc_time_before_sleep.tv_sec)/3600); //0.1mAh } //etonguotao 2014-11-03 //if suspend current verylarge, it need reset FG meter data, //and calculate batteryvoltage level in resume func. if(upmu_is_chr_det() ==KAL_FALSE ) { g_bat_cap_after_sleep= fgauge_read_capacity_by_v(hw_ocv_after_sleep); BMT_status.SOC =BMT_status.UI_SOC = g_bat_cap_after_sleep; battery_meter_reset(); } /*[eton end]*/ } else { oam_car_1 = oam_car_1 +(20* (rtc_time_after_sleep.tv_sec - g_rtc_time_before_sleep.tv_sec)/3600);//0.1mAh oam_car_2 = oam_car_2 +(20* (rtc_time_after_sleep.tv_sec - g_rtc_time_before_sleep.tv_sec)/3600);//0.1mAh } bm_print(BM_LOG_CRTI,"sleeptime=(%d)s, be_ocv=(%d), af_ocv=(%d), D0=(%d), car1=(%d), car2=(%d)\n", rtc_time_after_sleep.tv_sec- g_rtc_time_before_sleep.tv_sec, g_hw_ocv_before_sleep, hw_ocv_after_sleep,gFG_DOD0, oam_car_1, oam_car_2); #endif #endif bm_print(BM_LOG_CRTI, "[battery_meter_resume].--eton--oam_v_ocv_2=%d, oam_v_ocv_1=%d, oam_car_1=%d, oam_car_2=%d\n", oam_v_ocv_2,oam_v_ocv_1, oam_car_1, oam_car_2); return 0; } 10. 开关机充电曲线差异较大问题 原因及解决方法: 1)、P2采用的是脉冲充电的方式,充9秒钟,然后停1秒钟的形式,d5_count_time决定充电的每一步的时间,稍微增加d5_count_time值,可以使充电曲线变得平滑,但是不能加得过大,否则会导致电压上升太高,而显示示数确很低; Void oam_run(void) { … if(gFG_Is_Charging == KAL_FALSE) { d5_count_time = 80; //eton update by jorgen at 2014-7-10 d5_count_soc_99 = 0; } /*[eton end]*/ else { charging_current = get_charging_setting_current(); charging_current = charging_current / 100; // charging_current -= 150; //BMT_status.ICharging; d5_count_time_rate =(((gFG_BATT_CAPACITY_aging*60*60/100/(charging_current-50))*10)+5)/10; if(d5_count_time_rate < 1) d5_count_time_rate =1; //调节d5_count_time的值,可以调节充电的每一步的时间, //如果d5_count_time = 80,那么充电的每一步的检测时间是:80秒 //如果80秒之后,电压达到了预定的电池曲线的电压值,电量就会加1 d5_count_time =d5_count_time_rate; } … }