• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
2 /*
3  * Definitions for virtio I2C Adpter
4  *
5  * Copyright (c) 2021 Intel Corporation. All rights reserved.
6  */
7 
8 #ifndef _UAPI_LINUX_VIRTIO_I2C_H
9 #define _UAPI_LINUX_VIRTIO_I2C_H
10 
11 #include <linux/const.h>
12 #include <linux/types.h>
13 
14 /* The bit 0 of the @virtio_i2c_out_hdr.@flags, used to group the requests */
15 #define VIRTIO_I2C_FLAGS_FAIL_NEXT	_BITUL(0)
16 
17 /**
18  * struct virtio_i2c_out_hdr - the virtio I2C message OUT header
19  * @addr: the controlled device address
20  * @padding: used to pad to full dword
21  * @flags: used for feature extensibility
22  */
23 struct virtio_i2c_out_hdr {
24 	__le16 addr;
25 	__le16 padding;
26 	__le32 flags;
27 };
28 
29 /**
30  * struct virtio_i2c_in_hdr - the virtio I2C message IN header
31  * @status: the processing result from the backend
32  */
33 struct virtio_i2c_in_hdr {
34 	__u8 status;
35 };
36 
37 /* The final status written by the device */
38 #define VIRTIO_I2C_MSG_OK	0
39 #define VIRTIO_I2C_MSG_ERR	1
40 
41 #endif /* _UAPI_LINUX_VIRTIO_I2C_H */
42