1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/iio/iio.h>
3 #include <linux/mutex.h>
4 #include <linux/regmap.h>
5 #include <linux/regulator/consumer.h>
9 * enum mpu3050_fullscale - indicates the full range of the sensor in deg/sec
11 enum mpu3050_fullscale
{
19 * enum mpu3050_lpf - indicates the low pass filter width
22 /* This implicity sets sample frequency to 8 kHz */
24 /* All others sets the sample frequency to 1 kHz */
42 * struct mpu3050 - instance state container for the device
43 * @dev: parent device for this instance
44 * @orientation: mounting matrix, flipped axis etc
45 * @map: regmap to reach the registers
46 * @lock: serialization lock to marshal all requests
47 * @irq: the IRQ used for this device
48 * @regs: the regulators to power this device
49 * @fullscale: the current fullscale setting for the device
50 * @lpf: digital low pass filter setting for the device
51 * @divisor: base frequency divider: divides 8 or 1 kHz
52 * @calibration: the three signed 16-bit calibration settings that
53 * get written into the offset registers for each axis to compensate
55 * @trig: trigger for the MPU-3050 interrupt, if present
56 * @hw_irq_trigger: hardware interrupt trigger is in use
57 * @irq_actl: interrupt is active low
58 * @irq_latch: latched IRQ, this means that it is a level IRQ
59 * @irq_opendrain: the interrupt line shall be configured open drain
60 * @pending_fifo_footer: tells us if there is a pending footer in the FIFO
61 * that we have to read out first when handling the FIFO
62 * @hw_timestamp: latest hardware timestamp from the trigger IRQ, when in
64 * @i2cmux: an I2C mux reflecting the fact that this sensor is a hub with
65 * a pass-through I2C interface coming out of it: this device needs to be
66 * powered up in order to reach devices on the other side of this mux
70 struct iio_mount_matrix orientation
;
74 struct regulator_bulk_data regs
[2];
75 enum mpu3050_fullscale fullscale
;
79 struct iio_trigger
*trig
;
84 bool pending_fifo_footer
;
86 struct i2c_mux_core
*i2cmux
;
89 /* Probe called from different transports */
90 int mpu3050_common_probe(struct device
*dev
,
94 int mpu3050_common_remove(struct device
*dev
);
97 extern const struct dev_pm_ops mpu3050_dev_pm_ops
;