android_kernel_xiaomi_sm8350/include/linux/leds-qti-flash.h
Jishnu Prakash b295dc4303 backlight: qcom-spmi-wled: expose WLED selfie flash API with QTI_FLASH
At present, the WLED selfie flash API wled_flash_led_prepare is exposed
only for targets using QPNP_FLASH_V2 and WLED. Expose it for targets using
the combination of QTI_FLASH and WLED too.

Change-Id: I136b95f8219171534bad06109bd08423061a00c6
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
2021-01-11 13:52:51 +05:30

55 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020-2021, 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)
/**
* struct flash_led_param: QTI flash LED parameter data
* @on_time_ms : Time to wait before strobing the switch
* @off_time_ms : Time to wait to turn off LED after strobing switch
*/
struct flash_led_param {
u64 on_time_ms;
u64 off_time_ms;
};
#if IS_ENABLED(CONFIG_LEDS_QTI_FLASH)
int qti_flash_led_prepare(struct led_trigger *trig,
int options, int *max_current);
int qti_flash_led_set_param(struct led_trigger *trig,
struct flash_led_param param);
#else
static inline int qti_flash_led_prepare(struct led_trigger *trig,
int options, int *max_current)
{
return -EINVAL;
}
static inline int qti_flash_led_set_param(struct led_trigger *trig,
struct flash_led_param param)
{
return -EINVAL;
}
#endif
#if IS_ENABLED(CONFIG_BACKLIGHT_QCOM_SPMI_WLED)
int wled_flash_led_prepare(struct led_trigger *trig, int options,
int *max_current);
#else
static inline int wled_flash_led_prepare(struct led_trigger *trig, int options,
int *max_current)
{
return -EINVAL;
}
#endif
#endif