Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
0002 /*
0003  * Definitions for virtio I2C Adpter
0004  *
0005  * Copyright (c) 2021 Intel Corporation. All rights reserved.
0006  */
0007 
0008 #ifndef _UAPI_LINUX_VIRTIO_I2C_H
0009 #define _UAPI_LINUX_VIRTIO_I2C_H
0010 
0011 #include <linux/const.h>
0012 #include <linux/types.h>
0013 
0014 /* Virtio I2C Feature bits */
0015 #define VIRTIO_I2C_F_ZERO_LENGTH_REQUEST    0
0016 
0017 /* The bit 0 of the @virtio_i2c_out_hdr.@flags, used to group the requests */
0018 #define VIRTIO_I2C_FLAGS_FAIL_NEXT  _BITUL(0)
0019 
0020 /* The bit 1 of the @virtio_i2c_out_hdr.@flags, used to mark a buffer as read */
0021 #define VIRTIO_I2C_FLAGS_M_RD       _BITUL(1)
0022 
0023 /**
0024  * struct virtio_i2c_out_hdr - the virtio I2C message OUT header
0025  * @addr: the controlled device address
0026  * @padding: used to pad to full dword
0027  * @flags: used for feature extensibility
0028  */
0029 struct virtio_i2c_out_hdr {
0030     __le16 addr;
0031     __le16 padding;
0032     __le32 flags;
0033 };
0034 
0035 /**
0036  * struct virtio_i2c_in_hdr - the virtio I2C message IN header
0037  * @status: the processing result from the backend
0038  */
0039 struct virtio_i2c_in_hdr {
0040     __u8 status;
0041 };
0042 
0043 /* The final status written by the device */
0044 #define VIRTIO_I2C_MSG_OK   0
0045 #define VIRTIO_I2C_MSG_ERR  1
0046 
0047 #endif /* _UAPI_LINUX_VIRTIO_I2C_H */