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

Commit 07b04723 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Gerrit - the friendly Code Review server
Browse files

leds: qpnp-wled: Cap the lower limit of brightness level



As per the hardware documentation, operating limits of WLED is
from 0.4% to 100%. Cap the lower limit to 0.4% to ensure proper
operation.

Change-Id: I7ee2684ea2186d4fdda5cea9a4d421b429a6d4fd
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent a5665f16
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -537,6 +537,11 @@ static int qpnp_wled_set_level(struct qpnp_wled *wled, int level)
{
{
	int i, rc;
	int i, rc;
	u8 reg;
	u8 reg;
	u16 low_limit = WLED_MAX_LEVEL_4095 * 4 / 1000;

	/* WLED's lower limit of operation is 0.4% */
	if (level > 0 && level < low_limit)
		level = low_limit;


	/* set brightness registers */
	/* set brightness registers */
	for (i = 0; i < wled->max_strings; i++) {
	for (i = 0; i < wled->max_strings; i++) {