Lines Matching refs:msg
55 struct cros_ec_command *msg; in reboot_store() local
62 msg = kmalloc(sizeof(*msg) + sizeof(*param), GFP_KERNEL); in reboot_store()
63 if (!msg) in reboot_store()
66 param = (struct ec_params_reboot_ec *)msg->data; in reboot_store()
99 msg->version = 0; in reboot_store()
100 msg->command = EC_CMD_REBOOT_EC + ec->cmd_offset; in reboot_store()
101 msg->outsize = sizeof(*param); in reboot_store()
102 msg->insize = 0; in reboot_store()
103 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in reboot_store()
107 kfree(msg); in reboot_store()
118 struct cros_ec_command *msg; in version_show() local
123 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in version_show()
124 if (!msg) in version_show()
128 msg->version = 0; in version_show()
129 msg->command = EC_CMD_GET_VERSION + ec->cmd_offset; in version_show()
130 msg->insize = sizeof(*r_ver); in version_show()
131 msg->outsize = 0; in version_show()
132 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
137 r_ver = (struct ec_response_get_version *)msg->data; in version_show()
148 msg->command = EC_CMD_GET_BUILD_INFO + ec->cmd_offset; in version_show()
149 msg->insize = EC_HOST_PARAM_SIZE; in version_show()
150 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
154 ret, msg->result); in version_show()
156 msg->data[EC_HOST_PARAM_SIZE - 1] = '\0'; in version_show()
157 count += sysfs_emit_at(buf, count, "Build info: %s\n", msg->data); in version_show()
161 msg->command = EC_CMD_GET_CHIP_INFO + ec->cmd_offset; in version_show()
162 msg->insize = sizeof(*r_chip); in version_show()
163 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
167 ret, msg->result); in version_show()
169 r_chip = (struct ec_response_get_chip_info *)msg->data; in version_show()
180 msg->command = EC_CMD_GET_BOARD_VERSION + ec->cmd_offset; in version_show()
181 msg->insize = sizeof(*r_board); in version_show()
182 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
186 ret, msg->result); in version_show()
188 r_board = (struct ec_response_board_version *)msg->data; in version_show()
196 kfree(msg); in version_show()
204 struct cros_ec_command *msg; in flashinfo_show() local
208 msg = kmalloc(sizeof(*msg) + sizeof(*resp), GFP_KERNEL); in flashinfo_show()
209 if (!msg) in flashinfo_show()
213 msg->version = 0; in flashinfo_show()
214 msg->command = EC_CMD_FLASH_INFO + ec->cmd_offset; in flashinfo_show()
215 msg->insize = sizeof(*resp); in flashinfo_show()
216 msg->outsize = 0; in flashinfo_show()
217 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in flashinfo_show()
221 resp = (struct ec_response_flash_info *)msg->data; in flashinfo_show()
229 kfree(msg); in flashinfo_show()
240 struct cros_ec_command *msg; in kb_wake_angle_show() local
243 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in kb_wake_angle_show()
244 if (!msg) in kb_wake_angle_show()
247 param = (struct ec_params_motion_sense *)msg->data; in kb_wake_angle_show()
248 msg->command = EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset; in kb_wake_angle_show()
249 msg->version = 2; in kb_wake_angle_show()
252 msg->outsize = sizeof(*param); in kb_wake_angle_show()
253 msg->insize = sizeof(*resp); in kb_wake_angle_show()
255 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_show()
259 resp = (struct ec_response_motion_sense *)msg->data; in kb_wake_angle_show()
262 kfree(msg); in kb_wake_angle_show()
272 struct cros_ec_command *msg; in kb_wake_angle_store() local
280 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in kb_wake_angle_store()
281 if (!msg) in kb_wake_angle_store()
284 param = (struct ec_params_motion_sense *)msg->data; in kb_wake_angle_store()
285 msg->command = EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset; in kb_wake_angle_store()
286 msg->version = 2; in kb_wake_angle_store()
289 msg->outsize = sizeof(*param); in kb_wake_angle_store()
290 msg->insize = sizeof(struct ec_response_motion_sense); in kb_wake_angle_store()
292 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_store()
293 kfree(msg); in kb_wake_angle_store()