#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/input.h>
#include <linux/acpi.h>
#include <acpi/button.h>
#define SURFACE_PRO3_BUTTON_HID …
#define SURFACE_PRO4_BUTTON_HID …
#define SURFACE_BUTTON_OBJ_NAME …
#define SURFACE_BUTTON_DEVICE_NAME …
#define MSHW0040_DSM_REVISION …
#define MSHW0040_DSM_GET_OMPR …
static const guid_t MSHW0040_DSM_UUID = …;
#define SURFACE_BUTTON_NOTIFY_TABLET_MODE …
#define SURFACE_BUTTON_NOTIFY_PRESS_POWER …
#define SURFACE_BUTTON_NOTIFY_RELEASE_POWER …
#define SURFACE_BUTTON_NOTIFY_PRESS_HOME …
#define SURFACE_BUTTON_NOTIFY_RELEASE_HOME …
#define SURFACE_BUTTON_NOTIFY_PRESS_VOLUME_UP …
#define SURFACE_BUTTON_NOTIFY_RELEASE_VOLUME_UP …
#define SURFACE_BUTTON_NOTIFY_PRESS_VOLUME_DOWN …
#define SURFACE_BUTTON_NOTIFY_RELEASE_VOLUME_DOWN …
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static const struct acpi_device_id surface_button_device_ids[] = …;
MODULE_DEVICE_TABLE(acpi, surface_button_device_ids);
struct surface_button { … };
static void surface_button_notify(struct acpi_device *device, u32 event)
{ … }
#ifdef CONFIG_PM_SLEEP
static int surface_button_suspend(struct device *dev)
{ … }
static int surface_button_resume(struct device *dev)
{ … }
#endif
static bool surface_button_check_MSHW0040(struct acpi_device *dev)
{ … }
static int surface_button_add(struct acpi_device *device)
{ … }
static void surface_button_remove(struct acpi_device *device)
{ … }
static SIMPLE_DEV_PM_OPS(surface_button_pm,
surface_button_suspend, surface_button_resume);
static struct acpi_driver surface_button_driver = …;
module_acpi_driver(…) …;