public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH 2/2] iio: inv_mpu6050: Make interrupt optional
Date: Thu, 25 Mar 2021 16:00:51 +0100	[thread overview]
Message-ID: <03b5b1c7-4d2e-d177-7049-e148f299a430@metafoo.de> (raw)
In-Reply-To: <CACRpkdYbdWsDUtLD2=R1-CPC0zUE7=roKWwEm-8+CfbpnnWByg@mail.gmail.com>

On 3/25/21 3:39 PM, Linus Walleij wrote:
> On Thu, Mar 25, 2021 at 2:11 PM Lars-Peter Clausen <lars@metafoo.de> 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@metafoo.de>
> Makes sense.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
>> -       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


  reply	other threads:[~2021-03-25 15:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 13:10 [PATCH 1/2] iio: inv_mpu6050: Remove superfluous indio_dev->modes assignment Lars-Peter Clausen
2021-03-25 13:10 ` [PATCH 2/2] iio: inv_mpu6050: Make interrupt optional Lars-Peter Clausen
2021-03-25 14:39   ` Linus Walleij
2021-03-25 15:00     ` Lars-Peter Clausen [this message]
2021-03-26 10:56   ` Andy Shevchenko
2021-03-26 10:57     ` Andy Shevchenko
2021-03-26 19:52       ` Jean-Baptiste Maneyrol
2021-03-25 14:32 ` [PATCH 1/2] iio: inv_mpu6050: Remove superfluous indio_dev->modes assignment Linus Walleij
2021-03-25 17:10 ` Jean-Baptiste Maneyrol
2021-03-29 12:35 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03b5b1c7-4d2e-d177-7049-e148f299a430@metafoo.de \
    --to=lars@metafoo.de \
    --cc=jic23@kernel.org \
    --cc=jmaneyrol@invensense.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox