<Query> Reg: Adding a gpio initialization sequence in dts is valid or not

Leela Krishna Amudala leelakrishna.a at gmail.com
Fri Aug 17 20:37:00 EST 2012


Hello,

I think you misinterpreted my question.

Alex,
Your documentation says that power on sequence look like shown below
(step1: enabling regulator, step2: enabling pwm and step3: enabling a
gpio line)

power-on-sequence {
        step0 {
                regulator = "power";
                enable;
        };
        step1 {
                delay = <10000>;
        };
        step2 {
                pwm = "backlight";
                enable;
        };

But I don't bother about enabling regulator and pwm for my panel.

My panel needs a sequence like
1. Pull up a gpio line
2. Maintain some delay
3. Pull down gpio line
4. Maintain some delay and
5. Pull up a gpio line.

Please find the Image shown in the attachment for better understanding.

So, to get this done I used your code and created a node like below
and it worked for me.

backlight {
        compatible = "pwm-backlight";
        brightness-levels = <0 16 32 48 64 80 96 112 128 144 160 176
192 208 224 240 255>;
        default-brightness-level = <12>;

        enable-gpio1 = <&gpx1 5 1 0 0>;
        enable-gpio2 = <&gpx3 0 0 0 0>;

        power-on-sequence {
                gpio at 2 {
                        id = "enable-gpio1";
                        enable;
                        post-delay = <20>;
                };
                gpio at 3 {
                         id = "enable-gpio1";
                         disable;
                         post-delay = <20>;
                 };
                gpio at 4 {
                         id = "enable-gpio1";
                         enable;
                         post-delay = <20>;
                 };
                gpio at 5 {
                         id = "enable-gpio2";
                         disable;
                         post-delay = <20>;
                 };
        };
        power-off-sequence {
                gpio at 0 {
                        id = "enable-gpio1";
                        disable;
                        post-delay = <20>;
                };
        };
};

I want to know whether this kind of sequence is allowed in DT or not ?

Best Wishes,
Leela Krishna Amudala

On Thu, Aug 9, 2012 at 7:37 AM, Alex Courbot <acourbot at nvidia.com> wrote:
> On Thu 09 Aug 2012 12:38:09 AM JST, Stephen Warren wrote:
>>
>> On 08/08/2012 07:30 AM, Rob Herring wrote:
>>>
>>> On 08/08/2012 04:52 AM, Leela Krishna Amudala wrote:
>>>>
>>>> Hello All,
>>>>
>>>> I came across that to set power to an LCD, few panels require a pull
>>>> up/pull down operation on single GPIO line
>>>> and few panels need some gpio line setting sequence with some delay in
>>>> between.
>>
>> ...
>>>>
>>>> Putting the sequence in dts file like below for an LCD which requires
>>>> gpio sequence
>>>>                 lcd-reset-gpio = <&gpx1 5 1 3 0>,    (3 - for pull up)
>>>>                                        <&gpx1 5 1 1 0>,    (1 - for pull
>>>> down)
>>>>                                        <&gpx1 5 1 3 0>;    (3 - for pull
>>>> up)
>>>>                 delay = x;
>>>>
>>>> and only one gpio entry in the case of LCD which doesn't require gpio
>>>> sequence setting
>>>>                 lcd-reset-gpio = <&gpx1 5 1 3 0>,    (3 - pull up)
>>>>
>>>> The 4 arguments in the above handle denotes
>>>>
>>>> <[phandle of the gpio controller node]
>>>>        [pin number within the gpio controller]
>>>>        [mux function]
>>>>        [pull up/down]
>>>>        [drive strength]>
>>
>>
>> Mux function, pull-up/down and drive-strength should be handled by the
>> pinctrl subsystem, and associated DT bindings.
>>
>> I suppose the proposal in the "runtime interpreted power sequences"
>> thread could be extended to have an action for activating a particular
>> pinctrl state too.
>
>
> Yup, that would totally make sense. Leela, you might want to try the next
> revision of my patches (coming today or tomorrow) and see how it can be
> extended to fit your needs.
>
> Alex.
>
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may
> contain
> confidential information.  Any unauthorized review, use, disclosure or
> distribution
> is prohibited.  If you are not the intended recipient, please contact the
> sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpio_sequence.jpg
Type: image/jpeg
Size: 7302 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20120817/3bd76163/attachment-0001.jpg>


More information about the devicetree-discuss mailing list