请问如何关闭pmic mt6323的充电?
将检测充电器的代码去掉不就行了?
去掉了 还是不行哦
不可能,都没检测到,怎么执行代码?
我在battery_common.c 文件中把 kal_bool upmu_is_chr_det(void)
{
#if 0
printk("swordking in %s @%d\n",__func__,__LINE__);
#if defined(CONFIG_POWER_EXT)
//return KAL_TRUE;
printk("swordking in %s @%d\n",__func__,__LINE__);
return get_charger_detect_status();
#else
kal_uint32 tmp32;
printk("swordking in %s @%d\n",__func__,__LINE__);
tmp32=get_charger_detect_status();
if(tmp32 == 0)
{
printk("swordking in %s @%d\n",__func__,__LINE__);
return KAL_FALSE;
}
else
{
if( mt_usb_is_device() )
{
printk("swordking in %s @%d\n",__func__,__LINE__);
battery_xlog_printk(BAT_LOG_FULL, "[upmu_is_chr_det] Charger exist and USB is not host\n");
return KAL_TRUE;
}
else
{
printk("swordking in %s @%d\n",__func__,__LINE__);
battery_xlog_printk(BAT_LOG_FULL, "[upmu_is_chr_det] Charger exist but USB is host\n");
return KAL_FALSE;
}
}
这个函数直接返回false了 ,这个函数
void do_chrdet_int_task(void)
{
printk("swordking in %s @%d\n",__func__,__LINE__);
#if 0
if(g_bat_init_flag == KAL_TRUE)
{
if( upmu_is_chr_det() == KAL_TRUE )
{
battery_xlog_printk(BAT_LOG_CRTI, "[do_chrdet_int_task] charger exist!\n");
BMT_status.charger_exist = KAL_TRUE;
wake_lock(&battery_suspend_lock);
#if defined(CONFIG_POWER_EXT)
mt_usb_connect();
battery_xlog_printk(BAT_LOG_CRTI, "[do_chrdet_int_task] call mt_usb_connect() in EVB\n");
#endif
}
else
{
battery_xlog_printk(BAT_LOG_CRTI, "[do_chrdet_int_task] charger NOT exist!\n");
BMT_status.charger_exist = KAL_FALSE;
#ifdef MTK_KERNEL_POWER_OFF_CHARGING
if(g_platform_boot_mode == KERNEL_POWER_OFF_CHARGING_BOOT || g_platform_boot_mode == LOW_POWER_OFF_CHARGING_BOOT)
{
battery_xlog_printk(BAT_LOG_CRTI, "[pmic_thread_kthread] Unplug Charger/USB In Kernel Power Off Charging Mode! Shutdown OS!\r\n");
mt_power_off();
}
#endif
wake_unlock(&battery_suspend_lock);
#if defined(CONFIG_POWER_EXT)
mt_usb_disconnect();
battery_xlog_printk(BAT_LOG_CRTI, "[do_chrdet_int_task] call mt_usb_disconnect() in EVB\n");
#endif
}
//Place charger detection and battery update here is used to speed up charging icon display.
mt_battery_charger_detect_check();
if (BMT_status.UI_SOC == 100 && BMT_status.charger_exist == KAL_TRUE)
{
BMT_status.bat_charging_state = CHR_BATFULL;
BMT_status.bat_full = KAL_TRUE;
g_charging_full_reset_bat_meter = KAL_TRUE;
}
if (BMT_status.bat_vol > 0)
{
mt_battery_update_status();
}
wake_up_bat();
}
else
{
battery_xlog_printk(BAT_LOG_CRTI, "[do_chrdet_int_task] battery thread not ready, will do after bettery init.\n");
}
#endif
}
空实现了,还有 charging_hw_pmic.c switch_charging.c 以及linear_charging.c中的充电使能和打开充电都屏蔽了,这时充电时充电图标没了,但是充电电流还是有500mA左右!是不是我改错地方了?麻烦将工指点!
#endif
#endif
return KAL_FALSE;
}
打LOG看,看哪里是打开充电功能的,将对应的关掉就行了。
好的 感谢
请问下充电屏蔽哪个地方可以说下嘛 我也遇到这个问题了
