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

Commit 2a117735 authored by Shyam Kumar Thella's avatar Shyam Kumar Thella
Browse files

leds: qti-flash: Limit off_time of switch to a maximum of 1280 ms



Currently, Flash LED peripheral supports a maximum safety timer expiry
of 1280 ms for flash mode where the target current can go as high as
1500 mA. If off_time is allowed more than that time period, then
flash LED can stay ON more than that safety timer period. Hence, clamp
off_time to not exceed 1280 ms.

Change-Id: Idbd8b41c5041c50e3f714be9efb0ad04b1ee9181
Signed-off-by: default avatarShyam Kumar Thella <sthella@codeaurora.org>
parent d224f958
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1032,6 +1032,8 @@ static ssize_t qti_flash_off_time_store(struct device *dev,
	if (rc < 0)
		return rc;

	val = min_t(u64, val, SAFETY_TIMER_MAX_TIMEOUT_MS);

	snode = container_of(led_cdev, struct flash_switch_data, cdev);
	snode->off_time_ms = val;