Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * ChromeOS EC device interface.
0004  *
0005  * Copyright (C) 2014 Google, Inc.
0006  */
0007 
0008 #ifndef _UAPI_LINUX_CROS_EC_DEV_H_
0009 #define _UAPI_LINUX_CROS_EC_DEV_H_
0010 
0011 #include <linux/bits.h>
0012 #include <linux/ioctl.h>
0013 #include <linux/types.h>
0014 
0015 #include <linux/platform_data/cros_ec_commands.h>
0016 
0017 #define CROS_EC_DEV_VERSION "1.0.0"
0018 
0019 /**
0020  * struct cros_ec_readmem - Struct used to read mapped memory.
0021  * @offset: Within EC_LPC_ADDR_MEMMAP region.
0022  * @bytes: Number of bytes to read. Zero means "read a string" (including '\0')
0023  *         At most only EC_MEMMAP_SIZE bytes can be read.
0024  * @buffer: Where to store the result. The ioctl returns the number of bytes
0025  *         read or negative on error.
0026  */
0027 struct cros_ec_readmem {
0028     uint32_t offset;
0029     uint32_t bytes;
0030     uint8_t buffer[EC_MEMMAP_SIZE];
0031 };
0032 
0033 #define CROS_EC_DEV_IOC       0xEC
0034 #define CROS_EC_DEV_IOCXCMD   _IOWR(CROS_EC_DEV_IOC, 0, struct cros_ec_command)
0035 #define CROS_EC_DEV_IOCRDMEM  _IOWR(CROS_EC_DEV_IOC, 1, struct cros_ec_readmem)
0036 #define CROS_EC_DEV_IOCEVENTMASK _IO(CROS_EC_DEV_IOC, 2)
0037 
0038 #endif /* _CROS_EC_DEV_H_ */