linux/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2020 Invensense, Inc.
 */

#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/delay.h>
#include <linux/math64.h>

#include <linux/iio/buffer.h>
#include <linux/iio/common/inv_sensors_timestamp.h>
#include <linux/iio/iio.h>
#include <linux/iio/kfifo_buf.h>

#include "inv_icm42600.h"
#include "inv_icm42600_temp.h"
#include "inv_icm42600_buffer.h"

#define INV_ICM42600_ACCEL_CHAN(_modifier, _index, _ext_info)

enum inv_icm42600_accel_scan {};

static const char * const inv_icm42600_accel_power_mode_items[] =;
static const int inv_icm42600_accel_power_mode_values[] =;
static const int inv_icm42600_accel_filter_values[] =;

static int inv_icm42600_accel_power_mode_set(struct iio_dev *indio_dev,
					     const struct iio_chan_spec *chan,
					     unsigned int idx)
{}

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

static const struct iio_enum inv_icm42600_accel_power_mode_enum =;

static const struct iio_chan_spec_ext_info inv_icm42600_accel_ext_infos[] =;

static const struct iio_chan_spec inv_icm42600_accel_channels[] =;

/*
 * IIO buffer data: size must be a power of 2 and timestamp aligned
 * 16 bytes: 6 bytes acceleration, 2 bytes temperature, 8 bytes timestamp
 */
struct inv_icm42600_accel_buffer {};

#define INV_ICM42600_SCAN_MASK_ACCEL_3AXIS

#define INV_ICM42600_SCAN_MASK_TEMP

static const unsigned long inv_icm42600_accel_scan_masks[] =;

/* enable accelerometer sensor and FIFO write */
static int inv_icm42600_accel_update_scan_mode(struct iio_dev *indio_dev,
					       const unsigned long *scan_mask)
{}

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

/* IIO format int + nano */
static const int inv_icm42600_accel_scale[] =;
static const int inv_icm42686_accel_scale[] =;

static int inv_icm42600_accel_read_scale(struct iio_dev *indio_dev,
					 int *val, int *val2)
{}

static int inv_icm42600_accel_write_scale(struct iio_dev *indio_dev,
					  int val, int val2)
{}

/* IIO format int + micro */
static const int inv_icm42600_accel_odr[] =;

static const int inv_icm42600_accel_odr_conv[] =;

static int inv_icm42600_accel_read_odr(struct inv_icm42600_state *st,
				       int *val, int *val2)
{}

static int inv_icm42600_accel_write_odr(struct iio_dev *indio_dev,
					int val, int val2)
{}

/*
 * Calibration bias values, IIO range format int + micro.
 * Value is limited to +/-1g coded on 12 bits signed. Step is 0.5mg.
 */
static int inv_icm42600_accel_calibbias[] =;

static int inv_icm42600_accel_read_offset(struct inv_icm42600_state *st,
					  struct iio_chan_spec const *chan,
					  int *val, int *val2)
{}

static int inv_icm42600_accel_write_offset(struct inv_icm42600_state *st,
					   struct iio_chan_spec const *chan,
					   int val, int val2)
{}

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

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

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

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

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

static int inv_icm42600_accel_hwfifo_flush(struct iio_dev *indio_dev,
					   unsigned int count)
{}

static const struct iio_info inv_icm42600_accel_info =;

struct iio_dev *inv_icm42600_accel_init(struct inv_icm42600_state *st)
{}

int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)
{}