From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com>,
kernel@axis.com, Lars-Peter Clausen <lars@metafoo.de>,
axel.jonsson@axis.com, linux-iio <linux-iio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] iio: adc: mcp320x: add triggered buffer support
Date: Sun, 28 Aug 2022 18:15:39 +0100 [thread overview]
Message-ID: <20220828181539.12dfd21e@jic23-huawei> (raw)
In-Reply-To: <CAHp75Vda3bbsRw+mftXjrH445UqSkxcB7q9kXUc+-ODUE+VQ9g@mail.gmail.com>
On Thu, 25 Aug 2022 23:06:01 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Wed, Aug 24, 2022 at 1:46 PM Vincent Whitchurch
> <vincent.whitchurch@axis.com> wrote:
> >
> > From: Axel Jonsson <axel.jonsson@axis.com>
> >
> > Add support for triggered buffers. Just read the channels in a loop to
> > keep things simple.
>
> ...
>
> > #include <linux/module.h>
> > #include <linux/mod_devicetable.h>
> > #include <linux/iio/iio.h>
> > +#include <linux/interrupt.h>
>
> Ordering?
>
> But honestly, I prefer the linux/iio/* to be split in a separate group...
>
> > +#include <linux/iio/buffer.h>
> > +#include <linux/iio/triggered_buffer.h>
> > +#include <linux/iio/trigger_consumer.h>
> > #include <linux/regulator/consumer.h>
> >
>
> ...and be put here.
>
> ...
>
> > + device_index = spi_get_device_id(adc->spi)->driver_data;
>
> Hmm... Wondering if this can be derived from channel number or alike.
>
It is weirder than the name implies.
Seem device_index is actually the chip type from amongst those the driver
supports.
That wants cleaning up, particularly there is also a chip_info structure.
Various ways of doing it, but simplest is probably a set of callbacks
covering the different data extraction methods in mcp320x_adc_conversion.
Jonathan
next prev parent reply other threads:[~2022-08-28 17:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 10:40 [PATCH 0/2] iio: adc: mcp320x: Add triggered buffer support Vincent Whitchurch
2022-08-24 10:40 ` [PATCH 1/2] iio: adc: mcp320x: use device managed functions Vincent Whitchurch
2022-08-25 20:01 ` Andy Shevchenko
2022-08-26 11:38 ` Vincent Whitchurch
[not found] ` <CAHp75VffYzNTfrki4+o8JJayUGo1n91bP0hSzB-fR=RfcFq-fw@mail.gmail.com>
2022-08-28 17:06 ` Jonathan Cameron
2022-08-29 8:16 ` Andy Shevchenko
2022-08-24 10:40 ` [PATCH 2/2] iio: adc: mcp320x: add triggered buffer support Vincent Whitchurch
2022-08-25 20:06 ` Andy Shevchenko
2022-08-28 17:15 ` Jonathan Cameron [this message]
2022-08-28 17:24 ` Jonathan Cameron
2022-08-31 7:47 ` Vincent Whitchurch
2022-09-04 16:29 ` 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=20220828181539.12dfd21e@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=axel.jonsson@axis.com \
--cc=kernel@axis.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vincent.whitchurch@axis.com \
/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