#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/buffer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/delay.h>
#define MPL3115_STATUS …
#define MPL3115_OUT_PRESS …
#define MPL3115_OUT_TEMP …
#define MPL3115_WHO_AM_I …
#define MPL3115_CTRL_REG1 …
#define MPL3115_DEVICE_ID …
#define MPL3115_STATUS_PRESS_RDY …
#define MPL3115_STATUS_TEMP_RDY …
#define MPL3115_CTRL_RESET …
#define MPL3115_CTRL_OST …
#define MPL3115_CTRL_ACTIVE …
#define MPL3115_CTRL_OS_258MS …
struct mpl3115_data { … };
static int mpl3115_request(struct mpl3115_data *data)
{ … }
static int mpl3115_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static irqreturn_t mpl3115_trigger_handler(int irq, void *p)
{ … }
static const struct iio_chan_spec mpl3115_channels[] = …;
static const struct iio_info mpl3115_info = …;
static int mpl3115_probe(struct i2c_client *client)
{ … }
static int mpl3115_standby(struct mpl3115_data *data)
{ … }
static void mpl3115_remove(struct i2c_client *client)
{ … }
static int mpl3115_suspend(struct device *dev)
{ … }
static int mpl3115_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(mpl3115_pm_ops, mpl3115_suspend,
mpl3115_resume);
static const struct i2c_device_id mpl3115_id[] = …;
MODULE_DEVICE_TABLE(i2c, mpl3115_id);
static const struct of_device_id mpl3115_of_match[] = …;
MODULE_DEVICE_TABLE(of, mpl3115_of_match);
static struct i2c_driver mpl3115_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;