static int smb347_battery_set_property(struct power_supply *psy, enum power_supply_property prop, const union power_supply_propval *val) { int ret = -EINVAL; struct smb347_charger *smb = container_of(psy, struct smb347_charger, battery); switch (prop) { case POWER_SUPPLY_PROP_CHARGE_ENABLED: ret = smb347_charging_set(smb, val->intval); break; default: break; } return ret; }
static inline int smb347_charging_disable(struct smb347_charger *smb) { return smb347_charging_set(smb, false); }
static inline int smb347_charging_enable(struct smb347_charger *smb) { return smb347_charging_set(smb, true); }