blob: 61c2875c2a407099514410e8f1d6e1306722af42 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-only */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * ChromeOS EC multi-function device
4 *
5 * Copyright (C) 2012 Google, Inc
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00006 */
7
8#ifndef __LINUX_MFD_CROS_EC_H
9#define __LINUX_MFD_CROS_EC_H
10
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000011#include <linux/device.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000012
13/**
David Brazdil0f672f62019-12-10 10:32:29 +000014 * struct cros_ec_dev - ChromeOS EC device entry point.
15 * @class_dev: Device structure used in sysfs.
16 * @ec_dev: cros_ec_device structure to talk to the physical device.
17 * @dev: Pointer to the platform device.
18 * @debug_info: cros_ec_debugfs structure for debugging information.
19 * @has_kb_wake_angle: True if at least 2 accelerometer are connected to the EC.
20 * @cmd_offset: Offset to apply for each command.
21 * @features: Features supported by the EC.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000022 */
23struct cros_ec_dev {
24 struct device class_dev;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000025 struct cros_ec_device *ec_dev;
26 struct device *dev;
27 struct cros_ec_debugfs *debug_info;
28 bool has_kb_wake_angle;
29 u16 cmd_offset;
30 u32 features[2];
31};
32
33#define to_cros_ec_dev(dev) container_of(dev, struct cros_ec_dev, class_dev)
34
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000035#endif /* __LINUX_MFD_CROS_EC_H */