linux/drivers/iio/gyro/adis16260.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ADIS16260/ADIS16265 Programmable Digital Gyroscope Sensor Driver
 *
 * Copyright 2010 Analog Devices Inc.
 */

#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/module.h>

#include <linux/iio/iio.h>
#include <linux/iio/imu/adis.h>

#define ADIS16260_STARTUP_DELAY

#define ADIS16260_FLASH_CNT
#define ADIS16260_SUPPLY_OUT
#define ADIS16260_GYRO_OUT
#define ADIS16260_AUX_ADC
#define ADIS16260_TEMP_OUT
#define ADIS16260_ANGL_OUT
#define ADIS16260_GYRO_OFF
#define ADIS16260_GYRO_SCALE
#define ADIS16260_ALM_MAG1
#define ADIS16260_ALM_MAG2
#define ADIS16260_ALM_SMPL1
#define ADIS16260_ALM_SMPL2
#define ADIS16260_ALM_CTRL
#define ADIS16260_AUX_DAC
#define ADIS16260_GPIO_CTRL
#define ADIS16260_MSC_CTRL
#define ADIS16260_SMPL_PRD
#define ADIS16260_SENS_AVG
#define ADIS16260_SLP_CNT
#define ADIS16260_DIAG_STAT
#define ADIS16260_GLOB_CMD
#define ADIS16260_LOT_ID1
#define ADIS16260_LOT_ID2
#define ADIS16260_PROD_ID
#define ADIS16260_SERIAL_NUM

#define ADIS16260_ERROR_ACTIVE
#define ADIS16260_NEW_DATA

/* MSC_CTRL */
#define ADIS16260_MSC_CTRL_MEM_TEST
/* Internal self-test enable */
#define ADIS16260_MSC_CTRL_INT_SELF_TEST
#define ADIS16260_MSC_CTRL_NEG_SELF_TEST
#define ADIS16260_MSC_CTRL_POS_SELF_TEST
#define ADIS16260_MSC_CTRL_DATA_RDY_EN
#define ADIS16260_MSC_CTRL_DATA_RDY_POL_HIGH
#define ADIS16260_MSC_CTRL_DATA_RDY_DIO2

/* SMPL_PRD */
/* Time base (tB): 0 = 1.953 ms, 1 = 60.54 ms */
#define ADIS16260_SMPL_PRD_TIME_BASE
#define ADIS16260_SMPL_PRD_DIV_MASK

/* SLP_CNT */
#define ADIS16260_SLP_CNT_POWER_OFF

/* DIAG_STAT */
#define ADIS16260_DIAG_STAT_ALARM2
#define ADIS16260_DIAG_STAT_ALARM1
#define ADIS16260_DIAG_STAT_FLASH_CHK_BIT
#define ADIS16260_DIAG_STAT_SELF_TEST_BIT
#define ADIS16260_DIAG_STAT_OVERFLOW_BIT
#define ADIS16260_DIAG_STAT_SPI_FAIL_BIT
#define ADIS16260_DIAG_STAT_FLASH_UPT_BIT
#define ADIS16260_DIAG_STAT_POWER_HIGH_BIT
#define ADIS16260_DIAG_STAT_POWER_LOW_BIT

/* GLOB_CMD */
#define ADIS16260_GLOB_CMD_SW_RESET
#define ADIS16260_GLOB_CMD_FLASH_UPD
#define ADIS16260_GLOB_CMD_DAC_LATCH
#define ADIS16260_GLOB_CMD_FAC_CALIB
#define ADIS16260_GLOB_CMD_AUTO_NULL

#define ADIS16260_SPI_SLOW
#define ADIS16260_SPI_BURST
#define ADIS16260_SPI_FAST

/* At the moment triggers are only used for ring buffer
 * filling. This may change!
 */

#define ADIS16260_SCAN_GYRO
#define ADIS16260_SCAN_SUPPLY
#define ADIS16260_SCAN_AUX_ADC
#define ADIS16260_SCAN_TEMP
#define ADIS16260_SCAN_ANGL

struct adis16260_chip_info {};

struct adis16260 {};

enum adis16260_type {};

static const struct iio_chan_spec adis16260_channels[] =;

static const struct iio_chan_spec adis16266_channels[] =;

static const struct adis16260_chip_info adis16260_chip_info_table[] =;

/* Power down the device */
static int adis16260_stop_device(struct iio_dev *indio_dev)
{}

static const u8 adis16260_addresses[][2] =;

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

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

static const struct iio_info adis16260_info =;

static const char * const adis1620_status_error_msgs[] =;

static const struct adis_timeout adis16260_timeouts =;

static const struct adis_data adis16260_data =;

static void adis16260_stop(void *data)
{}

static int adis16260_probe(struct spi_device *spi)
{}

/*
 * These parts do not need to be differentiated until someone adds
 * support for the on chip filtering.
 */
static const struct spi_device_id adis16260_id[] =;
MODULE_DEVICE_TABLE(spi, adis16260_id);

static struct spi_driver adis16260_driver =;
module_spi_driver();

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