History

Merge tag 'chrome-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform

Pull chrome platform updates from Olof Johansson: "Here's a set of updates to the Chrome OS platform drivers for this merge window. Main new things this cycle is: - Driver changes to expose the lightbar to users. With this, you can make your own blinkenlights on Chromebook Pixels. - Changes in the way that the atmel_mxt trackpads are probed. The laptop driver is trying to be smart and not instantiate the devices that don't answer to probe. For the trackpad that can come up in two modes (bootloader or regular), this gets complicated since the driver already knows how to handle the two modes including the actual addresses used. So now the laptop driver needs to know more too, instantiating the regular address even if the bootloader one is the probe that passed. - mfd driver improvements by Javier Martines Canillas, and a few bugfixes from him, kbuild and myself" * tag 'chrome-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform: platform/chrome: chromeos_laptop - instantiate Atmel at primary address platform/chrome: cros_ec_lpc - Depend on X86 || COMPILE_TEST platform/chrome: cros_ec_lpc - Include linux/io.h header file platform/chrome: fix platform_no_drv_owner.cocci warnings platform/chrome: cros_ec_lightbar - fix duplicate const warning platform/chrome: cros_ec_dev - fix Unknown escape '%' warning platform/chrome: Expose Chrome OS Lightbar to users platform/chrome: Create sysfs attributes for the ChromeOS EC mfd: cros_ec: Instantiate ChromeOS EC character device platform/chrome: Add Chrome OS EC userspace device interface platform/chrome: Add cros_ec_lpc driver for x86 devices mfd: cros_ec: Add char dev and virtual dev pointers mfd: cros_ec: Use fixed size arrays to transfer data with the EC

Linus Torvalds committed 11 years ago

Commit 36a80322 parents 7f9f443 96cba9b13 files · +1384 −71Browse files

Showing the changes to include/linux (1 of 13 files). Show all

Unified · Split

include/linux/mfd/cros_ec.h+18−5
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #ifndef __LINUX_MFD_CROS_EC_H
1717 #define __LINUX_MFD_CROS_EC_H
1818
19+#include <linux/cdev.h>
1920 #include <linux/notifier.h>
2021 #include <linux/mfd/cros_ec_commands.h>
2122 #include <linux/mutex.h>
@@ -38,20 +39,20 @@ enum { · 16 unmodified lines
3839 /*
3940 * @version: Command version number (often 0)
4041 * @command: Command to send (EC_CMD_...)
41− * @outdata: Outgoing data to EC
4242 * @outsize: Outgoing length in bytes
43− * @indata: Where to put the incoming data from EC
4443 * @insize: Max number of bytes to accept from EC
4544 * @result: EC's response to the command (separate from communication failure)
45+ * @outdata: Outgoing data to EC
46+ * @indata: Where to put the incoming data from EC
4647 */
4748 struct cros_ec_command {
4849 uint32_t version;
4950 uint32_t command;
50− uint8_t *outdata;
5151 uint32_t outsize;
52− uint8_t *indata;
5352 uint32_t insize;
5453 uint32_t result;
54+ uint8_t outdata[EC_PROTO2_MAX_PARAM_SIZE];
55+ uint8_t indata[EC_PROTO2_MAX_PARAM_SIZE];
5556 };
5657
5758 /**
@@ -59,9 +60,17 @@ struct cros_ec_command { · 1 unmodified line
5960 *
6061 * @ec_name: name of EC device (e.g. 'chromeos-ec')
6162 * @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
6366 * @was_wake_device: true if this device was set to wake the system from
6467 * 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.
6574 *
6675 * @priv: Private data
6776 * @irq: Interrupt to use
@@ -90,8 +99,12 @@ struct cros_ec_device { · 22 unmodified lines
9099 const char *ec_name;
91100 const char *phys_name;
92101 struct device *dev;
102+ struct device *vdev;
103+ struct cdev cdev;
93104 bool was_wake_device;
94105 struct class *cros_class;
106+ int (*cmd_readmem)(struct cros_ec_device *ec, unsigned int offset,
107+ unsigned int bytes, void *dest);
95108
96109 /* These are used to implement the platform-specific interface */
97110 void *priv;