Lines Matching +full:trickle +full:- +full:charge
1 // SPDX-License-Identifier: GPL-2.0
7 * See Documentation/ABI/testing/sysfs-class-power and
8 * Documentation/ABI/testing/sysfs-class-power-wilco for userspace interface
14 #include <linux/platform_data/wilco-ec.h>
17 #define DRV_NAME "wilco-charger"
26 CHARGE_MODE_EXP = 2, /* Express Charge, used for Fast */
27 CHARGE_MODE_AC = 3, /* Mostly AC use, used for Trickle */
38 /* Convert from POWER_SUPPLY_PROP_CHARGE_TYPE value to the EC's charge mode */
55 return -EINVAL; in psp_val_to_charge_mode()
59 /* Convert from EC's charge mode to POWER_SUPPLY_PROP_CHARGE_TYPE value */
76 return -EINVAL; in charge_mode_to_psp_val()
106 return -EINVAL; in wilco_charge_get_property()
115 return -EBADMSG; in wilco_charge_get_property()
118 val->intval = raw; in wilco_charge_get_property()
132 mode = psp_val_to_charge_mode(val->intval); in wilco_charge_set_property()
134 return -EINVAL; in wilco_charge_set_property()
137 if (val->intval < CHARGE_LOWER_LIMIT_MIN || in wilco_charge_set_property()
138 val->intval > CHARGE_LOWER_LIMIT_MAX) in wilco_charge_set_property()
139 return -EINVAL; in wilco_charge_set_property()
141 val->intval); in wilco_charge_set_property()
143 if (val->intval < CHARGE_UPPER_LIMIT_MIN || in wilco_charge_set_property()
144 val->intval > CHARGE_UPPER_LIMIT_MAX) in wilco_charge_set_property()
145 return -EINVAL; in wilco_charge_set_property()
147 val->intval); in wilco_charge_set_property()
149 return -EINVAL; in wilco_charge_set_property()
171 struct wilco_ec_device *ec = dev_get_drvdata(pdev->dev.parent); in wilco_charge_probe()
176 psy = devm_power_supply_register(&pdev->dev, &wilco_ps_desc, &psy_cfg); in wilco_charge_probe()
192 MODULE_DESCRIPTION("Wilco EC charge control driver");