From: "Ardelean, Alexandru" <Alex.Ardelean@analog.com>
To: "renatogeh@gmail.com" <renatogeh@gmail.com>,
"jic23@kernel.org" <jic23@kernel.org>
Cc: "kernel-usp@googlegroups.com" <kernel-usp@googlegroups.com>,
"lars@metafoo.de" <lars@metafoo.de>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"knaack.h@gmx.de" <knaack.h@gmx.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"giuliano.belinassi@usp.br" <giuliano.belinassi@usp.br>,
"Ardelean, Alexandru" <Alex.Ardelean@analog.com>,
"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"Popa, Stefan Serban" <StefanSerban.Popa@analog.com>
Subject: Re: [PATCH v4 4/9] staging:iio:ad7780: add chip ID values and mask
Date: Mon, 4 Mar 2019 07:33:51 +0000 [thread overview]
Message-ID: <13ef212f8aeebd0c893be253cb4834a3e4d741b8.camel@analog.com> (raw)
In-Reply-To: <20190303145347.41d49646@archlinux>
On Sun, 2019-03-03 at 14:53 +0000, Jonathan Cameron wrote:
> [External]
>
>
> On Sun, 3 Mar 2019 11:01:09 -0300
> Renato Lui Geh <renatogeh@gmail.com> wrote:
>
> > On 03/01, Ardelean, Alexandru wrote:
> > > On Thu, 2019-02-28 at 11:24 -0300, Renato Lui Geh wrote:
> > > >
> > > >
> > > > The ad7780 supports both the ad778x and ad717x families. Each chip
> > > > has
> > > > a corresponding ID. This patch provides a mask for extracting ID
> > > > values
> > > > from the status bits and also macros for the correct values for the
> > > > ad7170, ad7171, ad7780 and ad7781.
> > > >
> > > > Signed-off-by: Renato Lui Geh <renatogeh@gmail.com>
> > > > ---
> > > > drivers/staging/iio/adc/ad7780.c | 8 ++++++--
> > > > 1 file changed, 6 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/iio/adc/ad7780.c
> > > > b/drivers/staging/iio/adc/ad7780.c
> > > > index 56c49e28f432..ad7617a3a141 100644
> > > > --- a/drivers/staging/iio/adc/ad7780.c
> > > > +++ b/drivers/staging/iio/adc/ad7780.c
> > > > @@ -26,10 +26,14 @@
> > > > #define AD7780_RDY BIT(7)
> > > > #define AD7780_FILTER BIT(6)
> > > > #define AD7780_ERR BIT(5)
> > > > -#define AD7780_ID1 BIT(4)
> > > > -#define AD7780_ID0 BIT(3)
> > > > #define AD7780_GAIN BIT(2)
> > > >
> > > > +#define AD7170_ID 0
> > > > +#define AD7171_ID 1
> > > > +#define AD7780_ID 1
> > > > +#define AD7781_ID 0
> > > > +
> > > > +#define AD7780_ID_MASK (BIT(3) | BIT(4))
> > >
> > > This also doesn't have any functionality change.
> > > The AD7170_ID, AD7171_ID, AD7780_ID & AD7781_ID IDs are also unused
> > > (maybe
> > > in a later patch they are ?).
> >
> > They aren't. I added them following a previous review suggestion.
> > Should
> > I remove them?
>
> Can we check them? It's always useful to confirm that the device is
> the one you think it is. Then we can either use what is there
> with a suitable warning, or if that is tricky just fault out as the
> dt is giving us the wrong part number.
>
> J
I guess `dev_warn_ratelimited()` could be used to make sure syslog isn't
spammed-to-death when doing multiple conversions, and the ID isn't correct.
Since these IDs are read after you get a sample, I'm a bit fearful of log-
spam.
I wouldn't throw an error in the ad7780_postprocess_sample() for this, but
warning [with rate-limit] sounds reasonable.
>
> > >
> > > I would also leave the AD7780_ID1 & AD7780_ID0 definitions in place,
> > > since
> > > they're easier matched with the datasheet.
> > >
> > > >
> > > > #define AD7780_PATTERN_GOOD 1
> > > > #define AD7780_PATTERN_MASK GENMASK(1, 0)
> > > > --
> > > > 2.21.0
> > > >
>
>
next prev parent reply other threads:[~2019-03-04 7:34 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-28 14:23 [PATCH v4 0/9] staging: iio: ad7780: move out of staging Renato Lui Geh
2019-02-28 14:23 ` [PATCH v4 1/9] staging: iio: ad7780: add gain & filter gpio support Renato Lui Geh
2019-03-01 6:56 ` Ardelean, Alexandru
2019-03-01 7:42 ` Dan Carpenter
2019-03-01 7:42 ` Dan Carpenter
2019-03-02 19:03 ` Jonathan Cameron
2019-02-28 14:24 ` [PATCH v4 2/9] staging: iio: ad7780: add filter reading to ad778x Renato Lui Geh
2019-03-01 6:59 ` Ardelean, Alexandru
2019-02-28 14:24 ` [PATCH v4 3/9] staging: iio: ad7780: set pattern values and masks directly Renato Lui Geh
2019-03-01 7:17 ` Ardelean, Alexandru
2019-03-02 19:07 ` Jonathan Cameron
2019-03-02 19:08 ` Jonathan Cameron
2019-03-04 7:19 ` Ardelean, Alexandru
2019-02-28 14:24 ` [PATCH v4 4/9] staging:iio:ad7780: add chip ID values and mask Renato Lui Geh
2019-02-28 14:24 ` Renato Lui Geh
2019-03-01 7:20 ` Ardelean, Alexandru
2019-03-03 14:01 ` Renato Lui Geh
2019-03-03 14:01 ` Renato Lui Geh
2019-03-03 14:53 ` Jonathan Cameron
2019-03-03 14:53 ` Jonathan Cameron
2019-03-04 7:33 ` Ardelean, Alexandru [this message]
2019-03-09 0:19 ` Renato Lui Geh
2019-03-09 0:19 ` Renato Lui Geh
2019-03-09 17:47 ` Jonathan Cameron
2019-03-09 17:47 ` Jonathan Cameron
2019-02-28 14:25 ` [PATCH v4 5/9] staging: iio: ad7780: move regulator to after GPIO init Renato Lui Geh
2019-02-28 14:25 ` Renato Lui Geh
2019-03-01 7:38 ` Ardelean, Alexandru
2019-03-02 19:11 ` Jonathan Cameron
2019-03-04 7:20 ` Ardelean, Alexandru
2019-02-28 14:25 ` [PATCH v4 6/9] staging: iio: ad7780: add SPDX identifier Renato Lui Geh
2019-02-28 14:25 ` Renato Lui Geh
2019-02-28 14:25 ` [PATCH v4 7/9] staging: iio: ad7780: add new copyright holder Renato Lui Geh
2019-02-28 14:26 ` [PATCH v4 8/9] staging: iio: ad7780: moving ad7780 out of staging Renato Lui Geh
2019-03-02 19:17 ` Jonathan Cameron
2019-02-28 14:26 ` [PATCH v4 9/9] staging: iio: ad7780: add device tree binding Renato Lui Geh
2019-03-02 19:13 ` Jonathan Cameron
2019-03-11 22:47 ` Rob Herring
2019-03-01 8:35 ` [PATCH v4 0/9] staging: iio: ad7780: move out of staging Ardelean, Alexandru
2019-03-01 8:35 ` Ardelean, Alexandru
2019-03-03 13:52 ` Renato Lui Geh
2019-03-03 13:52 ` Renato Lui Geh
2019-03-03 14:32 ` Alexandru Ardelean
2019-03-03 14:32 ` Alexandru Ardelean
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=13ef212f8aeebd0c893be253cb4834a3e4d741b8.camel@analog.com \
--to=alex.ardelean@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=StefanSerban.Popa@analog.com \
--cc=devel@driverdev.osuosl.org \
--cc=devicetree@vger.kernel.org \
--cc=giuliano.belinassi@usp.br \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=kernel-usp@googlegroups.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pmeerw@pmeerw.net \
--cc=renatogeh@gmail.com \
--cc=robh+dt@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.