|
@@ -63,9 +63,10 @@ struct cros_ec_command {
|
|
* @was_wake_device: true if this device was set to wake the system from
|
|
* @was_wake_device: true if this device was set to wake the system from
|
|
* sleep at the last suspend
|
|
* sleep at the last suspend
|
|
* @event_notifier: interrupt event notifier for transport devices
|
|
* @event_notifier: interrupt event notifier for transport devices
|
|
- * @command_send: send a command
|
|
|
|
- * @command_recv: receive a response
|
|
|
|
- * @command_sendrecv: send a command and receive a response
|
|
|
|
|
|
+ * @cmd_xfer: send command to EC and get response
|
|
|
|
+ * Returns 0 if the communication succeeded, but that doesn't mean the EC
|
|
|
|
+ * was happy with the command it got. Caller should check msg.result for
|
|
|
|
+ * the EC's result code.
|
|
*
|
|
*
|
|
* @priv: Private data
|
|
* @priv: Private data
|
|
* @irq: Interrupt to use
|
|
* @irq: Interrupt to use
|
|
@@ -83,7 +84,6 @@ struct cros_ec_command {
|
|
* @parent: pointer to parent device (e.g. i2c or spi device)
|
|
* @parent: pointer to parent device (e.g. i2c or spi device)
|
|
* @wake_enabled: true if this device can wake the system from sleep
|
|
* @wake_enabled: true if this device can wake the system from sleep
|
|
* @lock: one transaction at a time
|
|
* @lock: one transaction at a time
|
|
- * @cmd_xfer: low-level channel to the EC
|
|
|
|
*/
|
|
*/
|
|
struct cros_ec_device {
|
|
struct cros_ec_device {
|
|
|
|
|
|
@@ -94,13 +94,8 @@ struct cros_ec_device {
|
|
bool was_wake_device;
|
|
bool was_wake_device;
|
|
struct class *cros_class;
|
|
struct class *cros_class;
|
|
struct blocking_notifier_head event_notifier;
|
|
struct blocking_notifier_head event_notifier;
|
|
- int (*command_send)(struct cros_ec_device *ec,
|
|
|
|
- uint16_t cmd, void *out_buf, int out_len);
|
|
|
|
- int (*command_recv)(struct cros_ec_device *ec,
|
|
|
|
- uint16_t cmd, void *in_buf, int in_len);
|
|
|
|
- int (*command_sendrecv)(struct cros_ec_device *ec,
|
|
|
|
- uint16_t cmd, void *out_buf, int out_len,
|
|
|
|
- void *in_buf, int in_len);
|
|
|
|
|
|
+ int (*cmd_xfer)(struct cros_ec_device *ec,
|
|
|
|
+ struct cros_ec_command *msg);
|
|
|
|
|
|
/* These are used to implement the platform-specific interface */
|
|
/* These are used to implement the platform-specific interface */
|
|
void *priv;
|
|
void *priv;
|
|
@@ -112,8 +107,6 @@ struct cros_ec_device {
|
|
struct device *parent;
|
|
struct device *parent;
|
|
bool wake_enabled;
|
|
bool wake_enabled;
|
|
struct mutex lock;
|
|
struct mutex lock;
|
|
- int (*cmd_xfer)(struct cros_ec_device *ec,
|
|
|
|
- struct cros_ec_command *msg);
|
|
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|