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

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

Merge "leds: qpnp-flash-v2: Add support for QPNP flash v2 LED driver"

parents 1470e206 c388c4f1
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -756,6 +756,17 @@ config LEDS_NIC78BX
	  To compile this driver as a module, choose M here: the module
	  will be called leds-nic78bx.

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.

comment "LED Triggers"
source "drivers/leds/trigger/Kconfig"

+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ obj-$(CONFIG_LEDS_MT6323) += leds-mt6323.o
obj-$(CONFIG_LEDS_LM3692X)		+= leds-lm3692x.o
obj-$(CONFIG_LEDS_SC27XX_BLTC)		+= leds-sc27xx-bltc.o
obj-$(CONFIG_LEDS_LM3601X)		+= leds-lm3601x.o
obj-$(CONFIG_LEDS_QPNP_FLASH_V2)        += leds-qpnp-flash-v2.o

# LED SPI Drivers
obj-$(CONFIG_LEDS_CR0014114)		+= leds-cr0014114.o
+2670 −0

File added.

Preview size limit exceeded, changes collapsed.

+16 −0
Original line number Diff line number Diff line
@@ -21,6 +21,22 @@ static inline int led_get_brightness(struct led_classdev *led_cdev)
	return led_cdev->brightness;
}

static inline struct led_classdev *trigger_to_lcdev(struct led_trigger *trig)
{
	struct led_classdev *led_cdev;

	read_lock(&trig->leddev_list_lock);
	list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) {
		if (!strcmp(led_cdev->default_trigger, trig->name)) {
			read_unlock(&trig->leddev_list_lock);
			return led_cdev;
		}
	}

	read_unlock(&trig->leddev_list_lock);
	return NULL;
}

void led_init_core(struct led_classdev *led_cdev);
void led_stop_software_blink(struct led_classdev *led_cdev);
void led_set_brightness_nopm(struct led_classdev *led_cdev,
+27 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2016, 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
Loading