Lines Matching refs:msg
68 struct cros_ec_command *msg; in reboot_store() local
75 msg = kmalloc(sizeof(*msg) + sizeof(*param), GFP_KERNEL); in reboot_store()
76 if (!msg) in reboot_store()
79 param = (struct ec_params_reboot_ec *)msg->data; in reboot_store()
112 msg->version = 0; in reboot_store()
113 msg->command = EC_CMD_REBOOT_EC + ec->cmd_offset; in reboot_store()
114 msg->outsize = sizeof(*param); in reboot_store()
115 msg->insize = 0; in reboot_store()
116 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in reboot_store()
120 kfree(msg); in reboot_store()
131 struct cros_ec_command *msg; in version_show() local
136 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in version_show()
137 if (!msg) in version_show()
141 msg->version = 0; in version_show()
142 msg->command = EC_CMD_GET_VERSION + ec->cmd_offset; in version_show()
143 msg->insize = sizeof(*r_ver); in version_show()
144 msg->outsize = 0; in version_show()
145 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
150 r_ver = (struct ec_response_get_version *)msg->data; in version_show()
164 msg->command = EC_CMD_GET_BUILD_INFO + ec->cmd_offset; in version_show()
165 msg->insize = EC_HOST_PARAM_SIZE; in version_show()
166 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); in version_show()
170 else if (msg->result != EC_RES_SUCCESS) in version_show()
172 "Build info: EC error %d\n", msg->result); in version_show()
174 msg->data[EC_HOST_PARAM_SIZE - 1] = '\0'; in version_show()
176 "Build info: %s\n", msg->data); in version_show()
180 msg->command = EC_CMD_GET_CHIP_INFO + ec->cmd_offset; in version_show()
181 msg->insize = sizeof(*r_chip); in version_show()
182 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); in version_show()
186 else if (msg->result != EC_RES_SUCCESS) in version_show()
188 "Chip info: EC error %d\n", msg->result); in version_show()
190 r_chip = (struct ec_response_get_chip_info *)msg->data; in version_show()
204 msg->command = EC_CMD_GET_BOARD_VERSION + ec->cmd_offset; in version_show()
205 msg->insize = sizeof(*r_board); in version_show()
206 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); in version_show()
210 else if (msg->result != EC_RES_SUCCESS) in version_show()
212 "Board version: EC error %d\n", msg->result); in version_show()
214 r_board = (struct ec_response_board_version *)msg->data; in version_show()
222 kfree(msg); in version_show()
230 struct cros_ec_command *msg; in flashinfo_show() local
234 msg = kmalloc(sizeof(*msg) + sizeof(*resp), GFP_KERNEL); in flashinfo_show()
235 if (!msg) in flashinfo_show()
239 msg->version = 0; in flashinfo_show()
240 msg->command = EC_CMD_FLASH_INFO + ec->cmd_offset; in flashinfo_show()
241 msg->insize = sizeof(*resp); in flashinfo_show()
242 msg->outsize = 0; in flashinfo_show()
243 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in flashinfo_show()
247 resp = (struct ec_response_flash_info *)msg->data; in flashinfo_show()
255 kfree(msg); in flashinfo_show()
266 struct cros_ec_command *msg; in kb_wake_angle_show() local
269 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in kb_wake_angle_show()
270 if (!msg) in kb_wake_angle_show()
273 param = (struct ec_params_motion_sense *)msg->data; in kb_wake_angle_show()
274 msg->command = EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset; in kb_wake_angle_show()
275 msg->version = 2; in kb_wake_angle_show()
278 msg->outsize = sizeof(*param); in kb_wake_angle_show()
279 msg->insize = sizeof(*resp); in kb_wake_angle_show()
281 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_show()
285 resp = (struct ec_response_motion_sense *)msg->data; in kb_wake_angle_show()
288 kfree(msg); in kb_wake_angle_show()
298 struct cros_ec_command *msg; in kb_wake_angle_store() local
306 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in kb_wake_angle_store()
307 if (!msg) in kb_wake_angle_store()
310 param = (struct ec_params_motion_sense *)msg->data; in kb_wake_angle_store()
311 msg->command = EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset; in kb_wake_angle_store()
312 msg->version = 2; in kb_wake_angle_store()
315 msg->outsize = sizeof(*param); in kb_wake_angle_store()
316 msg->insize = sizeof(struct ec_response_motion_sense); in kb_wake_angle_store()
318 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_store()
319 kfree(msg); in kb_wake_angle_store()