linux/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.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_GYRO_CHAN(_modifier, _index, _ext_info)

enum inv_icm42600_gyro_scan {};

static const struct iio_chan_spec_ext_info inv_icm42600_gyro_ext_infos[] =;

static const struct iio_chan_spec inv_icm42600_gyro_channels[] =;

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

#define INV_ICM42600_SCAN_MASK_GYRO_3AXIS

#define INV_ICM42600_SCAN_MASK_TEMP

static const unsigned long inv_icm42600_gyro_scan_masks[] =;

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

static int inv_icm42600_gyro_read_sensor(struct inv_icm42600_state *st,
					 struct iio_chan_spec const *chan,
					 int16_t *val)
{}

/* IIO format int + nano */
static const int inv_icm42600_gyro_scale[] =;
static const int inv_icm42686_gyro_scale[] =;

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

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

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

static const int inv_icm42600_gyro_odr_conv[] =;

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

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

/*
 * Calibration bias values, IIO range format int + nano.
 * Value is limited to +/-64dps coded on 12 bits signed. Step is 1/32 dps.
 */
static int inv_icm42600_gyro_calibbias[] =;

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

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

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

static int inv_icm42600_gyro_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_gyro_write_raw(struct iio_dev *indio_dev,
				       struct iio_chan_spec const *chan,
				       int val, int val2, long mask)
{}

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

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

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

static const struct iio_info inv_icm42600_gyro_info =;

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

int inv_icm42600_gyro_parse_fifo(struct iio_dev *indio_dev)
{}