@@ -692,8 +692,11 @@ static int smb_set_property(struct power_supply *psy,
{
struct smb_chip *chip = power_supply_get_drvdata(psy);
switch (psp) {
+ case POWER_SUPPLY_PROP_STATUS:
+ return regmap_update_bits(chip->regmap, chip->base + USBIN_CMD_IL,
+ USBIN_SUSPEND_BIT, !val->intval);
case POWER_SUPPLY_PROP_CURRENT_MAX:
return smb_set_current_limit(chip, val->intval);
default:
dev_err(chip->dev, "No setter for property: %d\n", psp);
@@ -704,8 +707,9 @@ static int smb_set_property(struct power_supply *psy,
static int smb_property_is_writable(struct power_supply *psy,
enum power_supply_property psp)
{
switch (psp) {
+ case POWER_SUPPLY_PROP_STATUS:
case POWER_SUPPLY_PROP_CURRENT_MAX:
return 1;
default:
return 0;
Hook up USBIN_CMD_IL so that writing "0" to the status register will disable charging, this is useful to let users limit charging automatically. Signed-off-by: Casey Connolly <casey.connolly@linaro.org> --- drivers/power/supply/qcom_smbx.c | 4 ++++ 1 file changed, 4 insertions(+)