2 * External connector (extcon) class generic GPIO driver
4 * Copyright (C) 2012 Samsung Electronics
7 * based on switch class driver
8 * Copyright (C) 2008 Google, Inc.
11 * This software is licensed under the terms of the GNU General Public
12 * License version 2, as published by the Free Software Foundation, and
13 * may be copied, distributed, and modified under those terms.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef __EXTCON_GPIO_H__
22 #define __EXTCON_GPIO_H__ __FILE__
24 #include <linux/extcon.h>
27 * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device.
28 * @name: The name of this GPIO extcon device.
29 * @gpio: Corresponding GPIO.
30 * @gpio_active_low: Boolean describing whether gpio active state is 1 or 0
31 * If true, low state of gpio means active.
32 * If false, high state of gpio means active.
33 * @debounce: Debounce time for GPIO IRQ in ms.
34 * @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW).
35 * @state_on: print_state is overriden with state_on if attached.
36 * If NULL, default method of extcon class is used.
37 * @state_off: print_state is overriden with state_off if detached.
38 * If NUll, default method of extcon class is used.
39 * @check_on_resume: Boolean describing whether to check the state of gpio
40 * while resuming from sleep.
42 * Note that in order for state_on or state_off to be valid, both state_on
43 * and state_off should be not NULL. If at least one of them is NULL,
44 * the print_state is not overriden.
46 struct gpio_extcon_platform_data {
50 unsigned long debounce;
51 unsigned long irq_flags;
53 /* if NULL, "0" or "1" will be printed */
55 const char *state_off;
59 #endif /* __EXTCON_GPIO_H__ */