Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6aab13b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "leds: qpnp-flash-v2: Convert power_supply properties to iio"

parents c493a193 fce85e0b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -247,6 +247,17 @@ config LEDS_QTI_FLASH
	  To compile this driver as a module, choose M here: the
	  module will be called leds-qti-flash.

config LEDS_QPNP_FLASH_V2
	tristate "Support for QPNP V2 Flash LEDs"
	depends on LEDS_CLASS && MFD_SPMI_PMIC
	select LEDS_TRIGGERS
	help
	  This driver supports the flash V2 LED functionality of Qualcomm
	  Technologies, Inc. QPNP PMICs.  This driver supports PMICs starting
	  from PMI8998, PM8150L and their derivatives.  It can configure the
	  flash LED target current for several independent channels.  It also
	  supports various over current and over temperature mitigation features.

config LEDS_FSG
	tristate "LED Support for the Freecom FSG-3"
	depends on LEDS_CLASS
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ obj-$(CONFIG_LEDS_TI_LMU_COMMON) += leds-ti-lmu-common.o
obj-$(CONFIG_LEDS_LM3697)		+= leds-lm3697.o
obj-$(CONFIG_LEDS_LM36274)		+= leds-lm36274.o
obj-$(CONFIG_LEDS_QTI_TRI_LED)		+= leds-qti-tri-led.o
obj-$(CONFIG_LEDS_QPNP_FLASH_V2)        += leds-qpnp-flash-v2.o
obj-$(CONFIG_LEDS_QPNP_VIBRATOR_LDO)	+= leds-qpnp-vibrator-ldo.o

# LED SPI Drivers
+3116 −0

File added.

Preview size limit exceeded, changes collapsed.

+27 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016, 2020, The Linux Foundation. All rights reserved.
 */

#ifndef __LEDS_QPNP_FLASH_V2_H
#define __LEDS_QPNP_FLASH_V2_H

#include <linux/leds.h>
#include <linux/notifier.h>

enum flash_led_irq_type {
	LED_FAULT_IRQ = BIT(0),
	MITIGATION_IRQ = BIT(1),
	FLASH_TIMER_EXP_IRQ = BIT(2),
	ALL_RAMP_DOWN_DONE_IRQ = BIT(3),
	ALL_RAMP_UP_DONE_IRQ = BIT(4),
	LED3_RAMP_UP_DONE_IRQ = BIT(5),
	LED2_RAMP_UP_DONE_IRQ = BIT(6),
	LED1_RAMP_UP_DONE_IRQ = BIT(7),
	INVALID_IRQ = BIT(8),
};

int qpnp_flash_led_register_irq_notifier(struct notifier_block *nb);
int qpnp_flash_led_unregister_irq_notifier(struct notifier_block *nb);

#endif
+42 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#ifndef __LEDS_QPNP_FLASH_H
#define __LEDS_QPNP_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)

#define FLASH_LED_PREPARE_OPTIONS_MASK	GENMASK(3, 0)

int qpnp_flash_register_led_prepare(struct device *dev, void *data);

#if IS_ENABLED(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

#ifdef 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