Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2560b98 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: Add support to configure fast charging current



Make the fast charging current configurable through setting the
power supply property POWER_SUPPLY_PROP_CONST_CHARGE_CURRENT_MAX.

CRs-Fixed: 695481
Change-Id: I895b0550a73333a3895d5da16119d3ebe77d4643
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 08a898ac
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1764,6 +1764,7 @@ static int smbchg_battery_set_property(struct power_supply *psy,
				       enum power_supply_property prop,
				       const union power_supply_propval *val)
{
	int rc = 0;
	struct smbchg_chip *chip = container_of(psy,
				struct smbchg_chip, batt_psy);

@@ -1781,11 +1782,14 @@ static int smbchg_battery_set_property(struct power_supply *psy,
	case POWER_SUPPLY_PROP_SYSTEM_TEMP_LEVEL:
		smbchg_system_temp_level_set(chip, val->intval);
		break;
	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
		rc = smbchg_set_fastchg_current(chip, val->intval / 1000);
		break;
	default:
		return -EINVAL;
	}

	return 0;
	return rc;
}

static int smbchg_battery_is_writeable(struct power_supply *psy,
@@ -1797,6 +1801,7 @@ static int smbchg_battery_is_writeable(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CHARGING_ENABLED:
	case POWER_SUPPLY_PROP_CAPACITY:
	case POWER_SUPPLY_PROP_SYSTEM_TEMP_LEVEL:
	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
		rc = 1;
		break;
	default: