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

Commit fd36c632 authored by Sundara Vinayagam's avatar Sundara Vinayagam Committed by Shilpa Suresh
Browse files

power: qpnp-smb2: Update the driver to use extcon



The USB driver on 4.9 kernel uses the extcon framework
for communication, update the driver to support this.

Change-Id: I42fb61e4fe1d48e5bdc8f27a312ea3936bb93f56
Signed-off-by: default avatarSundara Vinayagam <sundvi@codeaurora.org>
parent f8fe8a66
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -35,6 +35,13 @@ Charger specific properties:
		addition battery properties will be faked such that the device
		assumes normal operation.

- qcom,use-extcon
  Usage:      optional
  Value type: <empty>
  Definition: Boolean flag which specify that SMB2 will act as main charger
	      to do extcon USB calls. If not defined, other charger driver can
	      act as main charger to do extcon USB calls.

- qcom,fcc-max-ua
  Usage:      optional
  Value type: <u32>
+3 −0
Original line number Diff line number Diff line
@@ -313,6 +313,9 @@ static int smb2_parse_dt(struct smb2 *chip)
	chip->dt.auto_recharge_soc = of_property_read_bool(node,
						"qcom,auto-recharge-soc");

	chg->use_extcon = of_property_read_bool(node,
						"qcom,use-extcon");

	chg->dcp_icl_ua = chip->dt.usb_icl_ua;

	chg->suspend_input_on_debug_batt = of_property_read_bool(node,
+3 −5
Original line number Diff line number Diff line
@@ -3774,13 +3774,11 @@ static void smblib_handle_apsd_done(struct smb_charger *chg, bool rising)
	switch (apsd_result->bit) {
	case SDP_CHARGER_BIT:
	case CDP_CHARGER_BIT:
		if (chg->connector_type == POWER_SUPPLY_CONNECTOR_MICRO_USB)
			extcon_set_state_sync(chg->extcon, EXTCON_USB,
					true);
		/* if not DCP then no hvdcp timeout happens. Enable pd here */
		/* if not DCP, Enable pd here */
		vote(chg->pd_disallowed_votable_indirect, HVDCP_TIMEOUT_VOTER,
				false, 0);
		if (chg->use_extcon)
		if (chg->connector_type == POWER_SUPPLY_CONNECTOR_MICRO_USB
						|| chg->use_extcon)
			smblib_notify_device_mode(chg, true);
		break;
	case OCP_CHARGER_BIT: