#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/dmi.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/string_choices.h>
#include <linux/acpi.h>
#include <acpi/battery.h>
#define ACPI_AC_CLASS …
#define ACPI_AC_DEVICE_NAME …
#define ACPI_AC_FILE_STATE …
#define ACPI_AC_NOTIFY_STATUS …
#define ACPI_AC_STATUS_OFFLINE …
#define ACPI_AC_STATUS_ONLINE …
#define ACPI_AC_STATUS_UNKNOWN …
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int acpi_ac_probe(struct platform_device *pdev);
static void acpi_ac_remove(struct platform_device *pdev);
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data);
static const struct acpi_device_id ac_device_ids[] = …;
MODULE_DEVICE_TABLE(acpi, ac_device_ids);
#ifdef CONFIG_PM_SLEEP
static int acpi_ac_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
static int ac_sleep_before_get_state_ms;
static int ac_only;
struct acpi_ac { … };
#define to_acpi_ac(x) …
static int acpi_ac_get_state(struct acpi_ac *ac)
{ … }
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static const enum power_supply_property ac_props[] = …;
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
{ … }
static int acpi_ac_battery_notify(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static int __init thinkpad_e530_quirk(const struct dmi_system_id *d)
{ … }
static int __init ac_only_quirk(const struct dmi_system_id *d)
{ … }
static const struct dmi_system_id ac_dmi_table[] __initconst = …;
static int acpi_ac_probe(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int acpi_ac_resume(struct device *dev)
{ … }
#else
#define acpi_ac_resume …
#endif
static void acpi_ac_remove(struct platform_device *pdev)
{ … }
static struct platform_driver acpi_ac_driver = …;
static int __init acpi_ac_init(void)
{ … }
static void __exit acpi_ac_exit(void)
{ … }
module_init(…) …;
module_exit(acpi_ac_exit);