linux/drivers/iio/accel/adxl355_core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ADXL355 3-Axis Digital Accelerometer IIO core driver
 *
 * Copyright (c) 2021 Puranjay Mohan <[email protected]>
 *
 * Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/adxl354_adxl355.pdf
 */

#include <linux/bits.h>
#include <linux/bitfield.h>
#include <linux/iio/buffer.h>
#include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/limits.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/units.h>

#include <linux/unaligned.h>

#include "adxl355.h"

/* ADXL355 Register Definitions */
#define ADXL355_DEVID_AD_REG
#define ADXL355_DEVID_MST_REG
#define ADXL355_PARTID_REG
#define ADXL355_STATUS_REG
#define ADXL355_FIFO_ENTRIES_REG
#define ADXL355_TEMP2_REG
#define ADXL355_XDATA3_REG
#define ADXL355_YDATA3_REG
#define ADXL355_ZDATA3_REG
#define ADXL355_FIFO_DATA_REG
#define ADXL355_OFFSET_X_H_REG
#define ADXL355_OFFSET_Y_H_REG
#define ADXL355_OFFSET_Z_H_REG
#define ADXL355_ACT_EN_REG
#define ADXL355_ACT_THRESH_H_REG
#define ADXL355_ACT_THRESH_L_REG
#define ADXL355_ACT_COUNT_REG
#define ADXL355_FILTER_REG
#define ADXL355_FILTER_ODR_MSK
#define ADXL355_FILTER_HPF_MSK
#define ADXL355_FIFO_SAMPLES_REG
#define ADXL355_INT_MAP_REG
#define ADXL355_SYNC_REG
#define ADXL355_RANGE_REG
#define ADXL355_POWER_CTL_REG
#define ADXL355_POWER_CTL_MODE_MSK
#define ADXL355_POWER_CTL_DRDY_MSK
#define ADXL355_SELF_TEST_REG
#define ADXL355_RESET_REG

#define ADXL355_DEVID_AD_VAL
#define ADXL355_DEVID_MST_VAL
#define ADXL355_PARTID_VAL
#define ADXL359_PARTID_VAL
#define ADXL355_RESET_CODE

static const struct regmap_range adxl355_read_reg_range[] =;

const struct regmap_access_table adxl355_readable_regs_tbl =;
EXPORT_SYMBOL_NS_GPL();

static const struct regmap_range adxl355_write_reg_range[] =;

const struct regmap_access_table adxl355_writeable_regs_tbl =;
EXPORT_SYMBOL_NS_GPL();

const struct adxl355_chip_info adxl35x_chip_info[] =;
EXPORT_SYMBOL_NS_GPL();

enum adxl355_op_mode {};

enum adxl355_odr {};

enum adxl355_hpf_3db {};

static const int adxl355_odr_table[][2] =;

static const int adxl355_hpf_3db_multipliers[] =;

enum adxl355_chans {};

struct adxl355_chan_info {};

static const struct adxl355_chan_info adxl355_chans[] =;

struct adxl355_data {};

static int adxl355_set_op_mode(struct adxl355_data *data,
			       enum adxl355_op_mode op_mode)
{}

static int adxl355_data_rdy_trigger_set_state(struct iio_trigger *trig,
					      bool state)
{}

static void adxl355_fill_3db_frequency_table(struct adxl355_data *data)
{}

static int adxl355_setup(struct adxl355_data *data)
{}

static int adxl355_get_temp_data(struct adxl355_data *data, u8 addr)
{}

static int adxl355_read_axis(struct adxl355_data *data, u8 addr)
{}

static int adxl355_find_match(const int (*freq_tbl)[2], const int n,
			      const int val, const int val2)
{}

static int adxl355_set_odr(struct adxl355_data *data,
			   enum adxl355_odr odr)
{}

static int adxl355_set_hpf_3db(struct adxl355_data *data,
			       enum adxl355_hpf_3db hpf)
{}

static int adxl355_set_calibbias(struct adxl355_data *data,
				 enum adxl355_chans chan, int calibbias)
{}

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

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

static int adxl355_read_avail(struct iio_dev *indio_dev,
			      struct iio_chan_spec const *chan,
			      const int **vals, int *type, int *length,
			      long mask)
{}

static const unsigned long adxl355_avail_scan_masks[] =;

static const struct iio_info adxl355_info =;

static const struct iio_trigger_ops adxl355_trigger_ops =;

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

#define ADXL355_ACCEL_CHANNEL(index, reg, axis)

static const struct iio_chan_spec adxl355_channels[] =;

static int adxl355_probe_trigger(struct iio_dev *indio_dev, int irq)
{}

int adxl355_core_probe(struct device *dev, struct regmap *regmap,
		       const struct adxl355_chip_info *chip_info)
{}
EXPORT_SYMBOL_NS_GPL();

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