高通charge

smbchg_parse_peripherals里面设置了 base地址chip->usb_chgpth_base = resource->start;

属性

/sys/class/power_supply/battery/目录下的属性定义在(前缀)-charger.c里面,前缀有多钟:

充电方式

文件

举例IC

举例平台

非快充

qpnp-linear-charger.c

pm8916

msm8916

外部快充IC

smb135x-charger.c

smb1357

msm8916

PMIC快充

qpnp-smbcharger.c

pm8952

msm8940

smbchg_battery_get_property

smbchg_battery_set_property

cat /sys/class/power_supply/battery/constant_charge_current_max

echo 400000 > /sys/class/power_supply/battery/constant_charge_current_max

有些属性会到其他模块获取如temp用从bms里面得到。

qpnp-smbcharger.c -> get_prop_batt_temp ->fg.c->update_temp_data

static int smbchg_set_fastchg_current_user(struct smbchg_chip *chip,

int current_ma)

rc = vote(chip->fcc_votable, BATT_TYPE_FCC_VOTER, true,

fastchg_ma);

rc = vote(chip->fcc_votable, RESTRICTED_CHG_FCC_VOTER, enable,

fastchg_current);

rc = vote(chip->fcc_votable, BATT_TYPE_FCC_VOTER, true,

chip->cfg_fastchg_current_ma);

投票在qpnp-smbcharger.c的probe里面创建,里面会

chip->fcc_votable = create_votable(&spmi->dev,

"SMBCHG: fcc",

VOTE_MIN, NUM_FCC_VOTER, 2000,

set_fastchg_current_vote_cb);

讲述cold cool normal warm hot充电

80-nv610-44_a_msm8952 linux android charger software user guide.pdf

12页

qcom,cold-bat-decidegc = <0>;

qcom,cool-bat-decidegc = <30>;

qcom,hot-bat-decidegc = <500>;

qcom,warm-bat-decidegc = <450>;

这几个值在&pmi8937_fg 里面配置,在qpnp-fg.c里面解析

cool 和warm限制电流都是 300mA,但是一直没有找到这300mA是在哪里配置的

调试qpnp_smbcharger 模块参数看打印

adb shell "echo 7 > /sys/module/qpnp_smbcharger/parameters/debug_mask"

adb shell "cat /sys/module/qpnp_smbcharger/parameters/debug_mask"

smbchg_debug_mask

pmi8952 datasheet:

80_NT391_2X_PMI8952_Hardware_Register_Description.pdf

调试指南

80-nv610-44_a_msm8952 linux android charger software user guide.pdf

高通charge_第1张图片

80-nv610-41_c_linux_android_pmic_fuel_gauge_user_guide.pdf

高通charge_第2张图片

你可能感兴趣的:(charge,高通,充电,高通)