linux/drivers/iio/accel/adxl367.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2021 Analog Devices, Inc.
 * Author: Cosmin Tanislav <[email protected]>
 */

#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/iio/buffer.h>
#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/sysfs.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mod_devicetable.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <asm/unaligned.h>

#include "adxl367.h"

#define ADXL367_REG_DEVID
#define ADXL367_DEVID_AD

#define ADXL367_REG_STATUS
#define ADXL367_STATUS_INACT_MASK
#define ADXL367_STATUS_ACT_MASK
#define ADXL367_STATUS_FIFO_FULL_MASK

#define ADXL367_FIFO_ENT_H_MASK

#define ADXL367_REG_X_DATA_H
#define ADXL367_REG_Y_DATA_H
#define ADXL367_REG_Z_DATA_H
#define ADXL367_REG_TEMP_DATA_H
#define ADXL367_REG_EX_ADC_DATA_H
#define ADXL367_DATA_MASK

#define ADXL367_TEMP_25C
#define ADXL367_TEMP_PER_C

#define ADXL367_VOLTAGE_OFFSET
#define ADXL367_VOLTAGE_MAX_MV
#define ADXL367_VOLTAGE_MAX_RAW

#define ADXL367_REG_RESET
#define ADXL367_RESET_CODE

#define ADXL367_REG_THRESH_ACT_H
#define ADXL367_REG_THRESH_INACT_H
#define ADXL367_THRESH_MAX
#define ADXL367_THRESH_VAL_H_MASK
#define ADXL367_THRESH_H_MASK
#define ADXL367_THRESH_VAL_L_MASK
#define ADXL367_THRESH_L_MASK

#define ADXL367_REG_TIME_ACT
#define ADXL367_REG_TIME_INACT_H
#define ADXL367_TIME_ACT_MAX
#define ADXL367_TIME_INACT_MAX
#define ADXL367_TIME_INACT_VAL_H_MASK
#define ADXL367_TIME_INACT_H_MASK
#define ADXL367_TIME_INACT_VAL_L_MASK
#define ADXL367_TIME_INACT_L_MASK

#define ADXL367_REG_ACT_INACT_CTL
#define ADXL367_ACT_EN_MASK
#define ADXL367_ACT_LINKLOOP_MASK

#define ADXL367_REG_FIFO_CTL
#define ADXL367_FIFO_CTL_FORMAT_MASK
#define ADXL367_FIFO_CTL_MODE_MASK

#define ADXL367_REG_FIFO_SAMPLES
#define ADXL367_FIFO_SIZE
#define ADXL367_FIFO_MAX_WATERMARK

#define ADXL367_SAMPLES_VAL_H_MASK
#define ADXL367_SAMPLES_H_MASK
#define ADXL367_SAMPLES_VAL_L_MASK
#define ADXL367_SAMPLES_L_MASK

#define ADXL367_REG_INT1_MAP
#define ADXL367_INT_INACT_MASK
#define ADXL367_INT_ACT_MASK
#define ADXL367_INT_FIFO_WATERMARK_MASK

#define ADXL367_REG_FILTER_CTL
#define ADXL367_FILTER_CTL_RANGE_MASK
#define ADXL367_2G_RANGE_1G
#define ADXL367_2G_RANGE_100MG
#define ADXL367_FILTER_CTL_ODR_MASK

#define ADXL367_REG_POWER_CTL
#define ADXL367_POWER_CTL_MODE_MASK

#define ADXL367_REG_ADC_CTL
#define ADXL367_REG_TEMP_CTL
#define ADXL367_ADC_EN_MASK

enum adxl367_range {};

enum adxl367_fifo_mode {};

enum adxl367_fifo_format {};

enum adxl367_op_mode {};

enum adxl367_act_proc_mode {};

enum adxl367_act_en_mode {};

enum adxl367_activity_type {};

enum adxl367_odr {};

struct adxl367_state {};

static const unsigned int adxl367_threshold_h_reg_tbl[] =;

static const unsigned int adxl367_act_en_shift_tbl[] =;

static const unsigned int adxl367_act_int_mask_tbl[] =;

static const int adxl367_samp_freq_tbl[][2] =;

/* (g * 2) * 9.80665 * 1000000 / (2^14 - 1) */
static const int adxl367_range_scale_tbl[][2] =;

static const int adxl367_range_scale_factor_tbl[] =;

enum {};

#define ADXL367_X_CHANNEL_MASK
#define ADXL367_Y_CHANNEL_MASK
#define ADXL367_Z_CHANNEL_MASK
#define ADXL367_TEMP_CHANNEL_MASK
#define ADXL367_EX_ADC_CHANNEL_MASK

static const enum adxl367_fifo_format adxl367_fifo_formats[] =;

static const unsigned long adxl367_channel_masks[] =;

static int adxl367_set_measure_en(struct adxl367_state *st, bool en)
{}

static void adxl367_scale_act_thresholds(struct adxl367_state *st,
					 enum adxl367_range old_range,
					 enum adxl367_range new_range)
{}

static int _adxl367_set_act_threshold(struct adxl367_state *st,
				      enum adxl367_activity_type act,
				      unsigned int threshold)
{}

static int adxl367_set_act_threshold(struct adxl367_state *st,
				     enum adxl367_activity_type act,
				     unsigned int threshold)
{}

static int adxl367_set_act_proc_mode(struct adxl367_state *st,
				     enum adxl367_act_proc_mode mode)
{}

static int adxl367_set_act_interrupt_en(struct adxl367_state *st,
					enum adxl367_activity_type act,
					bool en)
{}

static int adxl367_get_act_interrupt_en(struct adxl367_state *st,
					enum adxl367_activity_type act,
					bool *en)
{}

