blob: e3b9cf148cbdbc4d9e6d53c8a57a7cefb72d1b93 [file] [log] [blame]
Kiran Gundabf1e6c02018-01-17 17:50:20 +05301/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
David Collins8885f792017-01-26 14:36:34 -08002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __LEDS_QPNP_FLASH_H
14#define __LEDS_QPNP_FLASH_H
15
16#include <linux/leds.h>
17
18#define ENABLE_REGULATOR BIT(0)
19#define DISABLE_REGULATOR BIT(1)
20#define QUERY_MAX_CURRENT BIT(2)
David Collins8885f792017-01-26 14:36:34 -080021
22#define FLASH_LED_PREPARE_OPTIONS_MASK GENMASK(3, 0)
23
Kiran Gundabf1e6c02018-01-17 17:50:20 +053024#if (defined CONFIG_LEDS_QPNP_FLASH || defined CONFIG_LEDS_QPNP_FLASH_V2)
25extern int (*qpnp_flash_led_prepare)(struct led_trigger *trig, int options,
David Collins8885f792017-01-26 14:36:34 -080026 int *max_current);
Kiran Gundabf1e6c02018-01-17 17:50:20 +053027#else
28static inline int qpnp_flash_led_prepare(struct led_trigger *trig, int options,
29 int *max_current)
30{
31 return -ENODEV;
32}
33#endif
David Collins8885f792017-01-26 14:36:34 -080034#endif