#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define MC3230_REG_XOUT …
#define MC3230_REG_YOUT …
#define MC3230_REG_ZOUT …
#define MC3230_REG_MODE …
#define MC3230_MODE_OPCON_MASK …
#define MC3230_MODE_OPCON_WAKE …
#define MC3230_MODE_OPCON_STANDBY …
#define MC3230_REG_CHIP_ID …
#define MC3230_CHIP_ID …
#define MC3230_REG_PRODUCT_CODE …
#define MC3230_PRODUCT_CODE …
static const int mc3230_nscale = …;
#define MC3230_CHANNEL(reg, axis) …
static const struct iio_chan_spec mc3230_channels[] = …;
struct mc3230_data { … };
static int mc3230_set_opcon(struct mc3230_data *data, int opcon)
{ … }
static int mc3230_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static const struct iio_info mc3230_info = …;
static int mc3230_probe(struct i2c_client *client)
{ … }
static void mc3230_remove(struct i2c_client *client)
{ … }
static int mc3230_suspend(struct device *dev)
{ … }
static int mc3230_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(mc3230_pm_ops, mc3230_suspend, mc3230_resume);
static const struct i2c_device_id mc3230_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, mc3230_i2c_id);
static struct i2c_driver mc3230_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;