linux/drivers/staging/iio/accel/adis16203.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * ADIS16203 Programmable 360 Degrees Inclinometer
 *
 * Copyright 2010 Analog Devices Inc.
 */

#include <linux/device.h>

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

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

#define ADIS16203_STARTUP_DELAY

/* Flash memory write count */
#define ADIS16203_FLASH_CNT

/* Output, power supply */
#define ADIS16203_SUPPLY_OUT

/* Output, auxiliary ADC input */
#define ADIS16203_AUX_ADC

/* Output, temperature */
#define ADIS16203_TEMP_OUT

/* Output, x-axis inclination */
#define ADIS16203_XINCL_OUT

/* Output, y-axis inclination */
#define ADIS16203_YINCL_OUT

/* Incline null calibration */
#define ADIS16203_INCL_NULL

/* Alarm 1 amplitude threshold */
#define ADIS16203_ALM_MAG1

/* Alarm 2 amplitude threshold */
#define ADIS16203_ALM_MAG2

/* Alarm 1, sample period */
#define ADIS16203_ALM_SMPL1

/* Alarm 2, sample period */
#define ADIS16203_ALM_SMPL2

/* Alarm control */
#define ADIS16203_ALM_CTRL

/* Auxiliary DAC data */
#define ADIS16203_AUX_DAC

/* General-purpose digital input/output control */
#define ADIS16203_GPIO_CTRL

/* Miscellaneous control */
#define ADIS16203_MSC_CTRL

/* Internal sample period (rate) control */
#define ADIS16203_SMPL_PRD

/* Operation, filter configuration */
#define ADIS16203_AVG_CNT

/* Operation, sleep mode control */
#define ADIS16203_SLP_CNT

/* Diagnostics, system status register */
#define ADIS16203_DIAG_STAT

/* Operation, system command register */
#define ADIS16203_GLOB_CMD

/* MSC_CTRL */

/* Self-test at power-on: 1 = disabled, 0 = enabled */
#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST

/* Reverses rotation of both inclination outputs */
#define ADIS16203_MSC_CTRL_REVERSE_ROT_EN

/* Self-test enable */
#define ADIS16203_MSC_CTRL_SELF_TEST_EN

/* Data-ready enable: 1 = enabled, 0 = disabled */
#define ADIS16203_MSC_CTRL_DATA_RDY_EN

/* Data-ready polarity: 1 = active high, 0 = active low */
#define ADIS16203_MSC_CTRL_ACTIVE_HIGH

/* Data-ready line selection: 1 = DIO1, 0 = DIO0 */
#define ADIS16203_MSC_CTRL_DATA_RDY_DIO1

/* DIAG_STAT */

/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
#define ADIS16203_DIAG_STAT_ALARM2

/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
#define ADIS16203_DIAG_STAT_ALARM1

/* Self-test diagnostic error flag */
#define ADIS16203_DIAG_STAT_SELFTEST_FAIL_BIT

/* SPI communications failure */
#define ADIS16203_DIAG_STAT_SPI_FAIL_BIT

/* Flash update failure */
#define ADIS16203_DIAG_STAT_FLASH_UPT_BIT

/* Power supply above 3.625 V */
#define ADIS16203_DIAG_STAT_POWER_HIGH_BIT

/* Power supply below 2.975 V */
#define ADIS16203_DIAG_STAT_POWER_LOW_BIT

/* GLOB_CMD */

#define ADIS16203_GLOB_CMD_SW_RESET
#define ADIS16203_GLOB_CMD_CLEAR_STAT
#define ADIS16203_GLOB_CMD_FACTORY_CAL

#define ADIS16203_ERROR_ACTIVE

enum adis16203_scan {};

#define DRIVER_NAME

static const u8 adis16203_addresses[] =;

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

static int adis16203_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 adis16203_channels[] =;

static const struct iio_info adis16203_info =;

static const char * const adis16203_status_error_msgs[] =;

static const struct adis_timeout adis16203_timeouts =;

static const struct adis_data adis16203_data =;

static int adis16203_probe(struct spi_device *spi)
{}

static const struct of_device_id adis16203_of_match[] =;

MODULE_DEVICE_TABLE(of, adis16203_of_match);

static struct spi_driver adis16203_driver =;
module_spi_driver();

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