From 01d202d756900e3f0f88bf9b184dbcad6874b41b Mon Sep 17 00:00:00 2001 From: Chun Zhang Date: Tue, 5 Apr 2016 23:36:54 -0700 Subject: leds: qpnp-flash-v2: add callback for max current query Flash LED is a high energy aggregator from system as it is capable to provide current up to 3750mA for illumination. Therefore, it should be used with caution especially when battery state of charge is low. Therefore, add a function which can be used by clients like camera to query the flash current limit before using flash LED. This protects the system from a possible UVLO condition. CRs-Fixed: 964855 Change-Id: I17fa4f28cc151e3a3ad89d284995a3fa770bec68 Signed-off-by: Chun Zhang Signed-off-by: Devesh Jhunjhunwala --- include/linux/leds-qpnp-flash-v2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux') diff --git a/include/linux/leds-qpnp-flash-v2.h b/include/linux/leds-qpnp-flash-v2.h index c1e841689b55..38d3c9887354 100644 --- a/include/linux/leds-qpnp-flash-v2.h +++ b/include/linux/leds-qpnp-flash-v2.h @@ -16,6 +16,9 @@ #include #include "leds.h" +#define ENABLE_REGULATOR BIT(0) +#define QUERY_MAX_CURRENT BIT(1) + /* * Configurations for each individual LED */ @@ -46,4 +49,6 @@ struct flash_switch_data { struct led_classdev cdev; }; +int qpnp_flash_led_prepare(struct led_classdev *led_cdev, int options); + #endif -- cgit v1.2.3