[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220828181539.12dfd21e@jic23-huawei>
Date: Sun, 28 Aug 2022 18:15:39 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Vincent Whitchurch <vincent.whitchurch@...s.com>, kernel@...s.com,
Lars-Peter Clausen <lars@...afoo.de>, axel.jonsson@...s.com,
linux-iio <linux-iio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] iio: adc: mcp320x: add triggered buffer support
On Thu, 25 Aug 2022 23:06:01 +0300
Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> On Wed, Aug 24, 2022 at 1:46 PM Vincent Whitchurch
> <vincent.whitchurch@...s.com> wrote:
> >
> > From: Axel Jonsson <axel.jonsson@...s.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
Powered by blists - more mailing lists