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

Commit 12970bb4 authored by Mohan Pallaka's avatar Mohan Pallaka
Browse files

leds: qpnp-wled: add sync commands after updating fs current



Fullscale current would be applied only after running
sync commands.

Change-Id: Ie7208e88d52aa945a7af22086f49389582723b5f
CRs-fixed:924323
Signed-off-by: default avatarMohan Pallaka <mpallaka@codeaurora.org>
parent ec971dd4
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -669,6 +669,23 @@ static ssize_t qpnp_wled_fs_curr_ua_store(struct device *dev,

	wled->fs_curr_ua = data;

	/* sync */
	reg = QPNP_WLED_SYNC;
	rc = qpnp_wled_write_reg(wled, &reg,
		QPNP_WLED_SYNC_REG(wled->sink_base));
	if (rc < 0)
		return rc;

	if (wled->cons_sync_write_delay_us)
		usleep_range(wled->cons_sync_write_delay_us,
				wled->cons_sync_write_delay_us + 1);

	reg = QPNP_WLED_SYNC_RESET;
	rc = qpnp_wled_write_reg(wled, &reg,
		QPNP_WLED_SYNC_REG(wled->sink_base));
	if (rc < 0)
		return rc;

	return count;
}