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

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

Merge "qcom: smb138x-charger: Add support for setting parallel mode"

parents a95f0c76 71aeac7a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,12 @@ Charger specific properties:
	revid module. This is used to identify
	the SMB subtype.

- qcom,parallel-mode
  Usage:      optional
  Value type: <u32>
  Definition: Specifies parallel charging mode. If not specified, MID-MID
	      option is selected by default.

- qcom,suspend-input
  Usage:      optional
  Value type: <empty>
+7 −1
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ struct smb_dt_props {
	int	dc_icl_ua;
	int	chg_temp_max_mdegc;
	int	connector_temp_max_mdegc;
	int	pl_mode;
};

struct smb138x {
@@ -161,6 +162,11 @@ static int smb138x_parse_dt(struct smb138x *chip)
		return -EINVAL;
	}

	rc = of_property_read_u32(node,
				"qcom,parallel-mode", &chip->dt.pl_mode);
	if (rc < 0)
		chip->dt.pl_mode = POWER_SUPPLY_PL_USBMID_USBMID;

	chip->dt.suspend_input = of_property_read_bool(node,
				"qcom,suspend-input");

@@ -588,7 +594,7 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
		val->strval = "smb138x";
		break;
	case POWER_SUPPLY_PROP_PARALLEL_MODE:
		val->intval = POWER_SUPPLY_PL_USBMID_USBMID;
		val->intval = chip->dt.pl_mode;
		break;
	case POWER_SUPPLY_PROP_CONNECTOR_HEALTH:
		val->intval = smb138x_get_prop_connector_health(chip);