linux/drivers/iio/accel/mma7455_core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * IIO accel core driver for Freescale MMA7455L 3-axis 10-bit accelerometer
 * Copyright 2015 Joachim Eastwood <[email protected]>
 *
 * UNSUPPORTED hardware features:
 *  - 8-bit mode with different scales
 *  - INT1/INT2 interrupts
 *  - Offset calibration
 *  - Events
 */

#include <linux/delay.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/module.h>
#include <linux/regmap.h>

#include "mma7455.h"

#define MMA7455_REG_XOUTL
#define MMA7455_REG_XOUTH
#define MMA7455_REG_YOUTL
#define MMA7455_REG_YOUTH
#define MMA7455_REG_ZOUTL
#define MMA7455_REG_ZOUTH
#define MMA7455_REG_STATUS
#define MMA7455_STATUS_DRDY
#define MMA7455_REG_WHOAMI
#define MMA7455_WHOAMI_ID
#define MMA7455_REG_MCTL
#define MMA7455_MCTL_MODE_STANDBY
#define MMA7455_MCTL_MODE_MEASURE
#define MMA7455_REG_CTL1
#define MMA7455_CTL1_DFBW_MASK
#define MMA7455_CTL1_DFBW_125HZ
#define MMA7455_CTL1_DFBW_62_5HZ
#define MMA7455_REG_TW

/*
 * When MMA7455 is used in 10-bit it has a fullscale of -8g
 * corresponding to raw value -512. The userspace interface
 * uses m/s^2 and we declare micro units.
 * So scale factor is given by:
 *       g * 8 * 1e6 / 512 = 153228.90625, with g = 9.80665
 */
#define MMA7455_10BIT_SCALE

struct mma7455_data {};

static int mma7455_drdy(struct mma7455_data *mma7455)
{}

static irqreturn_t mma7455_trigger_handler(int irq, void *p)
{}

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

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

static IIO_CONST_ATTR(sampling_frequency_available, "125 250");

static struct attribute *mma7455_attributes[] =;

static const struct attribute_group mma7455_group =;

static const struct iio_info mma7455_info =;

#define MMA7455_CHANNEL(axis, idx)

static const struct iio_chan_spec mma7455_channels[] =;

static const unsigned long mma7455_scan_masks[] =;

const struct regmap_config mma7455_core_regmap =;
EXPORT_SYMBOL_NS_GPL();

int mma7455_core_probe(struct device *dev, struct regmap *regmap,
		       const char *name)
{}
EXPORT_SYMBOL_NS_GPL();

void mma7455_core_remove(struct device *dev)
{}
EXPORT_SYMBOL_NS_GPL();

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