1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _LINUX_VIRTIO_GPIO_H 20 #define _LINUX_VIRTIO_GPIO_H 21 #include <linux/types.h> 22 #define VIRTIO_GPIO_F_IRQ 0 23 #define VIRTIO_GPIO_MSG_GET_NAMES 0x0001 24 #define VIRTIO_GPIO_MSG_GET_DIRECTION 0x0002 25 #define VIRTIO_GPIO_MSG_SET_DIRECTION 0x0003 26 #define VIRTIO_GPIO_MSG_GET_VALUE 0x0004 27 #define VIRTIO_GPIO_MSG_SET_VALUE 0x0005 28 #define VIRTIO_GPIO_MSG_IRQ_TYPE 0x0006 29 #define VIRTIO_GPIO_STATUS_OK 0x0 30 #define VIRTIO_GPIO_STATUS_ERR 0x1 31 #define VIRTIO_GPIO_DIRECTION_NONE 0x00 32 #define VIRTIO_GPIO_DIRECTION_OUT 0x01 33 #define VIRTIO_GPIO_DIRECTION_IN 0x02 34 #define VIRTIO_GPIO_IRQ_TYPE_NONE 0x00 35 #define VIRTIO_GPIO_IRQ_TYPE_EDGE_RISING 0x01 36 #define VIRTIO_GPIO_IRQ_TYPE_EDGE_FALLING 0x02 37 #define VIRTIO_GPIO_IRQ_TYPE_EDGE_BOTH 0x03 38 #define VIRTIO_GPIO_IRQ_TYPE_LEVEL_HIGH 0x04 39 #define VIRTIO_GPIO_IRQ_TYPE_LEVEL_LOW 0x08 40 struct virtio_gpio_config { 41 __le16 ngpio; 42 __u8 padding[2]; 43 __le32 gpio_names_size; 44 }; 45 struct virtio_gpio_request { 46 __le16 type; 47 __le16 gpio; 48 __le32 value; 49 }; 50 struct virtio_gpio_response { 51 __u8 status; 52 __u8 value; 53 }; 54 struct virtio_gpio_response_get_names { 55 __u8 status; 56 __u8 value[]; 57 }; 58 struct virtio_gpio_irq_request { 59 __le16 gpio; 60 }; 61 struct virtio_gpio_irq_response { 62 __u8 status; 63 }; 64 #define VIRTIO_GPIO_IRQ_STATUS_INVALID 0x0 65 #define VIRTIO_GPIO_IRQ_STATUS_VALID 0x1 66 #endif 67