Skip to content

Commit 4f14063

Browse files
Prashant MalaniEnric Balletbo i Serra
authored andcommitted
platform/chrome: cros_ec_proto: Add version for ec_command
Add a version parameter to cros_ec_command() for callers that may want to specify which version of the host command they would like to use. Signed-off-by: Prashant Malani <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5d12225 commit 4f14063

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

drivers/platform/chrome/cros_ec_proto.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count);
915915
* cros_ec_command - Send a command to the EC.
916916
*
917917
* @ec_dev: EC device
918+
* @version: EC command version
918919
* @command: EC command
919920
* @outdata: EC command output data
920921
* @outsize: Size of outdata
@@ -924,6 +925,7 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count);
924925
* Return: >= 0 on success, negative error number on failure.
925926
*/
926927
int cros_ec_command(struct cros_ec_device *ec_dev,
928+
unsigned int version,
927929
int command,
928930
void *outdata,
929931
int outsize,
@@ -937,6 +939,7 @@ int cros_ec_command(struct cros_ec_device *ec_dev,
937939
if (!msg)
938940
return -ENOMEM;
939941

942+
msg->version = version;
940943
msg->command = command;
941944
msg->outsize = outsize;
942945
msg->insize = insize;

drivers/platform/chrome/cros_usbpd_notify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void cros_usbpd_get_event_and_notify(struct device *dev,
7171
}
7272

7373
/* Check for PD host events on EC. */
74-
ret = cros_ec_command(ec_dev, EC_CMD_PD_HOST_EVENT_STATUS,
74+
ret = cros_ec_command(ec_dev, 0, EC_CMD_PD_HOST_EVENT_STATUS,
7575
NULL, 0, &host_event_status, sizeof(host_event_status));
7676
if (ret < 0) {
7777
dev_warn(dev, "Can't get host event status (err: %d)\n", ret);

include/linux/platform_data/cros_ec_proto.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature);
231231

232232
int cros_ec_get_sensor_count(struct cros_ec_dev *ec);
233233

234-
int cros_ec_command(struct cros_ec_device *ec_dev, int command, void *outdata, int outsize,
235-
void *indata, int insize);
234+
int cros_ec_command(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata,
235+
int outsize, void *indata, int insize);
236236

237237
/**
238238
* cros_ec_get_time_ns() - Return time in ns.

0 commit comments

Comments
 (0)