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

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

Merge "regulator: qpnp-lcdb: Fix boost headroom and max voltage configuration"

parents c1bc698f 841eb431
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -212,8 +212,9 @@ Properties below are specific to BOOST subnode only.
- qcom,bst-headroom-mv
	Usage:      optional
	Value type:  <u16>
	Definition:  Headroom of the boost (in mV). The minimum headroom is
		     200mV and if not specified defaults to 200mV.
	Definition:  Headroom of the boost (in mV). If not specified, then the
		     default value is 200 mV (PM660L) or 150 mV (for PM855L or
		     PMI632).

=======
Example
+14 −3
Original line number Diff line number Diff line
@@ -991,7 +991,8 @@ static irqreturn_t qpnp_lcdb_sc_irq_handler(int irq, void *data)
}

#define MIN_BST_VOLTAGE_MV			4700
#define MAX_BST_VOLTAGE_MV			6250
#define PM660_MAX_BST_VOLTAGE_MV		6250
#define MAX_BST_VOLTAGE_MV			6275
#define MIN_VOLTAGE_MV				4000
#define MAX_VOLTAGE_MV				6000
#define VOLTAGE_MIN_STEP_100_MV			4000
@@ -1017,8 +1018,14 @@ static int qpnp_lcdb_set_bst_voltage(struct qpnp_lcdb *lcdb,

	if (bst_voltage_mv < MIN_BST_VOLTAGE_MV)
		bst_voltage_mv = MIN_BST_VOLTAGE_MV;
	else if (bst_voltage_mv > MAX_BST_VOLTAGE_MV)

	if (pmic_subtype == PM660L_SUBTYPE) {
		if (bst_voltage_mv > PM660_MAX_BST_VOLTAGE_MV)
			bst_voltage_mv = PM660_MAX_BST_VOLTAGE_MV;
	} else {
		if (bst_voltage_mv > MAX_BST_VOLTAGE_MV)
			bst_voltage_mv = MAX_BST_VOLTAGE_MV;
	}

	if (bst_voltage_mv != bst->voltage_mv) {
		if (pmic_subtype == PM660L_SUBTYPE) {
@@ -1883,6 +1890,8 @@ static int qpnp_lcdb_init_bst(struct qpnp_lcdb *lcdb)
			return rc;
		}
		lcdb->bst.soft_start_us = (val & SOFT_START_MASK) * 200 + 200;
		if (!lcdb->bst.headroom_mv)
			lcdb->bst.headroom_mv = PM660_BST_HEADROOM_DEFAULT_MV;
	} else {
		rc = qpnp_lcdb_read(lcdb, lcdb->base +
				    LCDB_BST_SS_CTL_REG, &val, 1);
@@ -1891,6 +1900,8 @@ static int qpnp_lcdb_init_bst(struct qpnp_lcdb *lcdb)
			return rc;
		}
		lcdb->bst.soft_start_us = soft_start_us[val & SOFT_START_MASK];
		if (!lcdb->bst.headroom_mv)
			lcdb->bst.headroom_mv = BST_HEADROOM_DEFAULT_MV;
	}

	return 0;