#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define MMA7660_DRIVER_NAME …
#define MMA7660_REG_XOUT …
#define MMA7660_REG_YOUT …
#define MMA7660_REG_ZOUT …
#define MMA7660_REG_OUT_BIT_ALERT …
#define MMA7660_REG_MODE …
#define MMA7660_REG_MODE_BIT_MODE …
#define MMA7660_REG_MODE_BIT_TON …
#define MMA7660_I2C_READ_RETRIES …
#define MMA7660_SCALE_AVAIL …
static const int mma7660_nscale = …;
enum mma7660_mode { … };
struct mma7660_data { … };
static const struct iio_mount_matrix *
mma7660_get_mount_matrix(const struct iio_dev *indio_dev,
const struct iio_chan_spec *chan)
{ … }
static const struct iio_chan_spec_ext_info mma7660_ext_info[] = …;
static IIO_CONST_ATTR(in_accel_scale_available, MMA7660_SCALE_AVAIL);
static struct attribute *mma7660_attributes[] = …;
static const struct attribute_group mma7660_attribute_group = …;
#define MMA7660_CHANNEL(reg, axis) …
static const struct iio_chan_spec mma7660_channels[] = …;
static int mma7660_set_mode(struct mma7660_data *data,
enum mma7660_mode mode)
{ … }
static int mma7660_read_accel(struct mma7660_data *data, u8 address)
{ … }
static int mma7660_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static const struct iio_info mma7660_info = …;
static int mma7660_probe(struct i2c_client *client)
{ … }
static void mma7660_remove(struct i2c_client *client)
{ … }
static int mma7660_suspend(struct device *dev)
{ … }
static int mma7660_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(mma7660_pm_ops, mma7660_suspend,
mma7660_resume);
static const struct i2c_device_id mma7660_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, mma7660_i2c_id);
static const struct of_device_id mma7660_of_match[] = …;
MODULE_DEVICE_TABLE(of, mma7660_of_match);
static const struct acpi_device_id mma7660_acpi_id[] = …;
MODULE_DEVICE_TABLE(acpi, mma7660_acpi_id);
static struct i2c_driver mma7660_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;