diff options
author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2015-02-02 06:26:23 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2015-02-26 18:44:58 -0500 |
commit | 05c11ac4e0712def44cccbff82ad980d9e1d1b80 (patch) | |
tree | 6248dfb959a449f8e096f655297e03b11f64b656 | |
parent | 1b84f2a4cd4a6f517a313261f6f7c8caae5696c6 (diff) |
mfd: cros_ec: Add char dev and virtual dev pointers
The ChromeOS Embedded Controller has to be accessed by applications.
A virtual character device is used as an interface with user-space.
Extend the struct cros_ec_device with the fields needed by the driver
of this virtual character device.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Acked-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | include/linux/mfd/cros_ec.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h index 71675b14b5ca..324a34683971 100644 --- a/include/linux/mfd/cros_ec.h +++ b/include/linux/mfd/cros_ec.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #ifndef __LINUX_MFD_CROS_EC_H | 16 | #ifndef __LINUX_MFD_CROS_EC_H |
17 | #define __LINUX_MFD_CROS_EC_H | 17 | #define __LINUX_MFD_CROS_EC_H |
18 | 18 | ||
19 | #include <linux/cdev.h> | ||
19 | #include <linux/notifier.h> | 20 | #include <linux/notifier.h> |
20 | #include <linux/mfd/cros_ec_commands.h> | 21 | #include <linux/mfd/cros_ec_commands.h> |
21 | #include <linux/mutex.h> | 22 | #include <linux/mutex.h> |
@@ -59,9 +60,17 @@ struct cros_ec_command { | |||
59 | * | 60 | * |
60 | * @ec_name: name of EC device (e.g. 'chromeos-ec') | 61 | * @ec_name: name of EC device (e.g. 'chromeos-ec') |
61 | * @phys_name: name of physical comms layer (e.g. 'i2c-4') | 62 | * @phys_name: name of physical comms layer (e.g. 'i2c-4') |
62 | * @dev: Device pointer | 63 | * @dev: Device pointer for physical comms device |
64 | * @vdev: Device pointer for virtual comms device | ||
65 | * @cdev: Character device structure for virtual comms device | ||
63 | * @was_wake_device: true if this device was set to wake the system from | 66 | * @was_wake_device: true if this device was set to wake the system from |
64 | * sleep at the last suspend | 67 | * sleep at the last suspend |
68 | * @cmd_readmem: direct read of the EC memory-mapped region, if supported | ||
69 | * @offset is within EC_LPC_ADDR_MEMMAP region. | ||
70 | * @bytes: number of bytes to read. zero means "read a string" (including | ||
71 | * the trailing '\0'). At most only EC_MEMMAP_SIZE bytes can be read. | ||
72 | * Caller must ensure that the buffer is large enough for the result when | ||
73 | * reading a string. | ||
65 | * | 74 | * |
66 | * @priv: Private data | 75 | * @priv: Private data |
67 | * @irq: Interrupt to use | 76 | * @irq: Interrupt to use |
@@ -90,8 +99,12 @@ struct cros_ec_device { | |||
90 | const char *ec_name; | 99 | const char *ec_name; |
91 | const char *phys_name; | 100 | const char *phys_name; |
92 | struct device *dev; | 101 | struct device *dev; |
102 | struct device *vdev; | ||
103 | struct cdev cdev; | ||
93 | bool was_wake_device; | 104 | bool was_wake_device; |
94 | struct class *cros_class; | 105 | struct class *cros_class; |
106 | int (*cmd_readmem)(struct cros_ec_device *ec, unsigned int offset, | ||
107 | unsigned int bytes, void *dest); | ||
95 | 108 | ||
96 | /* These are used to implement the platform-specific interface */ | 109 | /* These are used to implement the platform-specific interface */ |
97 | void *priv; | 110 | void *priv; |