配置电池profile问题总结

配置电池profile问题总结

1.ID不匹配问题
机器启动后执行指令adb shell "cat sys/class/power_supply/bms/uevent | grep POWER_SUPPLY_BATTERY_TYPE"返回如下结果:
POWER_SUPPLY_BATTERY_TYPE = Missing Battery
此结果说明设备没有成功匹配上,此时需要对代码追加log进行分析。
找到调用of_batterydata_get_best_profile的位置(文件qpnp-fg-gen3.c下)fg_get_batt_profile函数中,添加log
pr_err(“batt_id_ohms = %d\n”, chip->batt_id_ohms);

可得知chip->batt_id_ohms为9000,
则可修改配置qcom,batt-id-kohm = <9>;
重新编译dtboimage,刷机后执行adb shell "cat sys/class/power_supply/bms/uevent | grep POWER_SUPPLY_BATTERY_TYPE"结果如下

此时已正常匹配
2.jeita参数异常
profile匹配成功后,cat /d/pmic-votable/FCC/status查看jeita投票机制,发现数据为-22000。

查看dtsi配置后,发现缺失jeita配置
qcom,jeita-fcc-ranges = <0 100 500000
100 450 1000000>
qcom,jeita-fv-ranges = <0 100 4150000
100 450 4150000>;
添加了如上配置后,发现数据依然为-22000。
查看代码逻辑,函数get_step_chg_jeita_setting_from_profile中定义了逻辑,只有在识别到节点”qcom,battery-data”、“qcom,battery-type”、“qcom,max-voltage-uv”、"qcom,fastchg-current-ma"后才能进行识别jeita参数,否则直接return rc.

对比后发现,缺失"qcom,fastchg-current-ma"信息,进行适配qcom,fastchg-current-ma = <1000>;后。
cat /d/pmic-votable/FCC/status输出正常

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值