All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
Cc: "andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"lars@metafoo.de" <lars@metafoo.de>
Subject: Re: [PATCH v2 5/5] iio: adc: ad7793: use read_avail iio hook for scale available
Date: Sun, 22 Mar 2020 15:15:54 +0000	[thread overview]
Message-ID: <20200322151554.2c204c49@archlinux> (raw)
In-Reply-To: <5ae09f8526a8847cb45435aa5280f905956ff588.camel@analog.com>

On Sun, 22 Mar 2020 09:18:13 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:

> On Sat, 2020-03-21 at 21:37 +0200, Andy Shevchenko wrote:
> > [External]
> > 
> > On Sat, Mar 21, 2020 at 11:08:02AM +0200, Alexandru Ardelean wrote:  
> > > This change uses the read_avail and '.info_mask_shared_by_type_available'
> > > modifier to set the available scale.
> > > Essentially, nothing changes to the driver's ABI.
> > > 
> > > The main idea for this patch is to remove the AD7793 driver from
> > > checkpatch's radar. There have been about ~3 attempts to fix/break the
> > > 'in_voltage-voltage_scale_available' attribute, because checkpatch assumed
> > > it to be an arithmetic operation and people were trying to change that.
> > > +static int ad7793_read_avail(struct iio_dev *indio_dev,
> > > +			     struct iio_chan_spec const *chan,
> > > +			     const int **vals, int *type, int *length,
> > > +			     long mask)
> > >  {
> > >  	struct ad7793_state *st = iio_priv(indio_dev);
> > >  
> > > +	switch (mask) {
> > > +	case IIO_CHAN_INFO_SCALE:
> > > +		*vals = (int *)st->scale_avail;
> > > +		*type = IIO_VAL_INT_PLUS_NANO;
> > > +		/* Values are stored in a 2D matrix  */
> > > +		*length = ARRAY_SIZE(st->scale_avail) * 2;
> > >  
> > > +		return IIO_AVAIL_LIST;
> > > +	}
> > >  
> > > +	return -EINVAL;  
> > 
> > Wouldn't be better move this under default case?
> >   
> 
> Ummm, sure.
> I'm a bit vague how we do from here since Jonathan accepted this and the
> patchset.
> I'll send a V3 of the whole set [in a few days max].

I'll drop this last patch.  Just resend this one with the change.

Jonathan


  reply	other threads:[~2020-03-22 15:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21  9:07 [PATCH v2 1/5] iio: adc: ad7780: define/use own IIO channel macros Alexandru Ardelean
2020-03-21  9:07 ` [PATCH v2 2/5] iio: adc: ad7791: " Alexandru Ardelean
2020-03-21 16:51   ` Jonathan Cameron
2020-03-21  9:08 ` [PATCH v2 3/5] iio: adc: ad7793: " Alexandru Ardelean
2020-03-21 16:52   ` Jonathan Cameron
2020-03-21  9:08 ` [PATCH v2 4/5] iio: ad_sigma_delta: remove unused " Alexandru Ardelean
2020-03-21 16:53   ` Jonathan Cameron
2020-03-21  9:08 ` [PATCH v2 5/5] iio: adc: ad7793: use read_avail iio hook for scale available Alexandru Ardelean
2020-03-21 16:57   ` Jonathan Cameron
2020-03-22  9:38     ` Ardelean, Alexandru
2020-03-21 19:37   ` Andy Shevchenko
2020-03-22  9:18     ` Ardelean, Alexandru
2020-03-22 15:15       ` Jonathan Cameron [this message]
2020-03-21 16:50 ` [PATCH v2 1/5] iio: adc: ad7780: define/use own IIO channel macros 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=20200322151554.2c204c49@archlinux \
    --to=jic23@kernel.org \
    --cc=alexandru.Ardelean@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.