aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-cros-ec-tunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-cros-ec-tunnel.c')
-rw-r--r--drivers/i2c/busses/i2c-cros-ec-tunnel.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
index 8e7a71487bb1..dd07818d03d0 100644
--- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
+++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
@@ -183,6 +183,7 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[],
183 u8 *request = NULL; 183 u8 *request = NULL;
184 u8 *response = NULL; 184 u8 *response = NULL;
185 int result; 185 int result;
186 struct cros_ec_command msg;
186 187
187 request_len = ec_i2c_count_message(i2c_msgs, num); 188 request_len = ec_i2c_count_message(i2c_msgs, num);
188 if (request_len < 0) { 189 if (request_len < 0) {
@@ -218,9 +219,15 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[],
218 } 219 }
219 220
220 ec_i2c_construct_message(request, i2c_msgs, num, bus_num); 221 ec_i2c_construct_message(request, i2c_msgs, num, bus_num);
221 result = bus->ec->command_sendrecv(bus->ec, EC_CMD_I2C_PASSTHRU, 222
222 request, request_len, 223 msg.version = 0;
223 response, response_len); 224 msg.command = EC_CMD_I2C_PASSTHRU;
225 msg.outdata = request;
226 msg.outsize = request_len;
227 msg.indata = response;
228 msg.insize = response_len;
229
230 result = bus->ec->cmd_xfer(bus->ec, &msg);
224 if (result) 231 if (result)
225 goto exit; 232 goto exit;
226 233
@@ -258,7 +265,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
258 u32 remote_bus; 265 u32 remote_bus;
259 int err; 266 int err;
260 267
261 if (!ec->command_sendrecv) { 268 if (!ec->cmd_xfer) {
262 dev_err(dev, "Missing sendrecv\n"); 269 dev_err(dev, "Missing sendrecv\n");
263 return -EINVAL; 270 return -EINVAL;
264 } 271 }