Lines Matching +full:fast +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0
6 // Battery charger driver for MAXIM 77650/77651 charger/power-supply.
26 /* Charger is in prequalification mode. */
28 /* Charger is in fast-charge constant current mode. */
30 /* Charger is in JEITA modified fast-charge constant-current mode. */
32 /* Charger is in fast-charge constant-voltage mode. */
34 /* Charger is in JEITA modified fast-charge constant-voltage mode. */
36 /* Charger is in top-off mode. */
38 /* Charger is in JEITA modified top-off mode. */
46 /* Charger is suspended due to a fast-charge timer fault. */
95 rv = regmap_update_bits(chg->map, in max77650_charger_set_vchgin_min()
106 return -EINVAL; in max77650_charger_set_vchgin_min()
116 rv = regmap_update_bits(chg->map, in max77650_charger_set_ichgin_lim()
127 return -EINVAL; in max77650_charger_set_ichgin_lim()
134 rv = regmap_update_bits(chg->map, in max77650_charger_enable()
139 dev_err(chg->dev, "unable to enable the charger: %d\n", rv); in max77650_charger_enable()
148 rv = regmap_update_bits(chg->map, in max77650_charger_disable()
153 dev_err(chg->dev, "unable to disable the charger: %d\n", rv); in max77650_charger_disable()
163 rv = regmap_read(chg->map, MAX77650_REG_STAT_CHG_B, &reg); in max77650_charger_check_status()
165 dev_err(chg->dev, in max77650_charger_check_status()
172 dev_err(chg->dev, "undervoltage lockout detected, disabling charger\n"); in max77650_charger_check_status()
176 dev_err(chg->dev, "overvoltage lockout detected, disabling charger\n"); in max77650_charger_check_status()
183 /* May be 0x10 - debouncing */ in max77650_charger_check_status()
199 rv = regmap_read(chg->map, MAX77650_REG_STAT_CHG_B, &reg); in max77650_charger_get_property()
204 val->intval = POWER_SUPPLY_STATUS_CHARGING; in max77650_charger_get_property()
213 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in max77650_charger_get_property()
222 val->intval = POWER_SUPPLY_STATUS_CHARGING; in max77650_charger_get_property()
225 val->intval = POWER_SUPPLY_STATUS_FULL; in max77650_charger_get_property()
228 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in max77650_charger_get_property()
232 rv = regmap_read(chg->map, MAX77650_REG_STAT_CHG_B, &reg); in max77650_charger_get_property()
236 val->intval = MAX77650_CHARGER_CHG_CHARGING(reg); in max77650_charger_get_property()
239 rv = regmap_read(chg->map, MAX77650_REG_STAT_CHG_B, &reg); in max77650_charger_get_property()
244 val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; in max77650_charger_get_property()
254 val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; in max77650_charger_get_property()
258 val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE; in max77650_charger_get_property()
261 val->intval = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN; in max77650_charger_get_property()
265 return -EINVAL; in max77650_charger_get_property()
288 dev = &pdev->dev; in max77650_charger_probe()
289 parent = dev->parent; in max77650_charger_probe()
293 return -ENOMEM; in max77650_charger_probe()
297 chg->map = dev_get_regmap(parent, NULL); in max77650_charger_probe()
298 if (!chg->map) in max77650_charger_probe()
299 return -ENODEV; in max77650_charger_probe()
301 chg->dev = dev; in max77650_charger_probe()
303 pscfg.of_node = dev->of_node; in max77650_charger_probe()
331 rv = of_property_read_u32(dev->of_node, in max77650_charger_probe()
332 "input-voltage-min-microvolt", &prop); in max77650_charger_probe()
339 rv = of_property_read_u32(dev->of_node, in max77650_charger_probe()
340 "input-current-limit-microamp", &prop); in max77650_charger_probe()
358 { .compatible = "maxim,max77650-charger" },
365 .name = "max77650-charger",
376 MODULE_ALIAS("platform:max77650-charger");