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

Commit 2bf1521d authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: qpnp-smb2: Add a DT property to disable USB power-delivery (PD)



Platforms where the USB PHY is not enabled to support USB PD, the
PD support from PMIC can be disabled.

Change-Id: Ibc69700642c48d17c0dc54361fb1e0c011d572ae
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 81404d4d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -182,6 +182,11 @@ Charger specific properties:
  Definition: Specifies the deglitch interval for OTG detection.
		If the value is not present, 50 msec is used as default.

- qcom,pd-not-supported
  Usage:      optional
  Value type: bool
  Definition: Option to indicate if the platform supports USB PD (power delivery).

=============================================
Second Level Nodes - SMB2 Charger Peripherals
=============================================
+6 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ struct smb_dt_props {
	bool	no_battery;
	bool	hvdcp_disable;
	bool	auto_recharge_soc;
	bool	no_pd;
};

struct smb2 {
@@ -202,6 +203,9 @@ static int smb2_parse_dt(struct smb2 *chip)
	chip->dt.no_battery = of_property_read_bool(node,
						"qcom,batteryless-platform");

	chip->dt.no_pd = of_property_read_bool(node,
						"qcom,pd-not-supported");

	chg->skip_usb_notification = of_property_read_bool(node,
					"qcom,skip-usb-notification");

@@ -1154,6 +1158,8 @@ static int smb2_init_hw(struct smb2 *chip)
			chg->micro_usb_mode, 0);
	vote(chg->hvdcp_enable_votable, MICRO_USB_VOTER,
			chg->micro_usb_mode, 0);
	vote(chg->pd_disallowed_votable_indirect, PD_NOT_SUPPORTED_VOTER,
			chip->dt.no_pd, 0);

	/*
	 * AICL configuration:
+1 −1
Original line number Diff line number Diff line
@@ -2720,7 +2720,7 @@ static int __smblib_set_prop_pd_active(struct smb_charger *chg, bool pd_active)

		hvdcp = stat & QC_CHARGER_BIT;
		vote(chg->apsd_disable_votable, PD_VOTER, false, 0);
		vote(chg->pd_allowed_votable, PD_VOTER, true, 0);
		vote(chg->pd_allowed_votable, PD_VOTER, false, 0);
		vote(chg->usb_irq_enable_votable, PD_VOTER, false, 0);
		vote(chg->hvdcp_disable_votable_indirect, PD_INACTIVE_VOTER,
								false, 0);
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ enum print_reason {
#define OTG_DELAY_VOTER			"OTG_DELAY_VOTER"
#define USBIN_I_VOTER			"USBIN_I_VOTER"
#define WEAK_CHARGER_VOTER		"WEAK_CHARGER_VOTER"
#define PD_NOT_SUPPORTED_VOTER		"PD_NOT_SUPPORTED_VOTER"

#define VCONN_MAX_ATTEMPTS	3
#define OTG_MAX_ATTEMPTS	3