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

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

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

parents b9039363 744fed9a
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -168,6 +168,11 @@ Charger specific properties:
  Definition: Specifies the deglitch interval for OTG detection.
  Definition: Specifies the deglitch interval for OTG detection.
		If the value is not present, 50 msec is used as default.
		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).

- qcom,step-charging-enable
- qcom,step-charging-enable
  Usage:      optional
  Usage:      optional
  Value type: bool
  Value type: bool
+6 −1
Original line number Original line Diff line number Diff line
@@ -170,6 +170,7 @@ struct smb_dt_props {
	bool	hvdcp_disable;
	bool	hvdcp_disable;
	bool	auto_recharge_soc;
	bool	auto_recharge_soc;
	int	wd_bark_time;
	int	wd_bark_time;
	bool	no_pd;
};
};


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


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

	rc = of_property_read_u32(node,
	rc = of_property_read_u32(node,
				"qcom,fcc-max-ua", &chg->batt_profile_fcc_ua);
				"qcom,fcc-max-ua", &chg->batt_profile_fcc_ua);
	if (rc < 0)
	if (rc < 0)
@@ -1644,7 +1648,8 @@ static int smb2_init_hw(struct smb2 *chip)
			true, 0);
			true, 0);
	vote(chg->pd_disallowed_votable_indirect, HVDCP_TIMEOUT_VOTER,
	vote(chg->pd_disallowed_votable_indirect, HVDCP_TIMEOUT_VOTER,
			true, 0);
			true, 0);

	vote(chg->pd_disallowed_votable_indirect, PD_NOT_SUPPORTED_VOTER,
			chip->dt.no_pd, 0);
	/*
	/*
	 * AICL configuration:
	 * AICL configuration:
	 * start from min and AICL ADC disable
	 * start from min and AICL ADC disable
+1 −1
Original line number Original line Diff line number Diff line
@@ -2947,7 +2947,7 @@ static int __smblib_set_prop_pd_active(struct smb_charger *chg, bool pd_active)


		hvdcp = stat & QC_CHARGER_BIT;
		hvdcp = stat & QC_CHARGER_BIT;
		vote(chg->apsd_disable_votable, PD_VOTER, false, 0);
		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->usb_irq_enable_votable, PD_VOTER, false, 0);
		vote(chg->hvdcp_disable_votable_indirect, PD_INACTIVE_VOTER,
		vote(chg->hvdcp_disable_votable_indirect, PD_INACTIVE_VOTER,
								false, 0);
								false, 0);
+1 −0
Original line number Original line Diff line number Diff line
@@ -73,6 +73,7 @@ enum print_reason {
#define OV_VOTER			"OV_VOTER"
#define OV_VOTER			"OV_VOTER"
#define FG_ESR_VOTER			"FG_ESR_VOTER"
#define FG_ESR_VOTER			"FG_ESR_VOTER"
#define FCC_STEPPER_VOTER		"FCC_STEPPER_VOTER"
#define FCC_STEPPER_VOTER		"FCC_STEPPER_VOTER"
#define PD_NOT_SUPPORTED_VOTER		"PD_NOT_SUPPORTED_VOTER"


#define VCONN_MAX_ATTEMPTS	3
#define VCONN_MAX_ATTEMPTS	3
#define OTG_MAX_ATTEMPTS	3
#define OTG_MAX_ATTEMPTS	3