| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * include/linux/uio_driver.h |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com> |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * Userspace IO driver. |
|---|
| 10 | | - * |
|---|
| 11 | | - * Licensed under the GPLv2 only. |
|---|
| 12 | 11 | */ |
|---|
| 13 | 12 | |
|---|
| 14 | 13 | #ifndef _UIO_DRIVER_H_ |
|---|
| .. | .. |
|---|
| 17 | 16 | #include <linux/device.h> |
|---|
| 18 | 17 | #include <linux/fs.h> |
|---|
| 19 | 18 | #include <linux/interrupt.h> |
|---|
| 19 | +#include <linux/android_kabi.h> |
|---|
| 20 | 20 | |
|---|
| 21 | 21 | struct module; |
|---|
| 22 | 22 | struct uio_map; |
|---|
| .. | .. |
|---|
| 25 | 25 | * struct uio_mem - description of a UIO memory region |
|---|
| 26 | 26 | * @name: name of the memory region for identification |
|---|
| 27 | 27 | * @addr: address of the device's memory rounded to page |
|---|
| 28 | | - * size (phys_addr is used since addr can be |
|---|
| 29 | | - * logical, virtual, or physical & phys_addr_t |
|---|
| 30 | | - * should always be large enough to handle any of |
|---|
| 31 | | - * the address types) |
|---|
| 28 | + * size (phys_addr is used since addr can be |
|---|
| 29 | + * logical, virtual, or physical & phys_addr_t |
|---|
| 30 | + * should always be large enough to handle any of |
|---|
| 31 | + * the address types) |
|---|
| 32 | 32 | * @offs: offset of device memory within the page |
|---|
| 33 | 33 | * @size: size of IO (multiple of page size) |
|---|
| 34 | 34 | * @memtype: type of memory addr points to |
|---|
| .. | .. |
|---|
| 68 | 68 | #define MAX_UIO_PORT_REGIONS 5 |
|---|
| 69 | 69 | |
|---|
| 70 | 70 | struct uio_device { |
|---|
| 71 | | - struct module *owner; |
|---|
| 71 | + struct module *owner; |
|---|
| 72 | 72 | struct device dev; |
|---|
| 73 | | - int minor; |
|---|
| 74 | | - atomic_t event; |
|---|
| 75 | | - struct fasync_struct *async_queue; |
|---|
| 76 | | - wait_queue_head_t wait; |
|---|
| 77 | | - struct uio_info *info; |
|---|
| 73 | + int minor; |
|---|
| 74 | + atomic_t event; |
|---|
| 75 | + struct fasync_struct *async_queue; |
|---|
| 76 | + wait_queue_head_t wait; |
|---|
| 77 | + struct uio_info *info; |
|---|
| 78 | 78 | struct mutex info_lock; |
|---|
| 79 | | - struct kobject *map_dir; |
|---|
| 80 | | - struct kobject *portio_dir; |
|---|
| 79 | + struct kobject *map_dir; |
|---|
| 80 | + struct kobject *portio_dir; |
|---|
| 81 | + |
|---|
| 82 | + ANDROID_KABI_RESERVE(1); |
|---|
| 81 | 83 | }; |
|---|
| 82 | 84 | |
|---|
| 83 | 85 | /** |
|---|
| .. | .. |
|---|
| 110 | 112 | int (*open)(struct uio_info *info, struct inode *inode); |
|---|
| 111 | 113 | int (*release)(struct uio_info *info, struct inode *inode); |
|---|
| 112 | 114 | int (*irqcontrol)(struct uio_info *info, s32 irq_on); |
|---|
| 115 | + ANDROID_KABI_RESERVE(1); |
|---|
| 113 | 116 | }; |
|---|
| 114 | 117 | |
|---|
| 115 | 118 | extern int __must_check |
|---|
| .. | .. |
|---|
| 124 | 127 | extern void uio_unregister_device(struct uio_info *info); |
|---|
| 125 | 128 | extern void uio_event_notify(struct uio_info *info); |
|---|
| 126 | 129 | |
|---|
| 130 | +extern int __must_check |
|---|
| 131 | + __devm_uio_register_device(struct module *owner, |
|---|
| 132 | + struct device *parent, |
|---|
| 133 | + struct uio_info *info); |
|---|
| 134 | + |
|---|
| 135 | +/* use a define to avoid include chaining to get THIS_MODULE */ |
|---|
| 136 | +#define devm_uio_register_device(parent, info) \ |
|---|
| 137 | + __devm_uio_register_device(THIS_MODULE, parent, info) |
|---|
| 138 | + |
|---|
| 127 | 139 | /* defines for uio_info->irq */ |
|---|
| 128 | 140 | #define UIO_IRQ_CUSTOM -1 |
|---|
| 129 | 141 | #define UIO_IRQ_NONE 0 |
|---|
| .. | .. |
|---|
| 133 | 145 | #define UIO_MEM_PHYS 1 |
|---|
| 134 | 146 | #define UIO_MEM_LOGICAL 2 |
|---|
| 135 | 147 | #define UIO_MEM_VIRTUAL 3 |
|---|
| 148 | +#define UIO_MEM_IOVA 4 |
|---|
| 136 | 149 | |
|---|
| 137 | 150 | /* defines for uio_port->porttype */ |
|---|
| 138 | 151 | #define UIO_PORT_NONE 0 |
|---|