Commit b1d288d9 authored by Prashant Malani's avatar Prashant Malani Committed by Tzung-Bi Shih

platform/chrome: cros_ec_proto: Rename cros_ec_command function

cros_ec_command() is the name of a function as well as a struct, as such
it can confuse indexing tools (like ctags). Avoid this by renaming it to
cros_ec_cmd(). Update all the callsites to use the new name.

This patch is a find-and-replace, so should not introduce any functional
changes.
Suggested-by: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarPrashant Malani <pmalani@chromium.org>
Acked-by: default avatarLee Jones <lee.jones@linaro.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220606201825.763788-3-pmalani@chromium.org
parent 015cd004
...@@ -250,7 +250,7 @@ static int ec_device_probe(struct platform_device *pdev) ...@@ -250,7 +250,7 @@ static int ec_device_probe(struct platform_device *pdev)
* The PCHG device cannot be detected by sending EC_FEATURE_GET_CMD, but * The PCHG device cannot be detected by sending EC_FEATURE_GET_CMD, but
* it can be detected by querying the number of peripheral chargers. * it can be detected by querying the number of peripheral chargers.
*/ */
retval = cros_ec_command(ec->ec_dev, 0, EC_CMD_PCHG_COUNT, NULL, 0, retval = cros_ec_cmd(ec->ec_dev, 0, EC_CMD_PCHG_COUNT, NULL, 0,
&pchg_count, sizeof(pchg_count)); &pchg_count, sizeof(pchg_count));
if (retval >= 0 && pchg_count.port_count) { if (retval >= 0 && pchg_count.port_count) {
retval = mfd_add_hotplug_devices(ec->dev, retval = mfd_add_hotplug_devices(ec->dev,
......
...@@ -860,7 +860,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature) ...@@ -860,7 +860,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature)
if (features->flags[0] == -1U && features->flags[1] == -1U) { if (features->flags[0] == -1U && features->flags[1] == -1U) {
/* features bitmap not read yet */ /* features bitmap not read yet */
ret = cros_ec_command(ec->ec_dev, 0, EC_CMD_GET_FEATURES + ec->cmd_offset, ret = cros_ec_cmd(ec->ec_dev, 0, EC_CMD_GET_FEATURES + ec->cmd_offset,
NULL, 0, features, sizeof(*features)); NULL, 0, features, sizeof(*features));
if (ret < 0) { if (ret < 0) {
dev_warn(ec->dev, "cannot get EC features: %d\n", ret); dev_warn(ec->dev, "cannot get EC features: %d\n", ret);
...@@ -942,7 +942,7 @@ int cros_ec_get_sensor_count(struct cros_ec_dev *ec) ...@@ -942,7 +942,7 @@ int cros_ec_get_sensor_count(struct cros_ec_dev *ec)
EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count); EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count);
/** /**
* cros_ec_command - Send a command to the EC. * cros_ec_cmd - Send a command to the EC.
* *
* @ec_dev: EC device * @ec_dev: EC device
* @version: EC command version * @version: EC command version
...@@ -954,7 +954,7 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count); ...@@ -954,7 +954,7 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count);
* *
* Return: >= 0 on success, negative error number on failure. * Return: >= 0 on success, negative error number on failure.
*/ */
int cros_ec_command(struct cros_ec_device *ec_dev, int cros_ec_cmd(struct cros_ec_device *ec_dev,
unsigned int version, unsigned int version,
int command, int command,
void *outdata, void *outdata,
...@@ -987,4 +987,4 @@ int cros_ec_command(struct cros_ec_device *ec_dev, ...@@ -987,4 +987,4 @@ int cros_ec_command(struct cros_ec_device *ec_dev,
kfree(msg); kfree(msg);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(cros_ec_command); EXPORT_SYMBOL_GPL(cros_ec_cmd);
...@@ -525,7 +525,7 @@ static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num, ...@@ -525,7 +525,7 @@ static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num,
enum typec_orientation orientation; enum typec_orientation orientation;
int ret; int ret;
ret = cros_ec_command(typec->ec, 0, EC_CMD_USB_PD_MUX_INFO, ret = cros_ec_cmd(typec->ec, 0, EC_CMD_USB_PD_MUX_INFO,
&req, sizeof(req), &resp, sizeof(resp)); &req, sizeof(req), &resp, sizeof(resp));
if (ret < 0) { if (ret < 0) {
dev_warn(typec->dev, "Failed to get mux info for port: %d, err = %d\n", dev_warn(typec->dev, "Failed to get mux info for port: %d, err = %d\n",
...@@ -585,7 +585,7 @@ static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num, ...@@ -585,7 +585,7 @@ static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num,
/* Sending Acknowledgment to EC */ /* Sending Acknowledgment to EC */
mux_ack.port = port_num; mux_ack.port = port_num;
if (cros_ec_command(typec->ec, 0, EC_CMD_USB_PD_MUX_ACK, &mux_ack, if (cros_ec_cmd(typec->ec, 0, EC_CMD_USB_PD_MUX_ACK, &mux_ack,
sizeof(mux_ack), NULL, 0) < 0) sizeof(mux_ack), NULL, 0) < 0)
dev_warn(typec->dev, dev_warn(typec->dev,
"Failed to send Mux ACK to EC for port: %d\n", "Failed to send Mux ACK to EC for port: %d\n",
...@@ -754,7 +754,7 @@ static int cros_typec_handle_sop_prime_disc(struct cros_typec_data *typec, int p ...@@ -754,7 +754,7 @@ static int cros_typec_handle_sop_prime_disc(struct cros_typec_data *typec, int p
int ret = 0; int ret = 0;
memset(disc, 0, EC_PROTO2_MAX_RESPONSE_SIZE); memset(disc, 0, EC_PROTO2_MAX_RESPONSE_SIZE);
ret = cros_ec_command(typec->ec, 0, EC_CMD_TYPEC_DISCOVERY, &req, sizeof(req), ret = cros_ec_cmd(typec->ec, 0, EC_CMD_TYPEC_DISCOVERY, &req, sizeof(req),
disc, EC_PROTO2_MAX_RESPONSE_SIZE); disc, EC_PROTO2_MAX_RESPONSE_SIZE);
if (ret < 0) { if (ret < 0) {
dev_err(typec->dev, "Failed to get SOP' discovery data for port: %d\n", port_num); dev_err(typec->dev, "Failed to get SOP' discovery data for port: %d\n", port_num);
...@@ -837,7 +837,7 @@ static int cros_typec_handle_sop_disc(struct cros_typec_data *typec, int port_nu ...@@ -837,7 +837,7 @@ static int cros_typec_handle_sop_disc(struct cros_typec_data *typec, int port_nu
typec_partner_set_pd_revision(port->partner, pd_revision); typec_partner_set_pd_revision(port->partner, pd_revision);
memset(sop_disc, 0, EC_PROTO2_MAX_RESPONSE_SIZE); memset(sop_disc, 0, EC_PROTO2_MAX_RESPONSE_SIZE);
ret = cros_ec_command(typec->ec, 0, EC_CMD_TYPEC_DISCOVERY, &req, sizeof(req), ret = cros_ec_cmd(typec->ec, 0, EC_CMD_TYPEC_DISCOVERY, &req, sizeof(req),
sop_disc, EC_PROTO2_MAX_RESPONSE_SIZE); sop_disc, EC_PROTO2_MAX_RESPONSE_SIZE);
if (ret < 0) { if (ret < 0) {
dev_err(typec->dev, "Failed to get SOP discovery data for port: %d\n", port_num); dev_err(typec->dev, "Failed to get SOP discovery data for port: %d\n", port_num);
...@@ -870,7 +870,7 @@ static int cros_typec_send_clear_event(struct cros_typec_data *typec, int port_n ...@@ -870,7 +870,7 @@ static int cros_typec_send_clear_event(struct cros_typec_data *typec, int port_n
.clear_events_mask = events_mask, .clear_events_mask = events_mask,
}; };
return cros_ec_command(typec->ec, 0, EC_CMD_TYPEC_CONTROL, &req, return cros_ec_cmd(typec->ec, 0, EC_CMD_TYPEC_CONTROL, &req,
sizeof(req), NULL, 0); sizeof(req), NULL, 0);
} }
...@@ -882,7 +882,7 @@ static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num ...@@ -882,7 +882,7 @@ static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num
}; };
int ret; int ret;
ret = cros_ec_command(typec->ec, 0, EC_CMD_TYPEC_STATUS, &req, sizeof(req), ret = cros_ec_cmd(typec->ec, 0, EC_CMD_TYPEC_STATUS, &req, sizeof(req),
&resp, sizeof(resp)); &resp, sizeof(resp));
if (ret < 0) { if (ret < 0) {
dev_warn(typec->dev, "EC_CMD_TYPEC_STATUS failed for port: %d\n", port_num); dev_warn(typec->dev, "EC_CMD_TYPEC_STATUS failed for port: %d\n", port_num);
...@@ -960,7 +960,7 @@ static int cros_typec_port_update(struct cros_typec_data *typec, int port_num) ...@@ -960,7 +960,7 @@ static int cros_typec_port_update(struct cros_typec_data *typec, int port_num)
req.mux = USB_PD_CTRL_MUX_NO_CHANGE; req.mux = USB_PD_CTRL_MUX_NO_CHANGE;
req.swap = USB_PD_CTRL_SWAP_NONE; req.swap = USB_PD_CTRL_SWAP_NONE;
ret = cros_ec_command(typec->ec, typec->pd_ctrl_ver, ret = cros_ec_cmd(typec->ec, typec->pd_ctrl_ver,
EC_CMD_USB_PD_CONTROL, &req, sizeof(req), EC_CMD_USB_PD_CONTROL, &req, sizeof(req),
&resp, sizeof(resp)); &resp, sizeof(resp));
if (ret < 0) if (ret < 0)
...@@ -997,9 +997,8 @@ static int cros_typec_get_cmd_version(struct cros_typec_data *typec) ...@@ -997,9 +997,8 @@ static int cros_typec_get_cmd_version(struct cros_typec_data *typec)
/* We're interested in the PD control command version. */ /* We're interested in the PD control command version. */
req_v1.cmd = EC_CMD_USB_PD_CONTROL; req_v1.cmd = EC_CMD_USB_PD_CONTROL;
ret = cros_ec_command(typec->ec, 1, EC_CMD_GET_CMD_VERSIONS, ret = cros_ec_cmd(typec->ec, 1, EC_CMD_GET_CMD_VERSIONS,
&req_v1, sizeof(req_v1), &resp, &req_v1, sizeof(req_v1), &resp, sizeof(resp));
sizeof(resp));
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1090,7 +1089,7 @@ static int cros_typec_probe(struct platform_device *pdev) ...@@ -1090,7 +1089,7 @@ static int cros_typec_probe(struct platform_device *pdev)
typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD); typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK); typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);
ret = cros_ec_command(typec->ec, 0, EC_CMD_USB_PD_PORTS, NULL, 0, ret = cros_ec_cmd(typec->ec, 0, EC_CMD_USB_PD_PORTS, NULL, 0,
&resp, sizeof(resp)); &resp, sizeof(resp));
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -71,7 +71,7 @@ static void cros_usbpd_get_event_and_notify(struct device *dev, ...@@ -71,7 +71,7 @@ static void cros_usbpd_get_event_and_notify(struct device *dev,
} }
/* Check for PD host events on EC. */ /* Check for PD host events on EC. */
ret = cros_ec_command(ec_dev, 0, EC_CMD_PD_HOST_EVENT_STATUS, ret = cros_ec_cmd(ec_dev, 0, EC_CMD_PD_HOST_EVENT_STATUS,
NULL, 0, &host_event_status, sizeof(host_event_status)); NULL, 0, &host_event_status, sizeof(host_event_status));
if (ret < 0) { if (ret < 0) {
dev_warn(dev, "Can't get host event status (err: %d)\n", ret); dev_warn(dev, "Can't get host event status (err: %d)\n", ret);
......
...@@ -30,7 +30,7 @@ static int cros_ec_regulator_enable(struct regulator_dev *dev) ...@@ -30,7 +30,7 @@ static int cros_ec_regulator_enable(struct regulator_dev *dev)
.enable = 1, .enable = 1,
}; };
return cros_ec_command(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd, return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd,
sizeof(cmd), NULL, 0); sizeof(cmd), NULL, 0);
} }
...@@ -42,7 +42,7 @@ static int cros_ec_regulator_disable(struct regulator_dev *dev) ...@@ -42,7 +42,7 @@ static int cros_ec_regulator_disable(struct regulator_dev *dev)
.enable = 0, .enable = 0,
}; };
return cros_ec_command(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd, return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd,
sizeof(cmd), NULL, 0); sizeof(cmd), NULL, 0);
} }
...@@ -55,7 +55,7 @@ static int cros_ec_regulator_is_enabled(struct regulator_dev *dev) ...@@ -55,7 +55,7 @@ static int cros_ec_regulator_is_enabled(struct regulator_dev *dev)
struct ec_response_regulator_is_enabled resp; struct ec_response_regulator_is_enabled resp;
int ret; int ret;
ret = cros_ec_command(data->ec_dev, 0, EC_CMD_REGULATOR_IS_ENABLED, &cmd, ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_IS_ENABLED, &cmd,
sizeof(cmd), &resp, sizeof(resp)); sizeof(cmd), &resp, sizeof(resp));
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -82,7 +82,7 @@ static int cros_ec_regulator_get_voltage(struct regulator_dev *dev) ...@@ -82,7 +82,7 @@ static int cros_ec_regulator_get_voltage(struct regulator_dev *dev)
struct ec_response_regulator_get_voltage resp; struct ec_response_regulator_get_voltage resp;
int ret; int ret;
ret = cros_ec_command(data->ec_dev, 0, EC_CMD_REGULATOR_GET_VOLTAGE, &cmd, ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_GET_VOLTAGE, &cmd,
sizeof(cmd), &resp, sizeof(resp)); sizeof(cmd), &resp, sizeof(resp));
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -108,7 +108,7 @@ static int cros_ec_regulator_set_voltage(struct regulator_dev *dev, int min_uV, ...@@ -108,7 +108,7 @@ static int cros_ec_regulator_set_voltage(struct regulator_dev *dev, int min_uV,
if (min_mV > max_mV) if (min_mV > max_mV)
return -EINVAL; return -EINVAL;
return cros_ec_command(data->ec_dev, 0, EC_CMD_REGULATOR_SET_VOLTAGE, &cmd, return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_SET_VOLTAGE, &cmd,
sizeof(cmd), NULL, 0); sizeof(cmd), NULL, 0);
} }
...@@ -130,7 +130,7 @@ static int cros_ec_regulator_init_info(struct device *dev, ...@@ -130,7 +130,7 @@ static int cros_ec_regulator_init_info(struct device *dev,
struct ec_response_regulator_get_info resp; struct ec_response_regulator_get_info resp;
int ret; int ret;
ret = cros_ec_command(data->ec_dev, 0, EC_CMD_REGULATOR_GET_INFO, &cmd, ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_GET_INFO, &cmd,
sizeof(cmd), &resp, sizeof(resp)); sizeof(cmd), &resp, sizeof(resp));
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -231,7 +231,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature); ...@@ -231,7 +231,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature);
int cros_ec_get_sensor_count(struct cros_ec_dev *ec); int cros_ec_get_sensor_count(struct cros_ec_dev *ec);
int cros_ec_command(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata, int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata,
int outsize, void *indata, int insize); int outsize, void *indata, int insize);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment