Files
kernel_xiaomi_sm8250/include/linux/leds-qti-flash.h
Kiran Gunda 9d40c7c2d9 leds: qti-flash: Update camera flash client interface options
The value of "QUERY_MAX_AVAIL_CURRENT" option in the "leds-qti-flash"
driver is different from the legacy "leds-qpnp-flash" driver.
As a result, the led flash does not work. To fix this issue update
the option values of "leds-qti-flash" to align with the legacy driver.

Also add logic to handle other options "ENABLE_REGULATOR" and
"DISABLE_REGULATOR" to have backward compatibility.

Change-Id: I8213d53c6b19ccc8da74784e3b428b99fcebcbb7
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
2020-04-01 12:54:12 +05:30

29 lines
717 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
#ifndef __LEDS_QTI_FLASH_H
#define __LEDS_QTI_FLASH_H
#include <linux/leds.h>
#define ENABLE_REGULATOR BIT(0)
#define DISABLE_REGULATOR BIT(1)
#define QUERY_MAX_AVAIL_CURRENT BIT(2)
#define QUERY_MAX_CURRENT BIT(3)
int qpnp_flash_register_led_prepare(struct device *dev, void *data);
#if (defined CONFIG_LEDS_QTI_FLASH || defined CONFIG_LEDS_QPNP_FLASH_V2)
int qpnp_flash_led_prepare(struct led_trigger *trig, int options,
int *max_current);
#else
static inline int qpnp_flash_led_prepare(struct led_trigger *trig, int options,
int *max_current)
{
return -ENODEV;
}
#endif
#endif