Merge tag 'batadv-next-pullrequest-20210312' of git://git.open-mesh.org/linux-merge
[linux-2.6-microblaze.git] / include / uapi / linux / gpio.h
1 /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2 /*
3  * <linux/gpio.h> - userspace ABI for the GPIO character devices
4  *
5  * Copyright (C) 2016 Linus Walleij
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License version 2 as published by
9  * the Free Software Foundation.
10  */
11 #ifndef _UAPI_GPIO_H_
12 #define _UAPI_GPIO_H_
13
14 #include <linux/const.h>
15 #include <linux/ioctl.h>
16 #include <linux/types.h>
17
18 /*
19  * The maximum size of name and label arrays.
20  *
21  * Must be a multiple of 8 to ensure 32/64-bit alignment of structs.
22  */
23 #define GPIO_MAX_NAME_SIZE 32
24
25 /**
26  * struct gpiochip_info - Information about a certain GPIO chip
27  * @name: the Linux kernel name of this GPIO chip
28  * @label: a functional name for this GPIO chip, such as a product
29  * number, may be empty (i.e. label[0] == '\0')
30  * @lines: number of GPIO lines on this chip
31  */
32 struct gpiochip_info {
33         char name[GPIO_MAX_NAME_SIZE];
34         char label[GPIO_MAX_NAME_SIZE];
35         __u32 lines;
36 };
37
38 /*
39  * Maximum number of requested lines.
40  *
41  * Must be no greater than 64, as bitmaps are restricted here to 64-bits
42  * for simplicity, and a multiple of 2 to ensure 32/64-bit alignment of
43  * structs.
44  */
45 #define GPIO_V2_LINES_MAX 64
46
47 /*
48  * The maximum number of configuration attributes associated with a line
49  * request.
50  */
51 #define GPIO_V2_LINE_NUM_ATTRS_MAX 10
52
53 /**
54  * enum gpio_v2_line_flag - &struct gpio_v2_line_attribute.flags values
55  * @GPIO_V2_LINE_FLAG_USED: line is not available for request
56  * @GPIO_V2_LINE_FLAG_ACTIVE_LOW: line active state is physical low
57  * @GPIO_V2_LINE_FLAG_INPUT: line is an input
58  * @GPIO_V2_LINE_FLAG_OUTPUT: line is an output
59  * @GPIO_V2_LINE_FLAG_EDGE_RISING: line detects rising (inactive to active)
60  * edges
61  * @GPIO_V2_LINE_FLAG_EDGE_FALLING: line detects falling (active to
62  * inactive) edges
63  * @GPIO_V2_LINE_FLAG_OPEN_DRAIN: line is an open drain output
64  * @GPIO_V2_LINE_FLAG_OPEN_SOURCE: line is an open source output
65  * @GPIO_V2_LINE_FLAG_BIAS_PULL_UP: line has pull-up bias enabled
66  * @GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN: line has pull-down bias enabled
67  * @GPIO_V2_LINE_FLAG_BIAS_DISABLED: line has bias disabled
68  * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME: line events contain REALTIME timestamps
69  */
70 enum gpio_v2_line_flag {
71         GPIO_V2_LINE_FLAG_USED                  = _BITULL(0),
72         GPIO_V2_LINE_FLAG_ACTIVE_LOW            = _BITULL(1),
73         GPIO_V2_LINE_FLAG_INPUT                 = _BITULL(2),
74         GPIO_V2_LINE_FLAG_OUTPUT                = _BITULL(3),
75         GPIO_V2_LINE_FLAG_EDGE_RISING           = _BITULL(4),
76         GPIO_V2_LINE_FLAG_EDGE_FALLING          = _BITULL(5),
77         GPIO_V2_LINE_FLAG_OPEN_DRAIN            = _BITULL(6),
78         GPIO_V2_LINE_FLAG_OPEN_SOURCE           = _BITULL(7),
79         GPIO_V2_LINE_FLAG_BIAS_PULL_UP          = _BITULL(8),
80         GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN        = _BITULL(9),
81         GPIO_V2_LINE_FLAG_BIAS_DISABLED         = _BITULL(10),
82         GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME  = _BITULL(11),
83 };
84
85 /**
86  * struct gpio_v2_line_values - Values of GPIO lines
87  * @bits: a bitmap containing the value of the lines, set to 1 for active
88  * and 0 for inactive.
89  * @mask: a bitmap identifying the lines to get or set, with each bit
90  * number corresponding to the index into &struct
91  * gpio_v2_line_request.offsets.
92  */
93 struct gpio_v2_line_values {
94         __aligned_u64 bits;
95         __aligned_u64 mask;
96 };
97
98 /**
99  * enum gpio_v2_line_attr_id - &struct gpio_v2_line_attribute.id values
100  * identifying which field of the attribute union is in use.
101  * @GPIO_V2_LINE_ATTR_ID_FLAGS: flags field is in use
102  * @GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES: values field is in use
103  * @GPIO_V2_LINE_ATTR_ID_DEBOUNCE: debounce_period_us field is in use
104  */
105 enum gpio_v2_line_attr_id {
106         GPIO_V2_LINE_ATTR_ID_FLAGS              = 1,
107         GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES      = 2,
108         GPIO_V2_LINE_ATTR_ID_DEBOUNCE           = 3,
109 };
110
111 /**
112  * struct gpio_v2_line_attribute - a configurable attribute of a line
113  * @id: attribute identifier with value from &enum gpio_v2_line_attr_id
114  * @padding: reserved for future use and must be zero filled
115  * @flags: if id is %GPIO_V2_LINE_ATTR_ID_FLAGS, the flags for the GPIO
116  * line, with values from &enum gpio_v2_line_flag, such as
117  * %GPIO_V2_LINE_FLAG_ACTIVE_LOW, %GPIO_V2_LINE_FLAG_OUTPUT etc, added
118  * together.  This overrides the default flags contained in the &struct
119  * gpio_v2_line_config for the associated line.
120  * @values: if id is %GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES, a bitmap
121  * containing the values to which the lines will be set, with each bit
122  * number corresponding to the index into &struct
123  * gpio_v2_line_request.offsets.
124  * @debounce_period_us: if id is %GPIO_V2_LINE_ATTR_ID_DEBOUNCE, the
125  * desired debounce period, in microseconds
126  */
127 struct gpio_v2_line_attribute {
128         __u32 id;
129         __u32 padding;
130         union {
131                 __aligned_u64 flags;
132                 __aligned_u64 values;
133                 __u32 debounce_period_us;
134         };
135 };
136
137 /**
138  * struct gpio_v2_line_config_attribute - a configuration attribute
139  * associated with one or more of the requested lines.
140  * @attr: the configurable attribute
141  * @mask: a bitmap identifying the lines to which the attribute applies,
142  * with each bit number corresponding to the index into &struct
143  * gpio_v2_line_request.offsets.
144  */
145 struct gpio_v2_line_config_attribute {
146         struct gpio_v2_line_attribute attr;
147         __aligned_u64 mask;
148 };
149
150 /**
151  * struct gpio_v2_line_config - Configuration for GPIO lines
152  * @flags: flags for the GPIO lines, with values from &enum
153  * gpio_v2_line_flag, such as %GPIO_V2_LINE_FLAG_ACTIVE_LOW,
154  * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together.  This is the default for
155  * all requested lines but may be overridden for particular lines using
156  * @attrs.
157  * @num_attrs: the number of attributes in @attrs
158  * @padding: reserved for future use and must be zero filled
159  * @attrs: the configuration attributes associated with the requested
160  * lines.  Any attribute should only be associated with a particular line
161  * once.  If an attribute is associated with a line multiple times then the
162  * first occurrence (i.e. lowest index) has precedence.
163  */
164 struct gpio_v2_line_config {
165         __aligned_u64 flags;
166         __u32 num_attrs;
167         /* Pad to fill implicit padding and reserve space for future use. */
168         __u32 padding[5];
169         struct gpio_v2_line_config_attribute attrs[GPIO_V2_LINE_NUM_ATTRS_MAX];
170 };
171
172 /**
173  * struct gpio_v2_line_request - Information about a request for GPIO lines
174  * @offsets: an array of desired lines, specified by offset index for the
175  * associated GPIO chip
176  * @consumer: a desired consumer label for the selected GPIO lines such as
177  * "my-bitbanged-relay"
178  * @config: requested configuration for the lines.
179  * @num_lines: number of lines requested in this request, i.e. the number
180  * of valid fields in the %GPIO_V2_LINES_MAX sized arrays, set to 1 to
181  * request a single line
182  * @event_buffer_size: a suggested minimum number of line events that the
183  * kernel should buffer.  This is only relevant if edge detection is
184  * enabled in the configuration. Note that this is only a suggested value
185  * and the kernel may allocate a larger buffer or cap the size of the
186  * buffer. If this field is zero then the buffer size defaults to a minimum
187  * of @num_lines * 16.
188  * @padding: reserved for future use and must be zero filled
189  * @fd: if successful this field will contain a valid anonymous file handle
190  * after a %GPIO_GET_LINE_IOCTL operation, zero or negative value means
191  * error
192  */
193 struct gpio_v2_line_request {
194         __u32 offsets[GPIO_V2_LINES_MAX];
195         char consumer[GPIO_MAX_NAME_SIZE];
196         struct gpio_v2_line_config config;
197         __u32 num_lines;
198         __u32 event_buffer_size;
199         /* Pad to fill implicit padding and reserve space for future use. */
200         __u32 padding[5];
201         __s32 fd;
202 };
203
204 /**
205  * struct gpio_v2_line_info - Information about a certain GPIO line
206  * @name: the name of this GPIO line, such as the output pin of the line on
207  * the chip, a rail or a pin header name on a board, as specified by the
208  * GPIO chip, may be empty (i.e. name[0] == '\0')
209  * @consumer: a functional name for the consumer of this GPIO line as set
210  * by whatever is using it, will be empty if there is no current user but
211  * may also be empty if the consumer doesn't set this up
212  * @offset: the local offset on this GPIO chip, fill this in when
213  * requesting the line information from the kernel
214  * @num_attrs: the number of attributes in @attrs
215  * @flags: flags for this GPIO line, with values from &enum
216  * gpio_v2_line_flag, such as %GPIO_V2_LINE_FLAG_ACTIVE_LOW,
217  * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together.
218  * @attrs: the configuration attributes associated with the line
219  * @padding: reserved for future use
220  */
221 struct gpio_v2_line_info {
222         char name[GPIO_MAX_NAME_SIZE];
223         char consumer[GPIO_MAX_NAME_SIZE];
224         __u32 offset;
225         __u32 num_attrs;
226         __aligned_u64 flags;
227         struct gpio_v2_line_attribute attrs[GPIO_V2_LINE_NUM_ATTRS_MAX];
228         /* Space reserved for future use. */
229         __u32 padding[4];
230 };
231
232 /**
233  * enum gpio_v2_line_changed_type - &struct gpio_v2_line_changed.event_type
234  * values
235  * @GPIO_V2_LINE_CHANGED_REQUESTED: line has been requested
236  * @GPIO_V2_LINE_CHANGED_RELEASED: line has been released
237  * @GPIO_V2_LINE_CHANGED_CONFIG: line has been reconfigured
238  */
239 enum gpio_v2_line_changed_type {
240         GPIO_V2_LINE_CHANGED_REQUESTED  = 1,
241         GPIO_V2_LINE_CHANGED_RELEASED   = 2,
242         GPIO_V2_LINE_CHANGED_CONFIG     = 3,
243 };
244
245 /**
246  * struct gpio_v2_line_info_changed - Information about a change in status
247  * of a GPIO line
248  * @info: updated line information
249  * @timestamp_ns: estimate of time of status change occurrence, in nanoseconds
250  * @event_type: the type of change with a value from &enum
251  * gpio_v2_line_changed_type
252  * @padding: reserved for future use
253  */
254 struct gpio_v2_line_info_changed {
255         struct gpio_v2_line_info info;
256         __aligned_u64 timestamp_ns;
257         __u32 event_type;
258         /* Pad struct to 64-bit boundary and reserve space for future use. */
259         __u32 padding[5];
260 };
261
262 /**
263  * enum gpio_v2_line_event_id - &struct gpio_v2_line_event.id values
264  * @GPIO_V2_LINE_EVENT_RISING_EDGE: event triggered by a rising edge
265  * @GPIO_V2_LINE_EVENT_FALLING_EDGE: event triggered by a falling edge
266  */
267 enum gpio_v2_line_event_id {
268         GPIO_V2_LINE_EVENT_RISING_EDGE  = 1,
269         GPIO_V2_LINE_EVENT_FALLING_EDGE = 2,
270 };
271
272 /**
273  * struct gpio_v2_line_event - The actual event being pushed to userspace
274  * @timestamp_ns: best estimate of time of event occurrence, in nanoseconds.
275  * @id: event identifier with value from &enum gpio_v2_line_event_id
276  * @offset: the offset of the line that triggered the event
277  * @seqno: the sequence number for this event in the sequence of events for
278  * all the lines in this line request
279  * @line_seqno: the sequence number for this event in the sequence of
280  * events on this particular line
281  * @padding: reserved for future use
282  *
283  * By default the @timestamp_ns is read from %CLOCK_MONOTONIC and is
284  * intended to allow the accurate measurement of the time between events.
285  * It does not provide the wall-clock time.
286  *
287  * If the %GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME flag is set then the
288  * @timestamp_ns is read from %CLOCK_REALTIME.
289  */
290 struct gpio_v2_line_event {
291         __aligned_u64 timestamp_ns;
292         __u32 id;
293         __u32 offset;
294         __u32 seqno;
295         __u32 line_seqno;
296         /* Space reserved for future use. */
297         __u32 padding[6];
298 };
299
300 /*
301  * ABI v1
302  *
303  * This version of the ABI is deprecated.
304  * Use the latest version of the ABI, defined above, instead.
305  */
306
307 /* Informational flags */
308 #define GPIOLINE_FLAG_KERNEL            (1UL << 0) /* Line used by the kernel */
309 #define GPIOLINE_FLAG_IS_OUT            (1UL << 1)
310 #define GPIOLINE_FLAG_ACTIVE_LOW        (1UL << 2)
311 #define GPIOLINE_FLAG_OPEN_DRAIN        (1UL << 3)
312 #define GPIOLINE_FLAG_OPEN_SOURCE       (1UL << 4)
313 #define GPIOLINE_FLAG_BIAS_PULL_UP      (1UL << 5)
314 #define GPIOLINE_FLAG_BIAS_PULL_DOWN    (1UL << 6)
315 #define GPIOLINE_FLAG_BIAS_DISABLE      (1UL << 7)
316
317 /**
318  * struct gpioline_info - Information about a certain GPIO line
319  * @line_offset: the local offset on this GPIO device, fill this in when
320  * requesting the line information from the kernel
321  * @flags: various flags for this line
322  * @name: the name of this GPIO line, such as the output pin of the line on the
323  * chip, a rail or a pin header name on a board, as specified by the gpio
324  * chip, may be empty (i.e. name[0] == '\0')
325  * @consumer: a functional name for the consumer of this GPIO line as set by
326  * whatever is using it, will be empty if there is no current user but may
327  * also be empty if the consumer doesn't set this up
328  *
329  * Note: This struct is part of ABI v1 and is deprecated.
330  * Use &struct gpio_v2_line_info instead.
331  */
332 struct gpioline_info {
333         __u32 line_offset;
334         __u32 flags;
335         char name[GPIO_MAX_NAME_SIZE];
336         char consumer[GPIO_MAX_NAME_SIZE];
337 };
338
339 /* Maximum number of requested handles */
340 #define GPIOHANDLES_MAX 64
341
342 /* Possible line status change events */
343 enum {
344         GPIOLINE_CHANGED_REQUESTED = 1,
345         GPIOLINE_CHANGED_RELEASED,
346         GPIOLINE_CHANGED_CONFIG,
347 };
348
349 /**
350  * struct gpioline_info_changed - Information about a change in status
351  * of a GPIO line
352  * @info: updated line information
353  * @timestamp: estimate of time of status change occurrence, in nanoseconds
354  * @event_type: one of %GPIOLINE_CHANGED_REQUESTED,
355  * %GPIOLINE_CHANGED_RELEASED and %GPIOLINE_CHANGED_CONFIG
356  * @padding: reserved for future use
357  *
358  * The &struct gpioline_info embedded here has 32-bit alignment on its own,
359  * but it works fine with 64-bit alignment too. With its 72 byte size, we can
360  * guarantee there are no implicit holes between it and subsequent members.
361  * The 20-byte padding at the end makes sure we don't add any implicit padding
362  * at the end of the structure on 64-bit architectures.
363  *
364  * Note: This struct is part of ABI v1 and is deprecated.
365  * Use &struct gpio_v2_line_info_changed instead.
366  */
367 struct gpioline_info_changed {
368         struct gpioline_info info;
369         __u64 timestamp;
370         __u32 event_type;
371         __u32 padding[5]; /* for future use */
372 };
373
374 /* Linerequest flags */
375 #define GPIOHANDLE_REQUEST_INPUT        (1UL << 0)
376 #define GPIOHANDLE_REQUEST_OUTPUT       (1UL << 1)
377 #define GPIOHANDLE_REQUEST_ACTIVE_LOW   (1UL << 2)
378 #define GPIOHANDLE_REQUEST_OPEN_DRAIN   (1UL << 3)
379 #define GPIOHANDLE_REQUEST_OPEN_SOURCE  (1UL << 4)
380 #define GPIOHANDLE_REQUEST_BIAS_PULL_UP (1UL << 5)
381 #define GPIOHANDLE_REQUEST_BIAS_PULL_DOWN       (1UL << 6)
382 #define GPIOHANDLE_REQUEST_BIAS_DISABLE (1UL << 7)
383
384 /**
385  * struct gpiohandle_request - Information about a GPIO handle request
386  * @lineoffsets: an array of desired lines, specified by offset index for the
387  * associated GPIO device
388  * @flags: desired flags for the desired GPIO lines, such as
389  * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added
390  * together. Note that even if multiple lines are requested, the same flags
391  * must be applicable to all of them, if you want lines with individual
392  * flags set, request them one by one. It is possible to select
393  * a batch of input or output lines, but they must all have the same
394  * characteristics, i.e. all inputs or all outputs, all active low etc
395  * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested
396  * line, this specifies the default output value, should be 0 (low) or
397  * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
398  * @consumer_label: a desired consumer label for the selected GPIO line(s)
399  * such as "my-bitbanged-relay"
400  * @lines: number of lines requested in this request, i.e. the number of
401  * valid fields in the above arrays, set to 1 to request a single line
402  * @fd: if successful this field will contain a valid anonymous file handle
403  * after a %GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value
404  * means error
405  *
406  * Note: This struct is part of ABI v1 and is deprecated.
407  * Use &struct gpio_v2_line_request instead.
408  */
409 struct gpiohandle_request {
410         __u32 lineoffsets[GPIOHANDLES_MAX];
411         __u32 flags;
412         __u8 default_values[GPIOHANDLES_MAX];
413         char consumer_label[GPIO_MAX_NAME_SIZE];
414         __u32 lines;
415         int fd;
416 };
417
418 /**
419  * struct gpiohandle_config - Configuration for a GPIO handle request
420  * @flags: updated flags for the requested GPIO lines, such as
421  * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added
422  * together
423  * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags,
424  * this specifies the default output value, should be 0 (low) or
425  * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
426  * @padding: reserved for future use and should be zero filled
427  *
428  * Note: This struct is part of ABI v1 and is deprecated.
429  * Use &struct gpio_v2_line_config instead.
430  */
431 struct gpiohandle_config {
432         __u32 flags;
433         __u8 default_values[GPIOHANDLES_MAX];
434         __u32 padding[4]; /* padding for future use */
435 };
436
437 /**
438  * struct gpiohandle_data - Information of values on a GPIO handle
439  * @values: when getting the state of lines this contains the current
440  * state of a line, when setting the state of lines these should contain
441  * the desired target state
442  *
443  * Note: This struct is part of ABI v1 and is deprecated.
444  * Use &struct gpio_v2_line_values instead.
445  */
446 struct gpiohandle_data {
447         __u8 values[GPIOHANDLES_MAX];
448 };
449
450 /* Eventrequest flags */
451 #define GPIOEVENT_REQUEST_RISING_EDGE   (1UL << 0)
452 #define GPIOEVENT_REQUEST_FALLING_EDGE  (1UL << 1)
453 #define GPIOEVENT_REQUEST_BOTH_EDGES    ((1UL << 0) | (1UL << 1))
454
455 /**
456  * struct gpioevent_request - Information about a GPIO event request
457  * @lineoffset: the desired line to subscribe to events from, specified by
458  * offset index for the associated GPIO device
459  * @handleflags: desired handle flags for the desired GPIO line, such as
460  * %GPIOHANDLE_REQUEST_ACTIVE_LOW or %GPIOHANDLE_REQUEST_OPEN_DRAIN
461  * @eventflags: desired flags for the desired GPIO event line, such as
462  * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE
463  * @consumer_label: a desired consumer label for the selected GPIO line(s)
464  * such as "my-listener"
465  * @fd: if successful this field will contain a valid anonymous file handle
466  * after a %GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value
467  * means error
468  *
469  * Note: This struct is part of ABI v1 and is deprecated.
470  * Use &struct gpio_v2_line_request instead.
471  */
472 struct gpioevent_request {
473         __u32 lineoffset;
474         __u32 handleflags;
475         __u32 eventflags;
476         char consumer_label[GPIO_MAX_NAME_SIZE];
477         int fd;
478 };
479
480 /*
481  * GPIO event types
482  */
483 #define GPIOEVENT_EVENT_RISING_EDGE 0x01
484 #define GPIOEVENT_EVENT_FALLING_EDGE 0x02
485
486 /**
487  * struct gpioevent_data - The actual event being pushed to userspace
488  * @timestamp: best estimate of time of event occurrence, in nanoseconds
489  * @id: event identifier
490  *
491  * Note: This struct is part of ABI v1 and is deprecated.
492  * Use &struct gpio_v2_line_event instead.
493  */
494 struct gpioevent_data {
495         __u64 timestamp;
496         __u32 id;
497 };
498
499 /*
500  * v1 and v2 ioctl()s
501  */
502 #define GPIO_GET_CHIPINFO_IOCTL _IOR(0xB4, 0x01, struct gpiochip_info)
503 #define GPIO_GET_LINEINFO_UNWATCH_IOCTL _IOWR(0xB4, 0x0C, __u32)
504
505 /*
506  * v2 ioctl()s
507  */
508 #define GPIO_V2_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x05, struct gpio_v2_line_info)
509 #define GPIO_V2_GET_LINEINFO_WATCH_IOCTL _IOWR(0xB4, 0x06, struct gpio_v2_line_info)
510 #define GPIO_V2_GET_LINE_IOCTL _IOWR(0xB4, 0x07, struct gpio_v2_line_request)
511 #define GPIO_V2_LINE_SET_CONFIG_IOCTL _IOWR(0xB4, 0x0D, struct gpio_v2_line_config)
512 #define GPIO_V2_LINE_GET_VALUES_IOCTL _IOWR(0xB4, 0x0E, struct gpio_v2_line_values)
513 #define GPIO_V2_LINE_SET_VALUES_IOCTL _IOWR(0xB4, 0x0F, struct gpio_v2_line_values)
514
515 /*
516  * v1 ioctl()s
517  *
518  * These ioctl()s are deprecated.  Use the v2 equivalent instead.
519  */
520 #define GPIO_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x02, struct gpioline_info)
521 #define GPIO_GET_LINEHANDLE_IOCTL _IOWR(0xB4, 0x03, struct gpiohandle_request)
522 #define GPIO_GET_LINEEVENT_IOCTL _IOWR(0xB4, 0x04, struct gpioevent_request)
523 #define GPIOHANDLE_GET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x08, struct gpiohandle_data)
524 #define GPIOHANDLE_SET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x09, struct gpiohandle_data)
525 #define GPIOHANDLE_SET_CONFIG_IOCTL _IOWR(0xB4, 0x0A, struct gpiohandle_config)
526 #define GPIO_GET_LINEINFO_WATCH_IOCTL _IOWR(0xB4, 0x0B, struct gpioline_info)
527
528 #endif /* _UAPI_GPIO_H_ */