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

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

Merge "qcom: smb1355: support usbin-usbin parallel configuration"

parents d40fb712 169d5d69
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@ Optional Properties:
				If not specified the default value is active-low.
- qcom,parallel-external-current-sense If present specifies external rsense is
				used for charge current sensing.
- qcom,stacked-batfet:		Boolean flag. Specifies if parallel charger has stacked BATFET
				cofiguration.

Example for standalone charger:

+15 −0
Original line number Diff line number Diff line
@@ -36,6 +36,21 @@ Charger specific properties:
	      connected to AUX. Set this flag to indicate the thermistor
	      doesn't exist.

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

- qcom,stacked-batfet
  Usage:      optional
  Value type: <empty>
  Definition: boolean flag. Specifies if parallel charger has stacked BATFET
              configuration.
	      In stacked batfet the main and parallel charger's batfet are
	      stacked one after the other and thus all the charge current
	      (FCC) flows through main. In a non-stacked configuration each
	      charger controls the charge current (FCC) separately.
================================================
Second Level Nodes - SMB1355 Charger Peripherals
================================================
+6 −0
Original line number Diff line number Diff line
@@ -93,6 +93,12 @@ Charger specific properties:
		will use io-channel-names to match IIO input names
		with IIO specifiers.

- qcom,stacked-batfet
  Usage:      optional
  Value type: <empty>
  Definition: boolean flag. Specifies if parallel charger has stacked BATFET
              cofiguration.

================================================
Second Level Nodes - SMB138X Charger Peripherals
================================================
+2 −0
Original line number Diff line number Diff line
@@ -320,6 +320,8 @@ static struct device_attribute power_supply_attrs[] = {
	POWER_SUPPLY_ATTR(pd_voltage_min),
	POWER_SUPPLY_ATTR(sdp_current_max),
	POWER_SUPPLY_ATTR(connector_type),
	POWER_SUPPLY_ATTR(parallel_batfet_mode),
	POWER_SUPPLY_ATTR(min_icl),
	/* Local extensions of type int64_t */
	POWER_SUPPLY_ATTR(charge_counter_ext),
	/* Properties of type `const char *' */
+9 −0
Original line number Diff line number Diff line
@@ -461,6 +461,7 @@ struct smb1351_charger {

	int			parallel_pin_polarity_setting;
	int			parallel_mode;
	int			pl_batfet_mode;
	bool			parallel_charger;
	bool			parallel_charger_suspended;
	bool			bms_controlled_charging;
@@ -1417,6 +1418,7 @@ static enum power_supply_property smb1351_parallel_properties[] = {
	POWER_SUPPLY_PROP_CHARGE_TYPE,
	POWER_SUPPLY_PROP_PARALLEL_MODE,
	POWER_SUPPLY_PROP_INPUT_SUSPEND,
	POWER_SUPPLY_PROP_PARALLEL_BATFET_MODE,
};

static int smb1351_parallel_set_chg_suspend(struct smb1351_charger *chip,
@@ -1706,6 +1708,9 @@ static int smb1351_parallel_get_property(struct power_supply *psy,
	case POWER_SUPPLY_PROP_INPUT_SUSPEND:
		val->intval = chip->parallel_charger_suspended;
		break;
	case POWER_SUPPLY_PROP_PARALLEL_BATFET_MODE:
		val->intval = chip->pl_batfet_mode;
		break;
	default:
		return -EINVAL;
	}
@@ -3197,6 +3202,10 @@ static int smb1351_parallel_charger_probe(struct i2c_client *client,
	else
		chip->parallel_mode = POWER_SUPPLY_PL_USBIN_USBIN;

	chip->pl_batfet_mode = POWER_SUPPLY_PL_NON_STACKED_BATFET;
	if (of_property_read_bool(node, "qcom,stacked-batfet"))
		chip->pl_batfet_mode = POWER_SUPPLY_PL_STACKED_BATFET;

	i2c_set_clientdata(client, chip);

	chip->parallel_psy_d.name = "parallel";
Loading