1 /* SPDX-License-Identifier: GPL-2.0 */
3 * ChromeOS EC device interface.
5 * Copyright (C) 2014 Google, Inc.
8 #ifndef _UAPI_LINUX_CROS_EC_DEV_H_
9 #define _UAPI_LINUX_CROS_EC_DEV_H_
11 #include <linux/bits.h>
12 #include <linux/ioctl.h>
13 #include <linux/types.h>
15 #include <linux/platform_data/cros_ec_commands.h>
17 #define CROS_EC_DEV_VERSION "1.0.0"
20 * struct cros_ec_readmem - Struct used to read mapped memory.
21 * @offset: Within EC_LPC_ADDR_MEMMAP region.
22 * @bytes: Number of bytes to read. Zero means "read a string" (including '\0')
23 * At most only EC_MEMMAP_SIZE bytes can be read.
24 * @buffer: Where to store the result. The ioctl returns the number of bytes
25 * read or negative on error.
27 struct cros_ec_readmem {
30 uint8_t buffer[EC_MEMMAP_SIZE];
33 #define CROS_EC_DEV_IOC 0xEC
34 #define CROS_EC_DEV_IOCXCMD _IOWR(CROS_EC_DEV_IOC, 0, struct cros_ec_command)
35 #define CROS_EC_DEV_IOCRDMEM _IOWR(CROS_EC_DEV_IOC, 1, struct cros_ec_readmem)
36 #define CROS_EC_DEV_IOCEVENTMASK _IO(CROS_EC_DEV_IOC, 2)
38 #endif /* _CROS_EC_DEV_H_ */