linux/drivers/iio/accel/mxc6255.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * MXC6255 - MEMSIC orientation sensing accelerometer
 *
 * Copyright (c) 2015, Intel Corporation.
 *
 * IIO driver for MXC6255 (7-bit I2C slave address 0x15).
 */

#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/iio/iio.h>
#include <linux/delay.h>
#include <linux/mod_devicetable.h>
#include <linux/regmap.h>
#include <linux/iio/sysfs.h>

#define MXC6255_DRV_NAME
#define MXC6255_REGMAP_NAME

#define MXC6255_REG_XOUT
#define MXC6255_REG_YOUT
#define MXC6255_REG_CHIP_ID

#define MXC6255_CHIP_ID

/*
 * MXC6255 has only one measurement range: +/- 2G.
 * The acceleration output is an 8-bit value.
 *
 * Scale is calculated as follows:
 * (2 + 2) * 9.80665 / (2^8 - 1) = 0.153829
 *
 * Scale value for +/- 2G measurement range
 */
#define MXC6255_SCALE

enum mxc6255_axis {};

struct mxc6255_data {};

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

static const struct iio_info mxc6255_info =;

#define MXC6255_CHANNEL(_axis, reg)

static const struct iio_chan_spec mxc6255_channels[] =;

static bool mxc6255_is_readable_reg(struct device *dev, unsigned int reg)
{}

static const struct regmap_config mxc6255_regmap_config =;

static int mxc6255_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver mxc6255_driver =;

module_i2c_driver();

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