#include <linux/acpi.h>
#include <linux/fs.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#define HPS_ACPI_ID …
struct hps_drvdata { … };
static void hps_set_power(struct hps_drvdata *hps, bool state)
{ … }
static int hps_open(struct inode *inode, struct file *file)
{ … }
static int hps_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations hps_fops = …;
static int hps_i2c_probe(struct i2c_client *client)
{ … }
static void hps_i2c_remove(struct i2c_client *client)
{ … }
static int hps_suspend(struct device *dev)
{ … }
static int hps_resume(struct device *dev)
{ … }
static DEFINE_RUNTIME_DEV_PM_OPS(hps_pm_ops, hps_suspend, hps_resume, NULL);
static const struct i2c_device_id hps_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, hps_i2c_id);
#ifdef CONFIG_ACPI
static const struct acpi_device_id hps_acpi_id[] = …;
MODULE_DEVICE_TABLE(acpi, hps_acpi_id);
#endif
static struct i2c_driver hps_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;