1 /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
3 * Definitions for virtio I2C Adpter
5 * Copyright (c) 2021 Intel Corporation. All rights reserved.
8 #ifndef _UAPI_LINUX_VIRTIO_I2C_H
9 #define _UAPI_LINUX_VIRTIO_I2C_H
11 #include <linux/const.h>
12 #include <linux/types.h>
14 /* Virtio I2C Feature bits */
15 #define VIRTIO_I2C_F_ZERO_LENGTH_REQUEST 0
17 /* The bit 0 of the @virtio_i2c_out_hdr.@flags, used to group the requests */
18 #define VIRTIO_I2C_FLAGS_FAIL_NEXT _BITUL(0)
20 /* The bit 1 of the @virtio_i2c_out_hdr.@flags, used to mark a buffer as read */
21 #define VIRTIO_I2C_FLAGS_M_RD _BITUL(1)
24 * struct virtio_i2c_out_hdr - the virtio I2C message OUT header
25 * @addr: the controlled device address
26 * @padding: used to pad to full dword
27 * @flags: used for feature extensibility
29 struct virtio_i2c_out_hdr {
36 * struct virtio_i2c_in_hdr - the virtio I2C message IN header
37 * @status: the processing result from the backend
39 struct virtio_i2c_in_hdr {
43 /* The final status written by the device */
44 #define VIRTIO_I2C_MSG_OK 0
45 #define VIRTIO_I2C_MSG_ERR 1
47 #endif /* _UAPI_LINUX_VIRTIO_I2C_H */