From: Alex Courbot <acourbot@nvidia.com>
To: Simon Glass <sjg@chromium.org>
Cc: Thierry Reding <thierry.reding@avionic-design.de>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>
Subject: Re: [RFC][PATCH V2 3/3] tegra: add pwm backlight device tree nodes
Date: Fri, 13 Jul 2012 05:32:12 +0000 [thread overview]
Message-ID: <4FFFB2DC.3040605@nvidia.com> (raw)
In-Reply-To: <CAPnjgZ2=Ga2P-40trA_=UABm=i7Uy4NTAM=ehea11mE22VfDew@mail.gmail.com>
On 07/12/2012 11:27 PM, Simon Glass wrote
>> I agree the type strings are a problem in the current form - if we could get
>> constants in the device tree, that would be much better. Your way of
>> representing the sequences is interesting though, if we can solve the type
>> issue (and also evaluate its cost in terms of memory footprint), it would be
>> interesting to consider it as well.
>
> At a guess:
>
>>>> + power-on-sequence = "REGULATOR", "power", <1>,
>>>> + "DELAY", <10>,
>>>> + "PWM", "backlight", <1>,
>>>> + "GPIO", "enable", <1>;
>
> About 106 bytes I think
>
>>> step@0 { 16
> type = "regulator"; 24
>>> phandle = <&backlight_reg>; 16
>>> enable = <1>; 16
>>> post-delay = <10>; 16
>>> }
>>> step@1 { 16
> type = "pwm"; 16
>>> phandle = <&pwm 2 5000000>; 24
>>> }
>>> step@2 { 16
> type = "gpio"; 20
>>> phandle = <&gpio 28 0>; 24
>>> enable = <1>; 16
>>> }
>
> 220?
I compiled both versions to try it out. Your version was just 50 bytes
larger than mine (I assumed that with yours, we would be able to remove
the top-level pwm/regulator/gpio definitions that are referred by the
sequence). The question here is do we want to have something more
DT-ish, or are we trying to save every possible byte in the DT structure?
As Thierry also mentionned, we are trying to provide the same feature
using the platform interface. I am not sure how we can elegantly support
both ways through this.
> From my understanding mixing strings and numbers in a property is
> frowned on though.
But doesn't it make sense in the current case? The power sequence is
basically a program that is run by an interpreter. From this
perspective, it makes more sense to me to have it as a binary field
rather than a hierarchy of nodes and properties that will be harder to
parse and will make error detection more complicated. I don't really see
any practical benefit from turning the steps into sub-nodes, but then
again I am not so familiar with the DT.
Alex.
next prev parent reply other threads:[~2012-07-13 5:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 6:08 [RFC][PATCHv2 0/3] Power sequences interpreter for pwm_backlight Alexandre Courbot
2012-07-09 6:08 ` [RFC][PATCH V2 1/3] power sequences interpreter for device tree Alexandre Courbot
2012-07-09 6:08 ` [RFC][PATCH V2 2/3] pwm_backlight: use power sequences Alexandre Courbot
[not found] ` <1341814105-20690-3-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-07-09 7:48 ` Alex Courbot
2012-07-09 6:08 ` [RFC][PATCH V2 3/3] tegra: add pwm backlight device tree nodes Alexandre Courbot
[not found] ` <1341814105-20690-4-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-07-12 9:37 ` Simon Glass
[not found] ` <CAPnjgZ1QbjE+-tr0c01K2feUdEE2wMBfR=bKpTxnyDOJbY8+1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-12 10:04 ` Thierry Reding
2012-07-12 10:11 ` Alex Courbot
[not found] ` <4FFEA2D4.9050308-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-07-12 14:27 ` Simon Glass
2012-07-13 5:32 ` Alex Courbot [this message]
2012-07-23 20:38 ` Stephen Warren
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=4FFFB2DC.3040605@nvidia.com \
--to=acourbot@nvidia.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=sjg@chromium.org \
--cc=thierry.reding@avionic-design.de \
/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).