#define pr_fmt(fmt) …
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <acpi/button.h>
#define ACPI_BUTTON_CLASS …
#define ACPI_BUTTON_FILE_STATE …
#define ACPI_BUTTON_TYPE_UNKNOWN …
#define ACPI_BUTTON_NOTIFY_STATUS …
#define ACPI_BUTTON_SUBCLASS_POWER …
#define ACPI_BUTTON_DEVICE_NAME_POWER …
#define ACPI_BUTTON_TYPE_POWER …
#define ACPI_BUTTON_SUBCLASS_SLEEP …
#define ACPI_BUTTON_DEVICE_NAME_SLEEP …
#define ACPI_BUTTON_TYPE_SLEEP …
#define ACPI_BUTTON_SUBCLASS_LID …
#define ACPI_BUTTON_DEVICE_NAME_LID …
#define ACPI_BUTTON_TYPE_LID …
enum { … };
static const char * const lid_init_state_str[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static const struct acpi_device_id button_device_ids[] = …;
MODULE_DEVICE_TABLE(acpi, button_device_ids);
static const struct dmi_system_id dmi_lid_quirks[] = …;
static int acpi_button_add(struct acpi_device *device);
static void acpi_button_remove(struct acpi_device *device);
#ifdef CONFIG_PM_SLEEP
static int acpi_button_suspend(struct device *dev);
static int acpi_button_resume(struct device *dev);
#else
#define acpi_button_suspend …
#define acpi_button_resume …
#endif
static SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume);
static struct acpi_driver acpi_button_driver = …;
struct acpi_button { … };
static struct acpi_device *lid_device;
static long lid_init_state = …;
static unsigned long lid_report_interval __read_mostly = …;
module_param(lid_report_interval, ulong, 0644);
MODULE_PARM_DESC(…) …;
static struct proc_dir_entry *acpi_button_dir;
static struct proc_dir_entry *acpi_lid_dir;
static int acpi_lid_evaluate_state(struct acpi_device *device)
{ … }
static int acpi_lid_notify_state(struct acpi_device *device, int state)
{ … }
static int __maybe_unused acpi_button_state_seq_show(struct seq_file *seq,
void *offset)
{ … }
static int acpi_button_add_fs(struct acpi_device *device)
{ … }
static int acpi_button_remove_fs(struct acpi_device *device)
{ … }
int acpi_lid_open(void)
{ … }
EXPORT_SYMBOL(…);
static int acpi_lid_update_state(struct acpi_device *device,
bool signal_wakeup)
{ … }
static void acpi_lid_initialize_state(struct acpi_device *device)
{ … }
static void acpi_lid_notify(acpi_handle handle, u32 event, void *data)
{ … }
static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
{ … }
static void acpi_button_notify_run(void *data)
{ … }
static u32 acpi_button_event(void *data)
{ … }
#ifdef CONFIG_PM_SLEEP
static int acpi_button_suspend(struct device *dev)
{ … }
static int acpi_button_resume(struct device *dev)
{ … }
#endif
static int acpi_lid_input_open(struct input_dev *input)
{ … }
static int acpi_button_add(struct acpi_device *device)
{ … }
static void acpi_button_remove(struct acpi_device *device)
{ … }
static int param_set_lid_init_state(const char *val,
const struct kernel_param *kp)
{ … }
static int param_get_lid_init_state(char *buf, const struct kernel_param *kp)
{ … }
module_param_call(…);
MODULE_PARM_DESC(…) …;
static int acpi_button_register_driver(struct acpi_driver *driver)
{ … }
static void acpi_button_unregister_driver(struct acpi_driver *driver)
{ … }
module_driver(…);