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

Commit 2946916d authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

leds: qpnp-flash: Add support to query maximum current



Currently, MAX_CURRENT option is used to query the maximum
available current which is a relative value based on the battery
parameters. Rename it to MAX_AVAIL_CURRENT so that MAX_CURRENT
option can be used to query the maximum current that is supported
for flash LED devices.

Change-Id: Id48327c818a42e4407627055c6b243591ab441fe
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 053fad16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1336,7 +1336,7 @@ int qpnp_flash_led_prepare(struct led_trigger *trig, int options,
		}
	}

	if (options & QUERY_MAX_CURRENT) {
	if (options & QUERY_MAX_AVAIL_CURRENT) {
		rc = qpnp_flash_led_get_max_avail_current(led, max_current);
		if (rc < 0) {
			pr_err("query max current failed, rc=%d\n", rc);
+1 −1
Original line number Diff line number Diff line
@@ -719,7 +719,7 @@ int cam_flash_parser(struct cam_flash_ctrl *fctrl, void *arg)
				(struct cam_flash_query_curr *)cmd_buf;

			rc = qpnp_flash_led_prepare(fctrl->switch_trigger,
				QUERY_MAX_CURRENT, &query_curr_ma);
				QUERY_MAX_AVAIL_CURRENT, &query_curr_ma);
			CAM_DBG(CAM_FLASH, "query_curr_ma = %d",
				query_curr_ma);
			if (rc) {
+5 −4
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -17,7 +17,8 @@

#define ENABLE_REGULATOR		BIT(0)
#define DISABLE_REGULATOR		BIT(1)
#define QUERY_MAX_CURRENT	BIT(2)
#define QUERY_MAX_AVAIL_CURRENT		BIT(2)
#define QUERY_MAX_CURRENT		BIT(3)

#define FLASH_LED_PREPARE_OPTIONS_MASK	GENMASK(3, 0)