Source
x
static int rm3100_get_samp_freq(struct rm3100_data *data, int *val, int *val2)
// SPDX-License-Identifier: GPL-2.0
/*
* PNI RM3100 3-axis geomagnetic sensor driver core.
*
* Copyright (C) 2018 Song Qiang <songqiang1304521@gmail.com>
*
* User Manual available at
* <https://www.pnicorp.com/download/rm3100-user-manual/>
*
* TODO: event generation, pm.
*/
/* Cycle Count Registers. */
/* Poll Measurement Mode register. */
/* Continuous Measurement Mode register. */
/* TiMe Rate Configuration register. */
/* Result Status register. */
/* Measurement result registers. */
/*
* This is computed by hand, is the sum of channel storage bits and padding
* bits, which is 4+4+4+12=24 in here.
*/
struct rm3100_data {
struct regmap *regmap;
struct completion measuring_done;
bool use_interrupt;
int conversion_time;
int scale;
u8 buffer[RM3100_SCAN_BYTES];
struct iio_trigger *drdy_trig;
/*
* This lock is for protecting the consistency of series of i2c
* operations, that is, to make sure a measurement process will
* not be interrupted by a set frequency operation, which should
* be taken where a series of i2c operation starts, released where
* the operation ends.
*/
struct mutex lock;
};
static const struct regmap_range rm3100_readable_ranges[] = {