MyungJoo Ham | be48308 | 2012-04-20 14:16:23 +0900 | [diff] [blame] | 1 | /* |
Chanwoo Choi | 6ba1299 | 2015-09-29 22:59:55 +0900 | [diff] [blame] | 2 | * Single-state GPIO extcon driver based on extcon class |
MyungJoo Ham | be48308 | 2012-04-20 14:16:23 +0900 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2012 Samsung Electronics |
| 5 | * Author: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 6 | * |
| 7 | * based on switch class driver |
| 8 | * Copyright (C) 2008 Google, Inc. |
| 9 | * Author: Mike Lockwood <lockwood@android.com> |
| 10 | * |
| 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. |
| 14 | * |
| 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. |
Chanwoo Choi | 6ba1299 | 2015-09-29 22:59:55 +0900 | [diff] [blame] | 19 | */ |
MyungJoo Ham | be48308 | 2012-04-20 14:16:23 +0900 | [diff] [blame] | 20 | #ifndef __EXTCON_GPIO_H__ |
| 21 | #define __EXTCON_GPIO_H__ __FILE__ |
| 22 | |
| 23 | #include <linux/extcon.h> |
| 24 | |
| 25 | /** |
Chanwoo Choi | 6ba1299 | 2015-09-29 22:59:55 +0900 | [diff] [blame] | 26 | * struct gpio_extcon_pdata - A simple GPIO-controlled extcon device. |
Chanwoo Choi | ce6f749 | 2015-09-29 22:57:24 +0900 | [diff] [blame] | 27 | * @extcon_id: The unique id of specific external connector. |
Chanwoo Choi | a75e1c7 | 2013-08-31 13:16:49 +0900 | [diff] [blame] | 28 | * @gpio: Corresponding GPIO. |
Guenter Roeck | 5bfbdc9 | 2013-09-12 08:49:54 +0900 | [diff] [blame] | 29 | * @gpio_active_low: Boolean describing whether gpio active state is 1 or 0 |
| 30 | * If true, low state of gpio means active. |
| 31 | * If false, high state of gpio means active. |
Chanwoo Choi | a75e1c7 | 2013-08-31 13:16:49 +0900 | [diff] [blame] | 32 | * @debounce: Debounce time for GPIO IRQ in ms. |
| 33 | * @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW). |
George Cherian | 6236435 | 2014-09-09 09:44:34 +0530 | [diff] [blame] | 34 | * @check_on_resume: Boolean describing whether to check the state of gpio |
| 35 | * while resuming from sleep. |
MyungJoo Ham | be48308 | 2012-04-20 14:16:23 +0900 | [diff] [blame] | 36 | */ |
Chanwoo Choi | 6ba1299 | 2015-09-29 22:59:55 +0900 | [diff] [blame] | 37 | struct gpio_extcon_pdata { |
Chanwoo Choi | ce6f749 | 2015-09-29 22:57:24 +0900 | [diff] [blame] | 38 | unsigned int extcon_id; |
MyungJoo Ham | be48308 | 2012-04-20 14:16:23 +0900 | [diff] [blame] | 39 | unsigned gpio; |
Guenter Roeck | 5bfbdc9 | 2013-09-12 08:49:54 +0900 | [diff] [blame] | 40 | bool gpio_active_low; |
MyungJoo Ham | be48308 | 2012-04-20 14:16:23 +0900 | [diff] [blame] | 41 | unsigned long debounce; |
| 42 | unsigned long irq_flags; |
| 43 | |
Rongjun Ying | 6544dfa | 2014-01-09 09:50:13 +0900 | [diff] [blame] | 44 | bool check_on_resume; |
MyungJoo Ham | be48308 | 2012-04-20 14:16:23 +0900 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | #endif /* __EXTCON_GPIO_H__ */ |