Merge "leds: qti-flash: Support zero duration for flash safety timer"

This commit is contained in:
qctecmdr 2022-06-07 23:38:10 -07:00 committed by Gerrit - the friendly Code Review server
commit 832a93f1cf
4 changed files with 1820 additions and 0 deletions

View File

@ -552,6 +552,21 @@ config LEDS_PWM
help
This option enables support for pwm driven LEDs
config LEDS_QTI_FLASH
tristate "Support for QTI Flash LEDs"
depends on LEDS_CLASS_FLASH
depends on MFD_SPMI_PMIC
select LEDS_TRIGGERS
help
This driver supports flash LED peripheral that is present on
some Qualcomm Technologies, Inc. PMICs (e.g. PM8350C). It can
configure the flash LED target current for several independent
channels. It also supports various over current and over
temperature mitigation features.
To compile this driver as a module, choose M here: the
module will be called leds-qti-flash.
config LEDS_REGULATOR
tristate "REGULATOR driven LED support"
depends on LEDS_CLASS

View File

@ -73,6 +73,7 @@ obj-$(CONFIG_LEDS_PCA963X) += leds-pca963x.o
obj-$(CONFIG_LEDS_PM8058) += leds-pm8058.o
obj-$(CONFIG_LEDS_POWERNV) += leds-powernv.o
obj-$(CONFIG_LEDS_PWM) += leds-pwm.o
obj-$(CONFIG_LEDS_QTI_FLASH) += leds-qti-flash.o
obj-$(CONFIG_LEDS_REGULATOR) += leds-regulator.o
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
obj-$(CONFIG_LEDS_SC27XX_BLTC) += leds-sc27xx-bltc.o

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
/* 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)
/**
* 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
#endif