Lines Matching refs:msg

54 	struct cros_ec_command *msg;  in reboot_store()  local
61 msg = kmalloc(sizeof(*msg) + sizeof(*param), GFP_KERNEL); in reboot_store()
62 if (!msg) in reboot_store()
65 param = (struct ec_params_reboot_ec *)msg->data; in reboot_store()
98 msg->version = 0; in reboot_store()
99 msg->command = EC_CMD_REBOOT_EC + ec->cmd_offset; in reboot_store()
100 msg->outsize = sizeof(*param); in reboot_store()
101 msg->insize = 0; in reboot_store()
102 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in reboot_store()
106 kfree(msg); in reboot_store()
117 struct cros_ec_command *msg; in version_show() local
122 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in version_show()
123 if (!msg) in version_show()
127 msg->version = 0; in version_show()
128 msg->command = EC_CMD_GET_VERSION + ec->cmd_offset; in version_show()
129 msg->insize = sizeof(*r_ver); in version_show()
130 msg->outsize = 0; in version_show()
131 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
136 r_ver = (struct ec_response_get_version *)msg->data; in version_show()
147 msg->command = EC_CMD_GET_BUILD_INFO + ec->cmd_offset; in version_show()
148 msg->insize = EC_HOST_PARAM_SIZE; in version_show()
149 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
153 ret, msg->result); in version_show()
155 msg->data[EC_HOST_PARAM_SIZE - 1] = '\0'; in version_show()
156 count += sysfs_emit_at(buf, count, "Build info: %s\n", msg->data); in version_show()
160 msg->command = EC_CMD_GET_CHIP_INFO + ec->cmd_offset; in version_show()
161 msg->insize = sizeof(*r_chip); in version_show()
162 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
166 ret, msg->result); in version_show()
168 r_chip = (struct ec_response_get_chip_info *)msg->data; in version_show()
179 msg->command = EC_CMD_GET_BOARD_VERSION + ec->cmd_offset; in version_show()
180 msg->insize = sizeof(*r_board); in version_show()
181 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show()
185 ret, msg->result); in version_show()
187 r_board = (struct ec_response_board_version *)msg->data; in version_show()
195 kfree(msg); in version_show()
203 struct cros_ec_command *msg; in flashinfo_show() local
207 msg = kmalloc(sizeof(*msg) + sizeof(*resp), GFP_KERNEL); in flashinfo_show()
208 if (!msg) in flashinfo_show()
212 msg->version = 0; in flashinfo_show()
213 msg->command = EC_CMD_FLASH_INFO + ec->cmd_offset; in flashinfo_show()
214 msg->insize = sizeof(*resp); in flashinfo_show()
215 msg->outsize = 0; in flashinfo_show()
216 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in flashinfo_show()
220 resp = (struct ec_response_flash_info *)msg->data; in flashinfo_show()
228 kfree(msg); in flashinfo_show()
239 struct cros_ec_command *msg; in kb_wake_angle_show() local
242 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in kb_wake_angle_show()
243 if (!msg) in kb_wake_angle_show()
246 param = (struct ec_params_motion_sense *)msg->data; in kb_wake_angle_show()
247 msg->command = EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset; in kb_wake_angle_show()
248 msg->version = 2; in kb_wake_angle_show()
251 msg->outsize = sizeof(*param); in kb_wake_angle_show()
252 msg->insize = sizeof(*resp); in kb_wake_angle_show()
254 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_show()
258 resp = (struct ec_response_motion_sense *)msg->data; in kb_wake_angle_show()
261 kfree(msg); in kb_wake_angle_show()
271 struct cros_ec_command *msg; in kb_wake_angle_store() local
279 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); in kb_wake_angle_store()
280 if (!msg) in kb_wake_angle_store()
283 param = (struct ec_params_motion_sense *)msg->data; in kb_wake_angle_store()
284 msg->command = EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset; in kb_wake_angle_store()
285 msg->version = 2; in kb_wake_angle_store()
288 msg->outsize = sizeof(*param); in kb_wake_angle_store()
289 msg->insize = sizeof(struct ec_response_motion_sense); in kb_wake_angle_store()
291 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_store()
292 kfree(msg); in kb_wake_angle_store()