From 6820e0c51b9631fd1963386c6228725dbf3365dd Mon Sep 17 00:00:00 2001 From: Devesh Jhunjhunwala Date: Fri, 3 Jun 2016 12:27:39 -0700 Subject: leds: qpnp-flash-v2: Add support to handle ramp up and down irqs Add support to register and handle the all-ramp-up-done and all-ramp-down-done irqs for flash-led. CRs-Fixed: 921325 Change-Id: I843a008dbe6900f9f16c202a05435dbaf7a37627 Signed-off-by: Devesh Jhunjhunwala --- include/linux/leds-qpnp-flash-v2.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/linux') diff --git a/include/linux/leds-qpnp-flash-v2.h b/include/linux/leds-qpnp-flash-v2.h index 47fd0699a9c1..823b6e6646c3 100644 --- a/include/linux/leds-qpnp-flash-v2.h +++ b/include/linux/leds-qpnp-flash-v2.h @@ -19,6 +19,18 @@ #define ENABLE_REGULATOR BIT(0) #define QUERY_MAX_CURRENT BIT(1) +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_prepare(struct led_classdev *led_cdev, int options); #endif -- cgit v1.2.3 From f2509065e9a455f1fdd450177192af20d785be71 Mon Sep 17 00:00:00 2001 From: Devesh Jhunjhunwala Date: Tue, 7 Jun 2016 14:22:33 -0700 Subject: leds: qpnp-flash-v2: Create atomic notifier chain for flash irqs Create an atomic notifier call chain to notify registered clients of a flash-led irq event. CRs-Fixed: 921325 Change-Id: I218195c29fede7ae5959df8c40df0231a71de379 Signed-off-by: Devesh Jhunjhunwala --- include/linux/leds-qpnp-flash-v2.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux') diff --git a/include/linux/leds-qpnp-flash-v2.h b/include/linux/leds-qpnp-flash-v2.h index 823b6e6646c3..c8db3e0a9eac 100644 --- a/include/linux/leds-qpnp-flash-v2.h +++ b/include/linux/leds-qpnp-flash-v2.h @@ -14,6 +14,7 @@ #define __LEDS_QPNP_FLASH_V2_H #include +#include #include "leds.h" #define ENABLE_REGULATOR BIT(0) @@ -33,4 +34,7 @@ enum flash_led_irq_type { int qpnp_flash_led_prepare(struct led_classdev *led_cdev, int options); +int qpnp_flash_led_register_irq_notifier(struct notifier_block *nb); +int qpnp_flash_led_unregister_irq_notifier(struct notifier_block *nb); + #endif -- cgit v1.2.3 From dc12c73b371e11c91fa80b7d8b6eb817328890af Mon Sep 17 00:00:00 2001 From: Devesh Jhunjhunwala Date: Tue, 26 Jul 2016 16:37:28 -0700 Subject: leds: qpnp-flash-v2: Update the flash_prepare API Update the flash prepare API to accept a led_trigger device as an argument. Also split the leds-qpnp-flash-v2 header file to keep the flash_prepare API in a common header file for both legacy and v2 flash drivers. CRs-Fixed: 1043718 Change-Id: Idb4ab086740b680e101d76d882bcfb618ac4b936 Signed-off-by: Devesh Jhunjhunwala --- include/linux/leds-qpnp-flash-v2.h | 6 ------ include/linux/leds-qpnp-flash.h | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 include/linux/leds-qpnp-flash.h (limited to 'include/linux') diff --git a/include/linux/leds-qpnp-flash-v2.h b/include/linux/leds-qpnp-flash-v2.h index c8db3e0a9eac..1ae77e2e277b 100644 --- a/include/linux/leds-qpnp-flash-v2.h +++ b/include/linux/leds-qpnp-flash-v2.h @@ -15,10 +15,6 @@ #include #include -#include "leds.h" - -#define ENABLE_REGULATOR BIT(0) -#define QUERY_MAX_CURRENT BIT(1) enum flash_led_irq_type { LED_FAULT_IRQ = BIT(0), @@ -32,8 +28,6 @@ enum flash_led_irq_type { INVALID_IRQ = BIT(8), }; -int qpnp_flash_led_prepare(struct led_classdev *led_cdev, int options); - int qpnp_flash_led_register_irq_notifier(struct notifier_block *nb); int qpnp_flash_led_unregister_irq_notifier(struct notifier_block *nb); diff --git a/include/linux/leds-qpnp-flash.h b/include/linux/leds-qpnp-flash.h new file mode 100644 index 000000000000..55867e78bba6 --- /dev/null +++ b/include/linux/leds-qpnp-flash.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __LEDS_QPNP_FLASH_H +#define __LEDS_QPNP_FLASH_H + +#include + +#define ENABLE_REGULATOR BIT(0) +#define QUERY_MAX_CURRENT BIT(1) + +int qpnp_flash_led_prepare(struct led_trigger *trig, int options); + +#endif -- cgit v1.2.3