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

Commit deaa86bd authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Ashay Jaiswal
Browse files

power: qpnp-smbcharger: Add power-supply property for HVDCP 3.0 status



Use this property to determine if HVDCP3 is supported. HVDCP 3.0
is not supported at startup and needs to be enabled from
userspace. The charger is forced to 9V HVDCP 2.0 at all times
if HVDCP 3.0 is not enabled.

While at it remove the DT property 'qcom,enable-hvdcp-9v'.

Change-Id: I193bd959dd9cb5303f375d2720ec59914ef16032
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 1b202c69
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -266,7 +266,6 @@ Optional Properties:
- qcom,skip-usb-notification	A boolean property to be used when usb gets present
				and type from other means. Especially true on
				liquid hardware, where usb presence is detected based on GPIO.
- qcom,enable-hvdcp-9v		A bool property to enable 9V HVDCP 2.0 detection.

Example:
	qcom,qpnp-smbcharger {
+7 −5
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ struct smbchg_chip {
	bool				cfg_chg_led_sw_ctrl;
	bool				vbat_above_headroom;
	bool				force_aicl_rerun;
	bool				enable_hvdcp_9v;
	bool				hvdcp3_supported;
	u8				original_usbin_allowance;
	struct parallel_usb_cfg		parallel;
	struct delayed_work		parallel_en_work;
@@ -3910,8 +3910,8 @@ static void smbchg_hvdcp_det_work(struct work_struct *work)
	int rc;

	if (is_hvdcp_present(chip)) {
		if (chip->enable_hvdcp_9v
				&& (chip->wa_flags & SMBCHG_HVDCP_9V_EN_WA)) {
		if (!chip->hvdcp3_supported &&
			(chip->wa_flags & SMBCHG_HVDCP_9V_EN_WA)) {
			/* force HVDCP 2.0 */
			rc = force_9v_hvdcp(chip);
			if (rc)
@@ -4937,6 +4937,10 @@ static int smbchg_dp_dm(struct smbchg_chip *chip, int val)
			chip->pulse_cnt--;
		pr_smb(PR_MISC, "pulse_cnt = %d\n", chip->pulse_cnt);
		break;
	case POWER_SUPPLY_DP_DM_HVDCP3_SUPPORTED:
		chip->hvdcp3_supported = true;
		pr_smb(PR_MISC, "HVDCP3 supported\n");
		break;
	default:
		break;
	}
@@ -6468,8 +6472,6 @@ static int smb_parse_dt(struct smbchg_chip *chip)
					"qcom,low-volt-dcin");
	chip->force_aicl_rerun = of_property_read_bool(node,
					"qcom,force-aicl-rerun");
	chip->enable_hvdcp_9v = of_property_read_bool(node,
					"qcom,enable-hvdcp-9v");

	/* parse the battery missing detection pin source */
	rc = of_property_read_string(chip->spmi->dev.of_node,
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ enum {
	POWER_SUPPLY_DP_DM_DP0P6_DM3P3 = 7,
	POWER_SUPPLY_DP_DM_DPF_DMF = 8,
	POWER_SUPPLY_DP_DM_DPR_DMR = 9,
	POWER_SUPPLY_DP_DM_HVDCP3_SUPPORTED = 10,
};

enum power_supply_property {