wcd-spi-ac-params.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __UAPI_WCD_SPI_AC_PARAMS_H__
  2. #define __UAPI_WCD_SPI_AC_PARAMS_H__
  3. #include <linux/types.h>
  4. #define WCD_SPI_AC_CMD_CONC_BEGIN 0x01
  5. #define WCD_SPI_AC_CMD_CONC_END 0x02
  6. #define WCD_SPI_AC_CMD_BUF_DATA 0x03
  7. #define WCD_SPI_AC_MAX_BUFFERS 2
  8. #define WCD_SPI_AC_MAX_CH_PER_BUF 8
  9. #define WCD_SPI_AC_CLIENT_CDEV_NAME "wcd-spi-ac-client"
  10. #define WCD_SPI_AC_PROCFS_DIR_NAME "wcd-spi-ac"
  11. #define WCD_SPI_AC_PROCFS_STATE_NAME "svc-state"
  12. /*
  13. * wcd_spi_ac_buf_data:
  14. * Buffer address for one buffer. Should have data
  15. * for all the channels. If channels are unused, the
  16. * value must be NULL.
  17. *
  18. * @addr:
  19. * Address where each channel of the buffer starts.
  20. */
  21. struct wcd_spi_ac_buf_data {
  22. __u32 addr[WCD_SPI_AC_MAX_CH_PER_BUF];
  23. } __packed;
  24. /*
  25. * wcd_spi_ac_write_cmd:
  26. * Data sent to the driver's write interface should
  27. * be packed in this format.
  28. *
  29. * @cmd_type:
  30. * Indicates the type of command that is sent. Should
  31. * be one of the valid commands defined with
  32. * WCD_SPI_AC_CMD_*
  33. * @payload:
  34. * No payload for:
  35. * WCD_SPI_AC_CMD_CONC_BEGIN
  36. * WCD_SPI_AC_CMD_CONC_END
  37. * Upto WCD_SPI_AC_MAX_BUFFERS of type
  38. * struct wcd_spi_ac_buf_data for:
  39. * WCD_SPI_AC_CMD_BUF_DATA
  40. */
  41. struct wcd_spi_ac_write_cmd {
  42. __u32 cmd_type;
  43. __u8 payload[0];
  44. } __packed;
  45. #endif /* end of __UAPI_WCD_SPI_AC_PARAMS_H__ */