#include <linux/circ_buf.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/wait.h>
#define DRV_NAME …
#define LOG_SHIFT …
#define LOG_SIZE …
#define LOG_POLL_SEC …
#define CIRC_ADD(idx, size, value) …
static unsigned int log_poll_period_ms = …;
module_param(log_poll_period_ms, uint, 0644);
MODULE_PARM_DESC(…) …;
static DECLARE_WAIT_QUEUE_HEAD(cros_ec_debugfs_log_wq);
struct cros_ec_debugfs { … };
static void cros_ec_console_log_work(struct work_struct *__work)
{ … }
static int cros_ec_console_log_open(struct inode *inode, struct file *file)
{ … }
static ssize_t cros_ec_console_log_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static __poll_t cros_ec_console_log_poll(struct file *file,
poll_table *wait)
{ … }
static int cros_ec_console_log_release(struct inode *inode, struct file *file)
{ … }
static ssize_t cros_ec_pdinfo_read(struct file *file,
char __user *user_buf,
size_t count,
loff_t *ppos)
{ … }
static bool cros_ec_uptime_is_supported(struct cros_ec_device *ec_dev)
{ … }
static ssize_t cros_ec_uptime_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations cros_ec_console_log_fops = …;
static const struct file_operations cros_ec_pdinfo_fops = …;
static const struct file_operations cros_ec_uptime_fops = …;
static int ec_read_version_supported(struct cros_ec_dev *ec)
{ … }
static int cros_ec_create_console_log(struct cros_ec_debugfs *debug_info)
{ … }
static void cros_ec_cleanup_console_log(struct cros_ec_debugfs *debug_info)
{ … }
static int cros_ec_get_panicinfo(struct cros_ec_device *ec_dev, uint8_t *data,
int data_size)
{ … }
static int cros_ec_create_panicinfo(struct cros_ec_debugfs *debug_info)
{ … }
static int cros_ec_debugfs_panic_event(struct notifier_block *nb,
unsigned long queued_during_suspend, void *_notify)
{ … }
static int cros_ec_debugfs_probe(struct platform_device *pd)
{ … }
static void cros_ec_debugfs_remove(struct platform_device *pd)
{ … }
static int __maybe_unused cros_ec_debugfs_suspend(struct device *dev)
{ … }
static int __maybe_unused cros_ec_debugfs_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(cros_ec_debugfs_pm_ops,
cros_ec_debugfs_suspend, cros_ec_debugfs_resume);
static const struct platform_device_id cros_ec_debugfs_id[] = …;
MODULE_DEVICE_TABLE(platform, cros_ec_debugfs_id);
static struct platform_driver cros_ec_debugfs_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;