All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
To: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	Peter Meerwald <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>,
	Stanimir Varbanov
	<svarbanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>,
	Angelo Compagnucci
	<angelo.compagnucci-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
> > 
> > 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-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
> > Signed-off-by: Ivan T. Ivanov <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
> 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

WARNING: multiple messages have this Message-ID (diff)
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

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

Thread overview: 27+ 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
     [not found] ` <1415028270-25860-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-11-03 15:24   ` [PATCH v4 1/2] DT: iio: vadc: document dt binding Ivan T. Ivanov
2014-11-03 15:24     ` Ivan T. Ivanov
     [not found]     ` <1415028270-25860-2-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-11-05  0:01       ` Hartmut Knaack
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-03 15:24     ` Ivan T. Ivanov
2014-11-05 13:09     ` Jonathan Cameron
     [not found]       ` <545A218F.5060301-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-11-05 13:57         ` Ivan T. Ivanov [this message]
2014-11-05 13:57           ` Ivan T. Ivanov
     [not found]           ` <1415195855.3660.4.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-11-05 14:06             ` Jonathan Cameron
2014-11-05 14:06               ` Jonathan Cameron
2014-11-05 15:01               ` Ivan T. Ivanov
     [not found]                 ` <1415199681.3660.8.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-11-05 15:32                   ` Jonathan Cameron
2014-11-05 15:32                     ` Jonathan Cameron
     [not found]     ` <1415028270-25860-3-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-11-10 21:11       ` Hartmut Knaack
2014-11-10 21:11         ` Hartmut Knaack
2014-11-11  8:21         ` Ivan T. Ivanov
2014-11-11 22:39           ` Hartmut Knaack
     [not found]             ` <54629026.3080002-Mmb7MZpHnFY@public.gmane.org>
2014-11-12  8:55               ` Ivan T. Ivanov
2014-11-12  8:55                 ` Ivan T. Ivanov
2014-11-17 22:12                 ` Hartmut Knaack
2014-11-18  8:23                   ` Ivan T. Ivanov
     [not found]                     ` <1416299013.30131.4.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-11-22 11:55                       ` Jonathan Cameron
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-neyub+7iv8pqt0dzr+alfa@public.gmane.org \
    --cc=angelo.compagnucci-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org \
    --cc=svarbanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.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.