2020-02-11 01:59:50 +09:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
2021-01-11 00:14:57 +09:00
|
|
|
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
|
2020-02-11 01:59:50 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LEDS_QTI_FLASH_H
|
|
|
|
#define __LEDS_QTI_FLASH_H
|
|
|
|
|
|
|
|
#include <linux/leds.h>
|
|
|
|
|
2020-03-31 00:32:32 +09:00
|
|
|
#define ENABLE_REGULATOR BIT(0)
|
|
|
|
#define DISABLE_REGULATOR BIT(1)
|
|
|
|
#define QUERY_MAX_AVAIL_CURRENT BIT(2)
|
2020-02-11 01:59:50 +09:00
|
|
|
|
2020-02-12 15:47:48 +09:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
};
|
|
|
|
|
2020-02-11 01:59:50 +09:00
|
|
|
#if IS_ENABLED(CONFIG_LEDS_QTI_FLASH)
|
|
|
|
int qti_flash_led_prepare(struct led_trigger *trig,
|
|
|
|
int options, int *max_current);
|
2020-02-12 15:47:48 +09:00
|
|
|
int qti_flash_led_set_param(struct led_trigger *trig,
|
|
|
|
struct flash_led_param param);
|
2020-02-11 01:59:50 +09:00
|
|
|
#else
|
|
|
|
static inline int qti_flash_led_prepare(struct led_trigger *trig,
|
|
|
|
int options, int *max_current)
|
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
2020-02-12 15:47:48 +09:00
|
|
|
|
|
|
|
static inline int qti_flash_led_set_param(struct led_trigger *trig,
|
2021-01-11 00:14:57 +09:00
|
|
|
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)
|
2020-02-12 15:47:48 +09:00
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
2020-02-11 01:59:50 +09:00
|
|
|
#endif
|
|
|
|
#endif
|