LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 7 / 14
static int qpnp_lbc_probe(struct spmi_device *spmi)
{
if (is_parallel_charger(spmi))
return qpnp_lbc_parallel_probe(spmi);
else
return qpnp_lbc_main_probe(spmi);
}
static int __init qpnp_lbc_init(void)
{
return spmi_driver_register(&qpnp_lbc_driver);
}
module_init(qpnp_lbc_init);
static void __exit qpnp_lbc_exit(void)
{
spmi_driver_unregister(&qpnp_lbc_driver);
}
module_exit(qpnp_lbc_exit);
MODULE_DESCRIPTION("QPNP Linear charger driver");
MODULE_LICENSE("GPL v2");
DTS Parse
DTS (Device Tree Source) is parsed by probe function.
static int qpnp_charger_read_dt_props(struct qpnp_lbc_chip *chip)
{
xxx
xxx
}
Charging Controlling
e.g.: when the battery temperature changes, charging current will become smaller to protect battery.
Please refer to the following code:
static void qpnp_lbc_set_appropriate_current(struct qpnp_lbc_chip *chip)
{
unsigned int chg_current = chip->usb_psy_ma;
if (chip->bat_is_cool && chip->cfg_cool_bat_chg_ma)
chg_current = min(chg_current, chip->cfg_cool_bat_chg_ma);
if (chip->bat_is_warm && chip->cfg_warm_bat_chg_ma)
chg_current = min(chg_current, chip->cfg_warm_bat_chg_ma);
if (chip->therm_lvl_sel != 0 && chip->thermal_mitigation)
chg_current = min(chg_current,
Quectel
Confidential