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

Commit 46883f3b authored by Prasad Sodagudi's avatar Prasad Sodagudi
Browse files

pwm: qpnp: correct LUT mode LPG disable steps



Modify the pwm-qpnp driver in order to remove RAMP_CONTROL
register writes during LPG disable while in LUT mode.

This is needed to fix the LED blink functionality
when LPG enable/disable operations are performed continously

CRs-Fixed: 593837
Change-Id: I915eb7620902911ef8d3f8d44c9b75986bc69bd1
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent 810f6916
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -132,7 +132,6 @@ do { \
#define QPNP_ENABLE_LUT_V0(value) (value |= QPNP_RAMP_START_MASK)
#define QPNP_DISABLE_LUT_V0(value) (value &= ~QPNP_RAMP_START_MASK)
#define QPNP_ENABLE_LUT_V1(value, id) (value |= BIT(id))
#define QPNP_DISABLE_LUT_V1(value, id) (value &= ~BIT(id))

/* LPG Control for RAMP_STEP_DURATION_LSB */
#define QPNP_RAMP_STEP_DURATION_LSB_MASK	0xFF
@@ -1006,8 +1005,6 @@ static int qpnp_lpg_configure_lut_state(struct qpnp_pwm_chip *chip,
					lpg_config->lut_config.ramp_index);
			value2 = QPNP_ENABLE_LPG_MODE;
		} else {
			QPNP_DISABLE_LUT_V1(value1,
					lpg_config->lut_config.ramp_index);
			value2 = QPNP_DISABLE_LPG_MODE;
		}
		mask1 = value1;
@@ -1027,8 +1024,10 @@ static int qpnp_lpg_configure_lut_state(struct qpnp_pwm_chip *chip,
	if (rc)
		return rc;

	return qpnp_lpg_save_and_write(value1, mask1, reg1,
	if (state == QPNP_LUT_ENABLE || chip->revision == QPNP_LPG_REVISION_0)
		rc = qpnp_lpg_save_and_write(value1, mask1, reg1,
					addr1, 1, chip);
	return rc;
}

static inline int qpnp_enable_pwm_mode(struct qpnp_pwm_chip *chip)