linux/drivers/iio/accel/da280.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * IIO driver for the MiraMEMS DA217 and DA280 3-axis accelerometer and
 * IIO driver for the MiraMEMS DA226 2-axis accelerometer
 *
 * Copyright (c) 2016 Hans de Goede <[email protected]>
 */

#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/acpi.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/byteorder/generic.h>

#define DA280_REG_CHIP_ID
#define DA280_REG_ACC_X_LSB
#define DA280_REG_ACC_Y_LSB
#define DA280_REG_ACC_Z_LSB
#define DA280_REG_MODE_BW

#define DA280_CHIP_ID
#define DA280_MODE_ENABLE
#define DA280_MODE_DISABLE

/*
 * a value of + or -4096 corresponds to + or - 1G
 * scale = 9.81 / 4096 = 0.002395019
 */

static const int da280_nscale =;

#define DA280_CHANNEL(reg, axis)

static const struct iio_chan_spec da280_channels[] =;

struct da280_match_data {};

struct da280_data {};

static int da280_enable(struct i2c_client *client, bool enable)
{}

static int da280_read_raw(struct iio_dev *indio_dev,
				struct iio_chan_spec const *chan,
				int *val, int *val2, long mask)
{}

static const struct iio_info da280_info =;

static void da280_disable(void *client)
{}

static int da280_probe(struct i2c_client *client)
{}

static int da280_suspend(struct device *dev)
{}

static int da280_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(da280_pm_ops, da280_suspend, da280_resume);

static const struct da280_match_data da217_match_data =;
static const struct da280_match_data da226_match_data =;
static const struct da280_match_data da280_match_data =;

static const struct acpi_device_id da280_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, da280_acpi_match);

static const struct i2c_device_id da280_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, da280_i2c_id);

static struct i2c_driver da280_driver =;

module_i2c_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();