#include <linux/bits.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/iio/buffer.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#define BMA220_REG_ID …
#define BMA220_REG_ACCEL_X …
#define BMA220_REG_ACCEL_Y …
#define BMA220_REG_ACCEL_Z …
#define BMA220_REG_RANGE …
#define BMA220_REG_SUSPEND …
#define BMA220_CHIP_ID …
#define BMA220_READ_MASK …
#define BMA220_RANGE_MASK …
#define BMA220_SUSPEND_SLEEP …
#define BMA220_SUSPEND_WAKE …
#define BMA220_DEVICE_NAME …
#define BMA220_ACCEL_CHANNEL(index, reg, axis) …
enum bma220_axis { … };
static const int bma220_scale_table[][2] = …;
struct bma220_data { … };
static const struct iio_chan_spec bma220_channels[] = …;
static inline int bma220_read_reg(struct spi_device *spi, u8 reg)
{ … }
static const unsigned long bma220_accel_scan_masks[] = …;
static irqreturn_t bma220_trigger_handler(int irq, void *p)
{ … }
static int bma220_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int bma220_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int bma220_read_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals, int *type, int *length,
long mask)
{ … }
static const struct iio_info bma220_info = …;
static int bma220_init(struct spi_device *spi)
{ … }
static int bma220_power(struct spi_device *spi, bool up)
{ … }
static void bma220_deinit(void *spi)
{ … }
static int bma220_probe(struct spi_device *spi)
{ … }
static int bma220_suspend(struct device *dev)
{ … }
static int bma220_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(bma220_pm_ops, bma220_suspend, bma220_resume);
static const struct spi_device_id bma220_spi_id[] = …;
static const struct acpi_device_id bma220_acpi_id[] = …;
MODULE_DEVICE_TABLE(spi, bma220_spi_id);
static struct spi_driver bma220_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;