summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChun Zhang <chunz@codeaurora.org>2016-03-01 02:34:54 -0800
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-11 17:44:05 -0700
commitc7ff58f93f1f3efb7c81bf4e5ab67f6c7b85228c (patch)
treea1e40e09a2239aeef516dd8cc2c094c348fc0b59 /include/linux
parent9be27fb6e74eed5ffbdbb4f0a934c56072fa9b15 (diff)
leds: leds-qpnp-flash-v2: create v2 QPNP flash LED driver
There is a new Qualcomm Technology Inc. Plug-n-play(QPNP) PMIC chip, which introduces brand new flash LED hardware. The new hardware comes with up to 3 LEDs support, different register mapping layout, and different torch enablement requirement. Therefore, a new driver is introduced to cover this need. Change-Id: Ic878f1a946955edff3a9228e7fe54b7a525e37b1 Signed-off-by: Chun Zhang <chunz@codeaurora.org> Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/leds-qpnp-flash-v2.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/leds-qpnp-flash-v2.h b/include/linux/leds-qpnp-flash-v2.h
new file mode 100644
index 000000000000..353466f6c108
--- /dev/null
+++ b/include/linux/leds-qpnp-flash-v2.h
@@ -0,0 +1,44 @@
+/* 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. 1
+ */
+
+#ifndef __LEDS_QPNP_FLASH_V2_H
+#define __LEDS_QPNP_FLASH_V2_H
+
+#include <linux/leds.h>
+#include "leds.h"
+
+/*
+ * Configurations for each individual LED
+ */
+struct flash_node_data {
+ struct platform_device *pdev;
+ struct led_classdev cdev;
+ struct pinctrl *pinctrl;
+ struct pinctrl_state *gpio_state_active;
+ struct pinctrl_state *gpio_state_suspend;
+ int ires_ua;
+ u16 prgm_current;
+ u8 duration;
+ u8 id;
+ u8 type;
+ u8 ires;
+ u8 hdrm_val;
+ u8 brightness;
+ bool led_on;
+};
+
+struct flash_switch_data {
+ struct platform_device *pdev;
+ struct led_classdev cdev;
+};
+
+#endif