Lines Matching refs:msg

88 	struct cros_ec_command *msg;  in alloc_lightbar_cmd_msg()  local
94 msg = kmalloc(sizeof(*msg) + len, GFP_KERNEL); in alloc_lightbar_cmd_msg()
95 if (!msg) in alloc_lightbar_cmd_msg()
98 msg->version = 0; in alloc_lightbar_cmd_msg()
99 msg->command = EC_CMD_LIGHTBAR_CMD + ec->cmd_offset; in alloc_lightbar_cmd_msg()
100 msg->outsize = sizeof(struct ec_params_lightbar); in alloc_lightbar_cmd_msg()
101 msg->insize = sizeof(struct ec_response_lightbar); in alloc_lightbar_cmd_msg()
103 return msg; in alloc_lightbar_cmd_msg()
111 struct cros_ec_command *msg; in get_lightbar_version() local
114 msg = alloc_lightbar_cmd_msg(ec); in get_lightbar_version()
115 if (!msg) in get_lightbar_version()
118 param = (struct ec_params_lightbar *)msg->data; in get_lightbar_version()
120 msg->outsize = sizeof(param->cmd); in get_lightbar_version()
121 msg->result = sizeof(resp->version); in get_lightbar_version()
122 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in get_lightbar_version()
128 switch (msg->result) { in get_lightbar_version()
139 resp = (struct ec_response_lightbar *)msg->data; in get_lightbar_version()
153 kfree(msg); in get_lightbar_version()
180 struct cros_ec_command *msg; in brightness_store() local
188 msg = alloc_lightbar_cmd_msg(ec); in brightness_store()
189 if (!msg) in brightness_store()
192 param = (struct ec_params_lightbar *)msg->data; in brightness_store()
199 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in brightness_store()
205 kfree(msg); in brightness_store()
221 struct cros_ec_command *msg; in led_rgb_store() local
226 msg = alloc_lightbar_cmd_msg(ec); in led_rgb_store()
227 if (!msg) in led_rgb_store()
243 param = (struct ec_params_lightbar *)msg->data; in led_rgb_store()
259 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in led_rgb_store()
274 kfree(msg); in led_rgb_store()
289 struct cros_ec_command *msg; in sequence_show() local
293 msg = alloc_lightbar_cmd_msg(ec); in sequence_show()
294 if (!msg) in sequence_show()
297 param = (struct ec_params_lightbar *)msg->data; in sequence_show()
303 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in sequence_show()
305 ret = sysfs_emit(buf, "XFER / EC ERROR %d / %d\n", ret, msg->result); in sequence_show()
309 resp = (struct ec_response_lightbar *)msg->data; in sequence_show()
316 kfree(msg); in sequence_show()
323 struct cros_ec_command *msg; in lb_send_empty_cmd() local
326 msg = alloc_lightbar_cmd_msg(ec); in lb_send_empty_cmd()
327 if (!msg) in lb_send_empty_cmd()
330 param = (struct ec_params_lightbar *)msg->data; in lb_send_empty_cmd()
337 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in lb_send_empty_cmd()
343 kfree(msg); in lb_send_empty_cmd()
351 struct cros_ec_command *msg; in lb_manual_suspend_ctrl() local
354 msg = alloc_lightbar_cmd_msg(ec); in lb_manual_suspend_ctrl()
355 if (!msg) in lb_manual_suspend_ctrl()
358 param = (struct ec_params_lightbar *)msg->data; in lb_manual_suspend_ctrl()
367 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in lb_manual_suspend_ctrl()
373 kfree(msg); in lb_manual_suspend_ctrl()
382 struct cros_ec_command *msg; in sequence_store() local
401 msg = alloc_lightbar_cmd_msg(ec); in sequence_store()
402 if (!msg) in sequence_store()
405 param = (struct ec_params_lightbar *)msg->data; in sequence_store()
412 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in sequence_store()
418 kfree(msg); in sequence_store()
427 struct cros_ec_command *msg; in program_store() local
446 msg = alloc_lightbar_cmd_msg(ec); in program_store()
447 if (!msg) in program_store()
456 param = (struct ec_params_lightbar *)msg->data; in program_store()
467 msg->outsize = count + extra_bytes; in program_store()
469 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in program_store()
475 kfree(msg); in program_store()