From: Stanimir Varbanov <svarbanov@mm-sol.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>,
Pawel Moll <pawel.moll@arm.com>, Rob Herring <robh+dt@kernel.org>,
Kumar Gala <galak@codeaurora.org>,
Mark Rutland <mark.rutland@arm.com>,
Grant Likely <grant.likely@linaro.org>,
Jonathan Cameron <jic23@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Hartmut Knaack <knaack.h@gmx.de>,
Angelo Compagnucci <angelo.compagnucci@gmail.com>,
Doug Anderson <dianders@chromium.org>,
Fugang Duan <B38611@freescale.com>,
Johannes Thumshirn <johannes.thumshirn@men.de>,
Jean Delvare <jdelvare@suse.de>,
Philippe Reynes <tremyfr@yahoo.fr>,
Lee Jones <lee.jones@linaro.org>,
Josh Cartwright <joshc@codeaurora.org>,
Stephen Boyd <sboyd@codeaurora.org>, David Collins <collins>
Subject: Re: [PATCH 1/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver
Date: Mon, 08 Sep 2014 11:13:50 +0300 [thread overview]
Message-ID: <540D653E.7070509@mm-sol.com> (raw)
In-Reply-To: <3495079.hWGRuSPgx7@wuerfel>
Hi Arnd,
Thank you for the comments!
On 09/05/2014 03:26 PM, Arnd Bergmann wrote:
> On Friday 05 September 2014 15:14:33 Stanimir Varbanov wrote:
>> + VADC_CHAN(LR_MUX1_BAT_THERM, 0) /* 0x30 */
>> + VADC_CHAN(LR_MUX2_BAT_ID, 0)
>> + VADC_CHAN(LR_MUX3_XO_THERM, 0)
>> + VADC_CHAN(LR_MUX4_AMUX_THM1, 0)
>> + VADC_CHAN(LR_MUX5_AMUX_THM2,by you 0)
>> + VADC_CHAN(LR_MUX6_AMUX_THM3, 0)
>> + VADC_CHAN(LR_MUX7_HW_ID, 0)
>> + VADC_CHAN(LR_MUX8_AMUX_THM4, 0)
>> + VADC_CHAN(LR_MUX9_AMUX_THM5, 0)
>> + VADC_CHAN(AMUX_PU1, 0)
>> + VADC_CHAN(AMUX_PU2, 0)
>> + VADC_CHAN(LR_MUX3_BUF_XO_THERM_BUF, 0) /* 0x3c */
>> +
>> + VADC_CHAN(LR_MUX1_PU1_BAT_THERM, 0) /* 0x70 */
>> + VADC_CHAN(LR_MUX2_PU1_BAT_ID, 0)
>> + VADC_CHAN(LR_MUX3_PU1_XO_THERM, 0)
>> + VADC_CHAN(LR_MUX4_PU1_AMUX_THM1, 0)
>> + VADC_CHAN(LR_MUX5_PU1_AMUX_THM2, 0)
>> + VADC_CHAN(LR_MUX6_PU1_AMUX_THM3, 0)
>> + VADC_CHAN(LR_MUX7_PU1_AMUX_HW_ID, 0)
>> + VADC_CHAN(LR_MUX8_PU1_AMUX_THM4, 0)
>> + VADC_CHAN(LR_MUX9_PU1_AMUX_THM5, 0)
>> + VADC_CHAN(LR_MUX10_PU1_AMUX_USB_ID, 0) /* 0x79 */
>> + VADC_CHAN(LR_MUX3_BUF_PU1_XO_THERM_BUF, 0) /* 0x7c */
>>
>
> These numbers all look hardware specific, so why put macros into the
> device tree rather than using them directly?
The idea was to use #defines in DT nodes when we need to overwrite the
adc channel parameters, see example in 2/2 how it will be used.
>
> If you want to make up your own macro namespace, I would suggest
> using consecutive numbers and turning the above into
>
> ...
> [LR_MUX3_BUF_XO_THERM_BUF] = VADC_CHAN(0x3c, 0),
> [LR_MUX1_PU1_BAT_THERM] = VADC_CHAN(0x70, 0),
> [LR_MUX1_PU1_BAT_ID] = VADC_CHAN(0x71, 0),
> ...
>
> but I don't see that really improving the DT, since you then
> need to look up the values in the header rather than the data sheet.
I will see how can I make this elegantly by using IIO infrastructure better.
regards,
Stan
WARNING: multiple messages have this Message-ID (diff)
From: Stanimir Varbanov <svarbanov@mm-sol.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>,
Pawel Moll <pawel.moll@arm.com>, Rob Herring <robh+dt@kernel.org>,
Kumar Gala <galak@codeaurora.org>,
Mark Rutland <mark.rutland@arm.com>,
Grant Likely <grant.likely@linaro.org>,
Jonathan Cameron <jic23@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Hartmut Knaack <knaack.h@gmx.de>,
Angelo Compagnucci <angelo.compagnucci@gmail.com>,
Doug Anderson <dianders@chromium.org>,
Fugang Duan <B38611@freescale.com>,
Johannes Thumshirn <johannes.thumshirn@men.de>,
Jean Delvare <jdelvare@suse.de>,
Philippe Reynes <tremyfr@yahoo.fr>,
Lee Jones <lee.jones@linaro.org>,
Josh Cartwright <joshc@codeaurora.org>,
Stephen Boyd <sboyd@codeaurora.org>,
David Collins <collinsd@codeaurora.org>,
"Ivan T. Ivanov" <iivanov@mm-sol.com>
Subject: Re: [PATCH 1/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver
Date: Mon, 08 Sep 2014 11:13:50 +0300 [thread overview]
Message-ID: <540D653E.7070509@mm-sol.com> (raw)
In-Reply-To: <3495079.hWGRuSPgx7@wuerfel>
Hi Arnd,
Thank you for the comments!
On 09/05/2014 03:26 PM, Arnd Bergmann wrote:
> On Friday 05 September 2014 15:14:33 Stanimir Varbanov wrote:
>> + VADC_CHAN(LR_MUX1_BAT_THERM, 0) /* 0x30 */
>> + VADC_CHAN(LR_MUX2_BAT_ID, 0)
>> + VADC_CHAN(LR_MUX3_XO_THERM, 0)
>> + VADC_CHAN(LR_MUX4_AMUX_THM1, 0)
>> + VADC_CHAN(LR_MUX5_AMUX_THM2,by you 0)
>> + VADC_CHAN(LR_MUX6_AMUX_THM3, 0)
>> + VADC_CHAN(LR_MUX7_HW_ID, 0)
>> + VADC_CHAN(LR_MUX8_AMUX_THM4, 0)
>> + VADC_CHAN(LR_MUX9_AMUX_THM5, 0)
>> + VADC_CHAN(AMUX_PU1, 0)
>> + VADC_CHAN(AMUX_PU2, 0)
>> + VADC_CHAN(LR_MUX3_BUF_XO_THERM_BUF, 0) /* 0x3c */
>> +
>> + VADC_CHAN(LR_MUX1_PU1_BAT_THERM, 0) /* 0x70 */
>> + VADC_CHAN(LR_MUX2_PU1_BAT_ID, 0)
>> + VADC_CHAN(LR_MUX3_PU1_XO_THERM, 0)
>> + VADC_CHAN(LR_MUX4_PU1_AMUX_THM1, 0)
>> + VADC_CHAN(LR_MUX5_PU1_AMUX_THM2, 0)
>> + VADC_CHAN(LR_MUX6_PU1_AMUX_THM3, 0)
>> + VADC_CHAN(LR_MUX7_PU1_AMUX_HW_ID, 0)
>> + VADC_CHAN(LR_MUX8_PU1_AMUX_THM4, 0)
>> + VADC_CHAN(LR_MUX9_PU1_AMUX_THM5, 0)
>> + VADC_CHAN(LR_MUX10_PU1_AMUX_USB_ID, 0) /* 0x79 */
>> + VADC_CHAN(LR_MUX3_BUF_PU1_XO_THERM_BUF, 0) /* 0x7c */
>>
>
> These numbers all look hardware specific, so why put macros into the
> device tree rather than using them directly?
The idea was to use #defines in DT nodes when we need to overwrite the
adc channel parameters, see example in 2/2 how it will be used.
>
> If you want to make up your own macro namespace, I would suggest
> using consecutive numbers and turning the above into
>
> ...
> [LR_MUX3_BUF_XO_THERM_BUF] = VADC_CHAN(0x3c, 0),
> [LR_MUX1_PU1_BAT_THERM] = VADC_CHAN(0x70, 0),
> [LR_MUX1_PU1_BAT_ID] = VADC_CHAN(0x71, 0),
> ...
>
> but I don't see that really improving the DT, since you then
> need to look up the values in the header rather than the data sheet.
I will see how can I make this elegantly by using IIO infrastructure better.
regards,
Stan
next prev parent reply other threads:[~2014-09-08 8:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 12:14 [PATCH 0/2] Intial support for voltage ADC Stanimir Varbanov
2014-09-05 12:14 ` Stanimir Varbanov
2014-09-05 12:14 ` [PATCH 1/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver Stanimir Varbanov
2014-09-05 12:26 ` Arnd Bergmann
2014-09-05 12:26 ` Arnd Bergmann
2014-09-08 8:13 ` Stanimir Varbanov [this message]
2014-09-08 8:13 ` Stanimir Varbanov
2014-09-08 10:19 ` Arnd Bergmann
2014-09-08 10:19 ` Arnd Bergmann
2014-09-08 15:30 ` Stanimir Varbanov
2014-09-08 15:30 ` Stanimir Varbanov
2014-09-09 10:32 ` Arnd Bergmann
2014-09-09 10:32 ` Arnd Bergmann
2014-09-09 12:49 ` Stanimir Varbanov
2014-09-09 12:49 ` Stanimir Varbanov
2014-09-10 9:49 ` Ivan T. Ivanov
2014-09-10 9:49 ` Ivan T. Ivanov
2014-09-05 12:46 ` Peter Meerwald
2014-09-07 22:42 ` Stanimir Varbanov
[not found] ` <1409919274-13419-1-git-send-email-svarbanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-09-05 12:14 ` [PATCH 2/2] DT: iio: vadc: document dt binding Stanimir Varbanov
2014-09-05 12:14 ` Stanimir Varbanov
[not found] ` <1409919274-13419-3-git-send-email-svarbanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-09-09 22:22 ` Hartmut Knaack
2014-09-09 22:22 ` Hartmut Knaack
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=540D653E.7070509@mm-sol.com \
--to=svarbanov@mm-sol.com \
--cc=B38611@freescale.com \
--cc=angelo.compagnucci@gmail.com \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jdelvare@suse.de \
--cc=jic23@kernel.org \
--cc=johannes.thumshirn@men.de \
--cc=joshc@codeaurora.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=tremyfr@yahoo.fr \
/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.