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

Commit b280775c authored by Sahil Chandna's avatar Sahil Chandna Committed by Gerrit - the friendly Code Review server
Browse files

power: smb2: Configure CC threshold voltage to 1.6 V



Based on hardware recommendation, set CC threshold voltage
to be 1.6 V for SRC mode.

Change-Id: I9fb324b9901b8f870ffb90abca99071a9c8d4c44
Signed-off-by: default avatarSahil Chandna <chandna@codeaurora.org>
parent 932a3b3d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1479,6 +1479,13 @@ static int smb2_configure_typec(struct smb_charger *chg)
		return rc;
	}

	/* Set CC threshold to 1.6 V in source mode */
	rc = smblib_masked_write(chg, TYPE_C_CFG_2_REG, DFP_CC_1P4V_OR_1P6V_BIT,
				 DFP_CC_1P4V_OR_1P6V_BIT);
	if (rc < 0)
		dev_err(chg->dev,
			"Couldn't configure CC threshold voltage rc=%d\n", rc);

	return rc;
}

+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -570,7 +570,7 @@ enum {

#define TYPE_C_CFG_2_REG			(USBIN_BASE + 0x59)
#define TYPE_C_DFP_CURRSRC_MODE_BIT		BIT(7)
#define VCONN_ILIM500MA_CFG_BIT			BIT(6)
#define DFP_CC_1P4V_OR_1P6V_BIT			BIT(6)
#define VCONN_SOFTSTART_CFG_MASK		GENMASK(5, 4)
#define EN_TRY_SOURCE_MODE_BIT			BIT(3)
#define USB_FACTORY_MODE_ENABLE_BIT		BIT(2)