i3cdev.h 840 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2019 Synopsys, Inc. and/or its affiliates.
  4. *
  5. * Author: Vitor Soares <vitor.soares@synopsys.com>
  6. */
  7. #ifndef _UAPI_I3C_DEV_H_
  8. #define _UAPI_I3C_DEV_H_
  9. #include <linux/types.h>
  10. #include <linux/ioctl.h>
  11. #define VERSION "0.2"
  12. /* IOCTL commands */
  13. #define I3C_DEV_IOC_MAGIC 0x07
  14. enum i3c_error_code {
  15. I3C_ERROR_UNKNOWN = 0,
  16. I3C_ERROR_M0 = 1,
  17. I3C_ERROR_M1,
  18. I3C_ERROR_M2,
  19. };
  20. struct i3c_priv_xfer {
  21. char rnw;
  22. uint16_t len;
  23. union {
  24. void *in;
  25. const void *out;
  26. } data;
  27. enum i3c_error_code err;
  28. };
  29. struct i3c_ioc_priv_xfer {
  30. struct i3c_priv_xfer *xfers; /* pointers to i3c_priv_xfer */
  31. __u32 nxfers; /* number of i3c_priv_xfer */
  32. };
  33. #define I3C_IOC_PRIV_XFER \
  34. _IOWR(I3C_DEV_IOC_MAGIC, 30, struct i3c_ioc_priv_xfer)
  35. #define I3C_IOC_PRIV_XFER_MAX_MSGS 42
  36. #endif