mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Stanimir Varbanov <svarbanov@mm-sol.com>,
	Angelo Compagnucci <angelo.compagnucci@gmail.com>,
	Grant Likely <grant.likely@linaro.org>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver
Date: Wed, 05 Nov 2014 15:57:35 +0200	[thread overview]
Message-ID: <1415195855.3660.4.camel@mm-sol.com> (raw)
In-Reply-To: <545A218F.5060301@kernel.org>


On Wed, 2014-11-05 at 13:09 +0000, Jonathan Cameron wrote:
> On 03/11/14 15:24, Ivan T. Ivanov wrote:
> > From: Stanimir Varbanov <svarbanov@mm-sol.com>
> > 
> > The voltage ADC is peripheral of Qualcomm SPMI PMIC chips. It has
> > 15 bits resolution and register space inside PMIC accessible across
> > SPMI bus.
> > 
> > The vadc driver registers itself through IIO interface.
> > 
> > Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
> Hi Ivan,
> 
> Couple of utterly tiny bits inline.  The biggest one is that
> you store some info about the calibration that you never actually
> use... Left over from some debugging perhaps?
> 
> Jonathan

<snip>

> > +
> > +/*
> > + * VADC_CALIB_ABSOLUTE: uses the 625mV and 1.25V as reference channels.
> > + * VADC_CALIB_RATIOMETRIC: uses the reference voltage (1.8V) and GND for
> > + * calibration.
> > + */
> > +enum vadc_calibration {
> > +       VADC_CALIB_ABSOLUTE = 0,
> > +       VADC_CALIB_RATIOMETRIC
> > +};
> > +
> > +/**
> > + * struct vadc_linear_graph - Represent ADC characteristics.
> > + * @dy: numerator slope to calculate the gain.
> As dy is always equal to vref-gnd you could drop it and use those
> directly...
> 
> Conversly you store vref or grnd and never use them...

I am not sure I am following you. Please take a look in 
vadc_measure_ref_points() and vadc_calibrate().

> 
> > + * @dx: denominator slope to calculate the gain.
> > + * @vref: A/D word of the voltage reference used for the channel.
> > + * @gnd: A/D word of the ground reference used for the channel.
> > + *
> > + * Each ADC device has different offset and gain parameters which are
> > + * computed to calibrate the device.
> > + */
> > +struct vadc_linear_graph {
> > +       s32 dy;
> > +       s32 dx;
> > +       s32 vref;
> > +       s32 gnd;
> > +};
> > +
> > 

Will address blank line comment.

Regards,
Ivan

  reply	other threads:[~2014-11-05 13:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 15:24 [PATCH v4 0/2] Initial support for voltage ADC Ivan T. Ivanov
2014-11-03 15:24 ` [PATCH v4 1/2] DT: iio: vadc: document dt binding Ivan T. Ivanov
2014-11-05  0:01   ` Hartmut Knaack
2014-11-05 13:12     ` Jonathan Cameron
2014-11-05 14:07     ` Ivan T. Ivanov
2014-11-03 15:24 ` [PATCH v4 2/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver Ivan T. Ivanov
2014-11-05 13:09   ` Jonathan Cameron
2014-11-05 13:57     ` Ivan T. Ivanov [this message]
2014-11-05 14:06       ` Jonathan Cameron
2014-11-05 15:01         ` Ivan T. Ivanov
2014-11-05 15:32           ` Jonathan Cameron
2014-11-10 21:11   ` Hartmut Knaack
2014-11-11  8:21     ` Ivan T. Ivanov
2014-11-11 22:39       ` Hartmut Knaack
2014-11-12  8:55         ` Ivan T. Ivanov
2014-11-17 22:12           ` Hartmut Knaack
2014-11-18  8:23             ` Ivan T. Ivanov
2014-11-22 11:55               ` 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=1415195855.3660.4.camel@mm-sol.com \
    --to=iivanov@mm-sol.com \
    --cc=angelo.compagnucci@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=svarbanov@mm-sol.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

Powered by JetHome