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

Commit 879422d5 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb1355: Extend minoff-time and dead-time for SMB1355"

parents 38e6f2c2 c7f8cad0
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -144,6 +144,13 @@
#define MISC_CHGR_TRIM_OPTIONS_REG		(MISC_BASE + 0x55)
#define CMD_RBIAS_EN_BIT			BIT(2)

#define MISC_ENG_SDCDC_RESERVE1_REG		(MISC_BASE + 0xC4)
#define MINOFF_TIME_MASK			BIT(6)

#define MISC_ENG_SDCDC_CFG8_REG			(MISC_BASE + 0xC7)
#define DEAD_TIME_MASK				GENMASK(2, 0)
#define DEAD_TIME_32NS				0x4

#define MISC_ENG_SDCDC_INPUT_CURRENT_CFG1_REG	(MISC_BASE + 0xC8)
#define PROLONG_ISENSE_MASK			GENMASK(7, 6)
#define PROLONG_ISENSEM_SHIFT			6
@@ -1383,6 +1390,22 @@ static int smb1355_init_hw(struct smb1355 *chip)
		return rc;
	}

	/* Extend min-offtime same as blanking time */
	rc = smb1355_masked_write(chip, MISC_ENG_SDCDC_RESERVE1_REG,
						MINOFF_TIME_MASK, 0);
	if (rc < 0) {
		pr_err("Couldn't set MINOFF_TIME rc=%d\n", rc);
		return rc;
	}

	/* Set dead-time to 32ns */
	rc = smb1355_masked_write(chip, MISC_ENG_SDCDC_CFG8_REG,
					DEAD_TIME_MASK, DEAD_TIME_32NS);
	if (rc < 0) {
		pr_err("Couldn't set DEAD_TIME to 32ns rc=%d\n", rc);
		return rc;
	}

	/* Configure DIE temp Low threshold */
	if (chip->dt.hw_die_temp_mitigation) {
		range = (chip->dt.die_temp_threshold - DIE_LOW_RANGE_BASE_DEGC)