mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
ecf8a6cd94
The entire way how cros sysfs attibutes are created is broken. cros_ec_lightbar should be its own driver and its attributes should be associated with a lightbar driver not the mfd driver. In order to retain the path, the lightbar attributes are attached to the cros_class. The patch also adds the sysfs documentation. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
48 lines
1.6 KiB
C
48 lines
1.6 KiB
C
/*
|
|
* cros_ec_dev - expose the Chrome OS Embedded Controller to userspace
|
|
*
|
|
* Copyright (C) 2014 Google, Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef _CROS_EC_DEV_H_
|
|
#define _CROS_EC_DEV_H_
|
|
|
|
#include <linux/ioctl.h>
|
|
#include <linux/types.h>
|
|
#include <linux/mfd/cros_ec.h>
|
|
|
|
#define CROS_EC_DEV_VERSION "1.0.0"
|
|
|
|
/**
|
|
* struct cros_ec_readmem - Struct used to read mapped memory.
|
|
* @offset: Within EC_LPC_ADDR_MEMMAP region.
|
|
* @bytes: Number of bytes to read. Zero means "read a string" (including '\0')
|
|
* At most only EC_MEMMAP_SIZE bytes can be read.
|
|
* @buffer: Where to store the result. The ioctl returns the number of bytes
|
|
* read or negative on error.
|
|
*/
|
|
struct cros_ec_readmem {
|
|
uint32_t offset;
|
|
uint32_t bytes;
|
|
uint8_t buffer[EC_MEMMAP_SIZE];
|
|
};
|
|
|
|
#define CROS_EC_DEV_IOC 0xEC
|
|
#define CROS_EC_DEV_IOCXCMD _IOWR(CROS_EC_DEV_IOC, 0, struct cros_ec_command)
|
|
#define CROS_EC_DEV_IOCRDMEM _IOWR(CROS_EC_DEV_IOC, 1, struct cros_ec_readmem)
|
|
|
|
#endif /* _CROS_EC_DEV_H_ */
|