From c7ff58f93f1f3efb7c81bf4e5ab67f6c7b85228c Mon Sep 17 00:00:00 2001 From: Chun Zhang Date: Tue, 1 Mar 2016 02:34:54 -0800 Subject: 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 Signed-off-by: Mohan Pallaka --- include/linux/leds-qpnp-flash-v2.h | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 include/linux/leds-qpnp-flash-v2.h (limited to 'include/linux') 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 +#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 -- cgit v1.2.3