From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@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 14:06:19 +0000 [thread overview]
Message-ID: <545A2EDB.5040801@kernel.org> (raw)
In-Reply-To: <1415195855.3660.4.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
On 05/11/14 13:57, Ivan T. Ivanov wrote:
>
> 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().
Good point on grnd, but vref is set but never read anywhere that I can find..
>
>>
>>> + * @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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2014-11-05 14:06 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
[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
[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 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
[not found] ` <545A218F.5060301-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
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 [this message]
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
[not found] ` <1415028270-25860-3-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
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-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
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=545A2EDB.5040801@kernel.org \
--to=jic23-dgejt+ai2ygdnm+yrofe0a@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=iivanov-NEYub+7Iv8PQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).