David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * ChromeOS EC multi-function device |
| 4 | * |
| 5 | * Copyright (C) 2012 Google, Inc |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __LINUX_MFD_CROS_EC_H |
| 9 | #define __LINUX_MFD_CROS_EC_H |
| 10 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 11 | #include <linux/device.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 12 | |
| 13 | /** |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 14 | * 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 Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 22 | */ |
| 23 | struct cros_ec_dev { |
| 24 | struct device class_dev; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 25 | 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 Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 35 | #endif /* __LINUX_MFD_CROS_EC_H */ |