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