|
楼主|
发表于 2022-10-22 15:51:55
问题:
如何修改T618 Android11 充电电流?
解决方法:
充电电流的软件配置主要包含两个部分:
1、charger manger的配置,该配置是直接配置充电IC本身;
2、 Jeita 温控策略,需要在不同温度下,限制的最大电流值
文件路径:bsp\kernel\kernel4.14\arch\arm64\boot\dts\sprd\ums512-1h10-overlay.dts
关于charge manger的说明如下:
- charger-manager {
- compatible = "charger-manager";
- cm-name = "battery";
- cm-poll-mode = <2>; //” _cm_monitor” 轮询模式
- cm-poll-interval = <15000>; //” _cm_monitor” 轮询时间间隔
- cm-battery-stat = <2>; //电池在位检测方法,电压法
- cm-fullbatt-vchkdrop-ms = <30000>; //充满电后,检查复充条件的周期
- cm-fullbatt-vchkdrop-volt = <60000>;//满电后复充电压条件
- cm-fullbatt-voltage = <4350000>;//软件满电电压判断阈值,必须配置
- cm-fullbatt-current = <120000>;//软件满电电流判断阈值,必须配置
- cm-fullbatt-capacity = <100>;//电池满电时百分比
- cm-num-chargers = <1>;//charger ic 数量
- cm-chargers = "fan54015_charger";//charger ic 名字
- cm-fuel-gauge = "sc27xx-fgu";//fgu 名字
- /* in deci centigrade */
- cm-battery-cold = <200>; //电池温度 CM_EVENT_BATT_COLD 阈值
- cm-battery-cold-in-minus; // 负温标志
- cm-battery-hot = <800>; //电池温度 CM_EVENT_BATT_OVERHEAT 阈值
- cm-battery-temp-diff = <100>; // 修正异常时COLD 和 OVERHEAT 阈值
- /* Allow charging for 6hr */
- cm-charging-max = <21600000>; //允许连续充电的最长时间
- /* recovery charging after stop charging 45min */
- cm-discharging-max = <2700000>; //停充后,如果插着充电器,允许复充电时间
- /* the interval to feed charger watchdog */
- cm-wdt-interval = <60>; //feed watchdog 周期,同时也是开启feedwatchdog的开关
- /* drop voltage in microVolts to allow shutdown */
- cm-shutdown-voltage = <3100000>; //uvlo 电压阈值
- /* when 99% of the time is exceeded, it will be forced to 100% */
- cm-tickle-time-out = <1500>; //电量维持在99% 15分钟后跳到100%
- /* how much time to allow capacity change */
- cm-one-cap-time = <30>; //允许电量增加1%最快时间
- /* when the safe charging voltage is exceeded, stop charging */
- cm-charge-voltage-max = <6500000>; //充电器过压保护电压阈值
- /* drop voltage in microVolts to restart charging */
- cm-charge-voltage-drop = <700000>;//复充电压条件
- cm-dcp-jeita-temp-table = <1000 1030 0 4400000>, <1150 1180 700000 4400000>,
- <1450 1420 1150000 4400000>, <1600 1570 700000 4100000>;
- cm-sdp-jeita-temp-table = <1000 1030 0 4400000>, <1150 1180 500000 4400000>,
- <1450 1420 500000 4400000>, <1600 1570 500000 4100000>;
- cm-cdp-jeita-temp-table = <1000 1030 0 4400000>, <1150 1180 700000 4400000>,
- <1450 1420 1150000 4400000>, <1600 1570 700000 4100000>;
- cm-unknown-jeita-temp-table = <1000 1030 0 4400000>, <1150 1180 500000 4400000>,
- <1450 1420 500000 4400000>, <1600 1570 500000 4100000>;
- monitored-battery = <&bat>; //电池参数信息,容量自学习必须
- cm-capacity-track; //容量自学习开关
- cm-cap-remap-table = <1 2 3>, <2 3 2>, <98 99 2>, <99 100 3>; //电量再分
复制代码 bat:battery 节点说明如下:
- bat: battery {
- compatible = "simple-battery";
- charge-full-design-microamp-hours = <3690000>; //电池容量 uAh
- charge-term-current-microamp = <120000>; // 截止充电电流
- constant_charge_voltage_max_microvolt = <4400000>; //截止充电电压
- factory-internal-resistance-micro-ohms = <147000>; //电池内阻
- voltage-min-design-microvolt = <3450000>; //alarm电压值
- ocv-capacity-celsius = <20>; // 代表ocv-capacity-table-0是在哪个温度下测量
- ocv-capacity-table-0 = <4380000 100>, <4317000 95>, <4258000 90>, //OCV 到电量映射表
- <4200000 85>, <4145000 80>, <4092000 75>,
- <4047000 70>, <3990000 65>, <3955000 60>,
- <3900000 55>, <3861000 50>, <3834000 45>,
- <3813000 40>, <3796000 35>, <3783000 30>,
- <3770000 25>, <3752000 20>, <3730000 15>,
- <3698000 10>, <3687000 5>, <3400000 0>;
- voltage-temp-table = <1095000 800>, <986000 850>, <878000 900>, //内阻-电压映射表
- <775000 950>, <678000 1000>, <590000 1050>,
- <510000 1100>, <440000 1150>, <378000 1200>,
- <324000 1250>, <278000 1300>, <238000 1350>,
- <204000 1400>, <175000 1450>, <150000 1500>,
- <129000 1550>, <111000 1600>, <96000 1650>;
- //电池容量 – 温度补偿表
- capacity-temp-table = <45 100>, <25 100>, <10 97>, <0 95>, <(-10) 82>, <(-20)
- 62>;
- //电池内阻值 – 温度补偿表
- resistance-temp-table = <45 100>, <25 100>, <10 483>, <0 680>, <(-10) 789>, <(-
- 20) 816>;
- //不同充电器类型充电限流值
- charge-sdp-current-microamp = <500000 500000>;
- charge-dcp-current-microamp = <2000000 3000000>;
- charge-cdp-current-microamp = <1150000 1150000>;
- charge-unknown-current-microamp = <500000 500000>;
- charge-fchg-current-microamp = <3250000 3000000>;
- };
复制代码
从log上面可以看到如下充电信息:
- charger-manager: vbat: 3946000, vbat_avg: 3946000, OCV: 4020867, ibat: -443000, ibat_avg: -443000, ibus: 0, vbus: 0, msoc: 700, chg_sts: 2, frce_full: 0, chg_lmt_cur: 0, inpt_lmt_cur: 0, chgr_type: 0, Tboard: 332, Tbatt: 246, thm_cur: -22, thm_pwr: 0, is_fchg: 0, fchg_en: 0, tflush: 46, tperiod: 16
复制代码
参考文献:
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|