static int adxl367_set_act_en(struct adxl367_state *st,
			      enum adxl367_activity_type act,
			      enum adxl367_act_en_mode en)
{}

static int adxl367_set_fifo_watermark_interrupt_en(struct adxl367_state *st,
						   bool en)
{}

static int adxl367_get_fifo_mode(struct adxl367_state *st,
				 enum adxl367_fifo_mode *fifo_mode)
{}

static int adxl367_set_fifo_mode(struct adxl367_state *st,
				 enum adxl367_fifo_mode fifo_mode)
{}

static int adxl367_set_fifo_format(struct adxl367_state *st,
				   enum adxl367_fifo_format fifo_format)
{}

static int adxl367_set_fifo_watermark(struct adxl367_state *st,
				      unsigned int fifo_watermark)
{}

static int adxl367_set_range(struct iio_dev *indio_dev,
			     enum adxl367_range range)
{}

static int adxl367_time_ms_to_samples(struct adxl367_state *st, unsigned int ms)
{}

static int _adxl367_set_act_time_ms(struct adxl367_state *st, unsigned int ms)
{}

static int _adxl367_set_inact_time_ms(struct adxl367_state *st, unsigned int ms)
{}

static int adxl367_set_act_time_ms(struct adxl367_state *st,
				   enum adxl367_activity_type act,
				   unsigned int ms)
{}

static int _adxl367_set_odr(struct adxl367_state *st, enum adxl367_odr odr)
{}

static int adxl367_set_odr(struct iio_dev *indio_dev, enum adxl367_odr odr)
{}

static int adxl367_set_temp_adc_en(struct adxl367_state *st, unsigned int reg,
				   bool en)
{}

static int adxl367_set_temp_adc_reg_en(struct adxl367_state *st,
				       unsigned int reg, bool en)
{}

static int adxl367_set_temp_adc_mask_en(struct adxl367_state *st,
					const unsigned long *active_scan_mask,
					bool en)
{}

static int adxl367_find_odr(struct adxl367_state *st, int val, int val2,
			    enum adxl367_odr *odr)
{}

static int adxl367_find_range(struct adxl367_state *st, int val, int val2,
			      enum adxl367_range *range)
{}

static int adxl367_read_sample(struct iio_dev *indio_dev,
			       struct iio_chan_spec const *chan,
			       int *val)
{}

static int adxl367_get_status(struct adxl367_state *st, u8 *status,
			      u16 *fifo_entries)
{}

static bool adxl367_push_event(struct iio_dev *indio_dev, u8 status)
{}

static bool adxl367_push_fifo_data(struct iio_dev *indio_dev, u8 status,
				   u16 fifo_entries)
{}

static irqreturn_t adxl367_irq_handler(int irq, void *private)
{}

static int adxl367_reg_access(struct iio_dev *indio_dev,
			      unsigned int reg,
			      unsigned int writeval,
			      unsigned int *readval)
{}

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

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

static int adxl367_write_raw_get_fmt(struct iio_dev *indio_dev,
				     struct iio_chan_spec const *chan,
				     long info)
{}

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

static int adxl367_read_event_value(struct iio_dev *indio_dev,
				    const struct iio_chan_spec *chan,
				    enum iio_event_type type,
				    enum iio_event_direction dir,
				    enum iio_event_info info,
				    int *val, int *val2)
{}

static int adxl367_write_event_value(struct iio_dev *indio_dev,
				     const struct iio_chan_spec *chan,
				     enum iio_event_type type,
				     enum iio_event_direction dir,
				     enum iio_event_info info,
				     int val, int val2)
{}

static int adxl367_read_event_config(struct iio_dev *indio_dev,
				     const struct iio_chan_spec *chan,
				     enum iio_event_type type,
				     enum iio_event_direction dir)
{}

static int adxl367_write_event_config(struct iio_dev *indio_dev,
				      const struct iio_chan_spec *chan,
				      enum iio_event_type type,
				      enum iio_event_direction dir,
				      int state)
{}

static ssize_t adxl367_get_fifo_enabled(struct device *dev,
					struct device_attribute *attr,
					char *buf)
{}

static ssize_t adxl367_get_fifo_watermark(struct device *dev,
					  struct device_attribute *attr,
					  char *buf)
{}

IIO_STATIC_CONST_DEVICE_ATTR();
IIO_STATIC_CONST_DEVICE_ATTR();
static IIO_DEVICE_ATTR(hwfifo_watermark, 0444,
		       adxl367_get_fifo_watermark, NULL, 0);
static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,
		       adxl367_get_fifo_enabled, NULL, 0);

static const struct iio_dev_attr *adxl367_fifo_attributes[] =;

static int adxl367_set_watermark(struct iio_dev *indio_dev, unsigned int val)
{}

static bool adxl367_find_mask_fifo_format(const unsigned long *scan_mask,
					  enum adxl367_fifo_format *fifo_format)
{}

static int adxl367_update_scan_mode(struct iio_dev *indio_dev,
				    const unsigned long *active_scan_mask)
{}

static int adxl367_buffer_postenable(struct iio_dev *indio_dev)
{}

static int adxl367_buffer_predisable(struct iio_dev *indio_dev)
{}

static const struct iio_buffer_setup_ops adxl367_buffer_ops =;

static const struct iio_info adxl367_info =;

static const struct iio_event_spec adxl367_events[] =;

#define ADXL367_ACCEL_CHANNEL(index, reg, axis)

#define ADXL367_CHANNEL(index, reg, _type)

static const struct iio_chan_spec adxl367_channels[] =;

static int adxl367_verify_devid(struct adxl367_state *st)
{}

static int adxl367_setup(struct adxl367_state *st)
{}

int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
		  void *context, struct regmap *regmap, int irq)
{}
EXPORT_SYMBOL_NS_GPL();

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