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

Fullscale current would be applied only after running
sync commands.

Change-Id: Ie7208e88d52aa945a7af22086f49389582723b5f
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
This commit is contained in:
Mohan Pallaka 2015-10-16 15:28:21 -07:00 committed by Gerrit - the friendly Code Review server
parent d04dc77ab8
commit 06c37f54a4
1 changed files with 17 additions and 0 deletions

View File

@ -706,6 +706,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;
}