Lines Matching full:ec

2 // Debug logs for the ChromeOS EC
20 #define DRV_NAME "cros-ec-debugfs"
32 * struct cros_ec_debugfs - EC debugging information.
34 * @ec: EC device this debugfs information belongs to
37 * @read_msg: preallocated EC command and buffer to read console log
39 * @log_poll_work: recurring task to poll EC for new console log data
43 struct cros_ec_dev *ec; member
45 /* EC log */
50 /* EC panicinfo */
55 * We need to make sure that the EC log buffer on the UART is large enough,
64 struct cros_ec_dev *ec = debug_info->ec; in cros_ec_console_log_work() local
67 .command = EC_CMD_CONSOLE_SNAPSHOT + ec->cmd_offset, in cros_ec_console_log_work()
77 ret = cros_ec_cmd_xfer_status(ec->ec_dev, &snapshot_msg); in cros_ec_console_log_work()
87 dev_info_once(ec->dev, in cros_ec_console_log_work()
94 ret = cros_ec_cmd_xfer_status(ec->ec_dev, in cros_ec_console_log_work()
201 struct cros_ec_device *ec_dev = debug_info->ec->ec_dev; in cros_ec_pdinfo_read()
269 struct cros_ec_device *ec_dev = debug_info->ec->ec_dev; in cros_ec_uptime_read()
316 static int ec_read_version_supported(struct cros_ec_dev *ec) in ec_read_version_supported() argument
329 msg->command = EC_CMD_GET_CMD_VERSIONS + ec->cmd_offset; in ec_read_version_supported()
337 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg) >= 0 && in ec_read_version_supported()
347 struct cros_ec_dev *ec = debug_info->ec; in cros_ec_create_console_log() local
356 if (!ec_read_version_supported(ec)) in cros_ec_create_console_log()
359 buf = devm_kzalloc(ec->dev, LOG_SIZE, GFP_KERNEL); in cros_ec_create_console_log()
364 read_response_size = ec->ec_dev->max_response; in cros_ec_create_console_log()
365 debug_info->read_msg = devm_kzalloc(ec->dev, in cros_ec_create_console_log()
372 debug_info->read_msg->command = EC_CMD_CONSOLE_READ + ec->cmd_offset; in cros_ec_create_console_log()
402 struct cros_ec_device *ec_dev = debug_info->ec->ec_dev; in cros_ec_create_panicinfo()
409 msg = devm_kzalloc(debug_info->ec->dev, in cros_ec_create_panicinfo()
436 devm_kfree(debug_info->ec->dev, msg); in cros_ec_create_panicinfo()
442 struct cros_ec_dev *ec = dev_get_drvdata(pd->dev.parent); in cros_ec_debugfs_probe() local
443 struct cros_ec_platform *ec_platform = dev_get_platdata(ec->dev); in cros_ec_debugfs_probe()
448 debug_info = devm_kzalloc(ec->dev, sizeof(*debug_info), GFP_KERNEL); in cros_ec_debugfs_probe()
452 debug_info->ec = ec; in cros_ec_debugfs_probe()
466 if (cros_ec_uptime_is_supported(ec->ec_dev)) in cros_ec_debugfs_probe()
471 &ec->ec_dev->last_resume_result); in cros_ec_debugfs_probe()
474 &ec->ec_dev->suspend_timeout_ms); in cros_ec_debugfs_probe()
476 ec->debug_info = debug_info; in cros_ec_debugfs_probe()
478 dev_set_drvdata(&pd->dev, ec); in cros_ec_debugfs_probe()
489 struct cros_ec_dev *ec = dev_get_drvdata(pd->dev.parent); in cros_ec_debugfs_remove() local
491 debugfs_remove_recursive(ec->debug_info->dir); in cros_ec_debugfs_remove()
492 cros_ec_cleanup_console_log(ec->debug_info); in cros_ec_debugfs_remove()
499 struct cros_ec_dev *ec = dev_get_drvdata(dev); in cros_ec_debugfs_suspend() local
501 if (ec->debug_info->log_buffer.buf) in cros_ec_debugfs_suspend()
502 cancel_delayed_work_sync(&ec->debug_info->log_poll_work); in cros_ec_debugfs_suspend()
509 struct cros_ec_dev *ec = dev_get_drvdata(dev); in cros_ec_debugfs_resume() local
511 if (ec->debug_info->log_buffer.buf) in cros_ec_debugfs_resume()
512 schedule_delayed_work(&ec->debug_info->log_poll_work, 0); in cros_ec_debugfs_resume()
532 MODULE_DESCRIPTION("Debug logs for ChromeOS EC");