1 /* 2 * include/linux/gpio_detection.h 3 * 4 * Platform data structure for GPIO detection driver 5 * 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. 9 */ 10 #ifndef __GPIO_DETECTION_H 11 #define __GPIO_DETECTION_H 12 13 #define GPIO_EVENT 1 14 15 /* 16 * gpio event 17 * @val: 0 event active, 1 event over 18 * @name: event name 19 */ 20 21 struct gpio_event { 22 int val; 23 const char *name; 24 }; 25 26 #if IS_ENABLED(CONFIG_GPIO_DET) 27 28 int gpio_det_register_notifier(struct notifier_block *nb); 29 int gpio_det_unregister_notifier(struct notifier_block *nb); 30 int gpio_det_notifier_call_chain(unsigned long val, void *v); 31 32 #else 33 gpio_det_register_notifier(struct notifier_block * nb)34static inline int gpio_det_register_notifier(struct notifier_block *nb) 35 { 36 return -EINVAL; 37 }; 38 gpio_det_unregister_notifier(struct notifier_block * nb)39static inline int gpio_det_unregister_notifier(struct notifier_block *nb) 40 { 41 return -EINVAL; 42 }; 43 gpio_det_notifier_call_chain(unsigned long val,void * v)44static inline int gpio_det_notifier_call_chain(unsigned long val, void *v) 45 { 46 return -EINVAL; 47 }; 48 49 #endif 50 51 #endif 52