On 3/25/21 3:39 PM, Linus Walleij wrote:
On Thu, Mar 25, 2021 at 2:11 PM Lars-Peter Clausen <lars@xxxxxxxxxx> wrote:
The inv_mpu6050 driver requires an interrupt for buffered capture. But non
buffered reading for measurements works just fine without an interrupt
connected.
Make the interrupt optional to support this case.
Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
Makes sense.
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
- result = inv_mpu6050_probe_trigger(indio_dev, irq_type);
- if (result) {
- dev_err(dev, "trigger probe fail %d\n", result);
- return result;
(...)
+ /*
+ * The driver currently only supports buffered capture with its
+ * own trigger. So no IRQ, no trigger, no buffer
+ */
I bet it can be made to work with e.g. a hrtimer trigger quite easily since we
support raw reading?
I looked into that. With the current implementation it will not work
since the trigger enable callback enables the channels.
IIO has dedicated enable/disable callbacks for the buffer where this
should usually happen. So this could be added to the driver if somebody
wants it.
- Lars