linux/drivers/iio/gyro/adxrs450.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ADXRS450/ADXRS453 Digital Output Gyroscope Driver
 *
 * Copyright 2011 Analog Devices Inc.
 */

#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/list.h>
#include <linux/module.h>

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

#define ADXRS450_STARTUP_DELAY

/* The MSB for the spi commands */
#define ADXRS450_SENSOR_DATA
#define ADXRS450_WRITE_DATA
#define ADXRS450_READ_DATA

#define ADXRS450_RATE1
#define ADXRS450_TEMP1
#define ADXRS450_LOCST1
#define ADXRS450_HICST1
#define ADXRS450_QUAD1
#define ADXRS450_FAULT1
#define ADXRS450_PID1
#define ADXRS450_SNH
#define ADXRS450_SNL
#define ADXRS450_DNC1
/* Check bits */
#define ADXRS450_P
#define ADXRS450_CHK
#define ADXRS450_CST
#define ADXRS450_PWR
#define ADXRS450_POR
#define ADXRS450_NVM
#define ADXRS450_Q
#define ADXRS450_PLL
#define ADXRS450_UV
#define ADXRS450_OV
#define ADXRS450_AMP
#define ADXRS450_FAIL

#define ADXRS450_WRERR_MASK

#define ADXRS450_MAX_RX
#define ADXRS450_MAX_TX

#define ADXRS450_GET_ST(a)

enum {};

/**
 * struct adxrs450_state - device instance specific data
 * @us:			actual spi_device
 * @buf_lock:		mutex to protect tx and rx
 * @tx:			transmit buffer
 * @rx:			receive buffer
 **/
struct adxrs450_state {};

/**
 * adxrs450_spi_read_reg_16() - read 2 bytes from a register pair
 * @indio_dev: device associated with child of actual iio_dev
 * @reg_address: the address of the lower of the two registers, which should be
 *	an even address, the second register's address is reg_address + 1.
 * @val: somewhere to pass back the value read
 **/
static int adxrs450_spi_read_reg_16(struct iio_dev *indio_dev,
				    u8 reg_address,
				    u16 *val)
{}

/**
 * adxrs450_spi_write_reg_16() - write 2 bytes data to a register pair
 * @indio_dev: device associated with child of actual actual iio_dev
 * @reg_address: the address of the lower of the two registers,which should be
 *	an even address, the second register's address is reg_address + 1.
 * @val: value to be written.
 **/
static int adxrs450_spi_write_reg_16(struct iio_dev *indio_dev,
				     u8 reg_address,
				     u16 val)
{}

/**
 * adxrs450_spi_sensor_data() - read 2 bytes sensor data
 * @indio_dev: device associated with child of actual iio_dev
 * @val: somewhere to pass back the value read
 **/
static int adxrs450_spi_sensor_data(struct iio_dev *indio_dev, s16 *val)
{}

/**
 * adxrs450_spi_initial() - use for initializing procedure.
 * @st: device instance specific data
 * @val: somewhere to pass back the value read
 * @chk: Whether to perform fault check
 **/
static int adxrs450_spi_initial(struct adxrs450_state *st,
		u32 *val, char chk)
{}

/* Recommended Startup Sequence by spec */
static int adxrs450_initial_setup(struct iio_dev *indio_dev)
{}

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

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

static const struct iio_chan_spec adxrs450_channels[2][2] =;

static const struct iio_info adxrs450_info =;

static int adxrs450_probe(struct spi_device *spi)
{}

static const struct spi_device_id adxrs450_id[] =;
MODULE_DEVICE_TABLE(spi, adxrs450_id);

static struct spi_driver adxrs450_driver =;
module_spi_driver();

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