linux/drivers/platform/surface/surface_gpe.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Surface GPE/Lid driver to enable wakeup from suspend via the lid by
 * properly configuring the respective GPEs. Required for wakeup via lid on
 * newer Intel-based Microsoft Surface devices.
 *
 * Copyright (C) 2020-2022 Maximilian Luz <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>

/*
 * Note: The GPE numbers for the lid devices found below have been obtained
 *       from ACPI/the DSDT table, specifically from the GPE handler for the
 *       lid.
 */

static const struct property_entry lid_device_props_l17[] =;

static const struct property_entry lid_device_props_l4B[] =;

static const struct property_entry lid_device_props_l4D[] =;

static const struct property_entry lid_device_props_l4F[] =;

static const struct property_entry lid_device_props_l57[] =;

/*
 * Note: When changing this, don't forget to check that the MODULE_ALIAS below
 *       still fits.
 */
static const struct dmi_system_id dmi_lid_device_table[] =;

struct surface_lid_device {};

static int surface_lid_enable_wakeup(struct device *dev, bool enable)
{}

static int __maybe_unused surface_gpe_suspend(struct device *dev)
{}

static int __maybe_unused surface_gpe_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(surface_gpe_pm, surface_gpe_suspend, surface_gpe_resume);

static int surface_gpe_probe(struct platform_device *pdev)
{}

static void surface_gpe_remove(struct platform_device *pdev)
{}

static struct platform_driver surface_gpe_driver =;

static struct platform_device *surface_gpe_device;

static int __init surface_gpe_init(void)
{}
module_init();

static void __exit surface_gpe_exit(void)
{}
module_exit(surface_gpe_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();