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

Commit 5abea2b1 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qcom-charger: smb138x-charger: add parallel enable status properties"

parents 744bdc65 081e4221
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -225,9 +225,9 @@ static struct device_attribute power_supply_attrs[] = {
	/* Local extensions */
	POWER_SUPPLY_ATTR(usb_hc),
	POWER_SUPPLY_ATTR(usb_otg),
	POWER_SUPPLY_ATTR(charge_enabled),
	POWER_SUPPLY_ATTR(battery_charging_enabled),
	POWER_SUPPLY_ATTR(charging_enabled),
	POWER_SUPPLY_ATTR(pin_enabled),
	POWER_SUPPLY_ATTR(input_suspend),
	POWER_SUPPLY_ATTR(input_voltage_regulation),
	POWER_SUPPLY_ATTR(input_current_max),
+15 −0
Original line number Diff line number Diff line
@@ -357,6 +357,8 @@ static int smb138x_init_batt_psy(struct smb138x *chip)
 *****************************/

static enum power_supply_property smb138x_parallel_props[] = {
	POWER_SUPPLY_PROP_CHARGING_ENABLED,
	POWER_SUPPLY_PROP_PIN_ENABLED,
	POWER_SUPPLY_PROP_INPUT_SUSPEND,
	POWER_SUPPLY_PROP_VOLTAGE_MAX,
	POWER_SUPPLY_PROP_CURRENT_MAX,
@@ -368,8 +370,21 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
{
	struct smb_charger *chg = power_supply_get_drvdata(psy);
	int rc = 0;
	u8 temp;

	switch (prop) {
	case POWER_SUPPLY_PROP_CHARGING_ENABLED:
		rc = smblib_read(chg, BATTERY_CHARGER_STATUS_5_REG,
				 &temp);
		if (rc >= 0)
			val->intval = (bool)(temp & CHARGING_ENABLE_BIT);
		break;
	case POWER_SUPPLY_PROP_PIN_ENABLED:
		rc = smblib_read(chg, BATTERY_CHARGER_STATUS_5_REG,
				 &temp);
		if (rc >= 0)
			val->intval = !(temp & DISABLE_CHARGING_BIT);
		break;
	case POWER_SUPPLY_PROP_INPUT_SUSPEND:
		rc = smblib_get_usb_suspend(chg, &val->intval);
		break;
+1 −1
Original line number Diff line number Diff line
@@ -174,9 +174,9 @@ enum power_supply_property {
	/* Local extensions */
	POWER_SUPPLY_PROP_USB_HC,
	POWER_SUPPLY_PROP_USB_OTG,
	POWER_SUPPLY_PROP_CHARGE_ENABLED,
	POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED,
	POWER_SUPPLY_PROP_CHARGING_ENABLED,
	POWER_SUPPLY_PROP_PIN_ENABLED,
	POWER_SUPPLY_PROP_INPUT_SUSPEND,
	POWER_SUPPLY_PROP_INPUT_VOLTAGE_REGULATION,
	POWER_SUPPLY_PROP_INPUT_CURRENT_MAX,