* <Query> Reg: Adding a gpio initialization sequence in dts is valid or not
@ 2012-08-08 9:52 Leela Krishna Amudala
[not found] ` <CAL1wa8fjJg33vVM4ZOFuA2ACps55cahoK65MDf4ebAi9B6KUxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Leela Krishna Amudala @ 2012-08-08 9:52 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: thomas.ab-Sze3O3UU22JBDgjK7y7TUQ,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ
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.
For my development board, user manual says that I have to do a
sequence of gpio line settings with some delay in between
to set power to LCD and currently I'm doing it as
pull_up(gpio_line_5)
some_delay(x)
pull_down(gpio_line_5)
some_delay(x)
pull_up(gpio_line_5)
I want to read this GPIO line from device tree and parse it and do the
above sequence in the driver.
I'm thinking to follow the below approach to get this done.
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]>
My board requires one gpio line to pull up->pull down->pull up to set
power and similarly
other boards may require two gpio lines to follow the sequence in that
case number of entries
in dts file will increase.
I want to know whether the above approach is acceptable in device-tree or not.
Best Wishes,
Leela Krishna Amudala.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: <Query> Reg: Adding a gpio initialization sequence in dts is valid or not
[not found] ` <CAL1wa8fjJg33vVM4ZOFuA2ACps55cahoK65MDf4ebAi9B6KUxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-08-08 13:30 ` Rob Herring
[not found] ` <502269EC.2070008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2012-08-08 13:30 UTC (permalink / raw)
To: Leela Krishna Amudala
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
thomas.ab-Sze3O3UU22JBDgjK7y7TUQ
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.
>
> For my development board, user manual says that I have to do a
> sequence of gpio line settings with some delay in between
> to set power to LCD and currently I'm doing it as
>
> pull_up(gpio_line_5)
> some_delay(x)
> pull_down(gpio_line_5)
> some_delay(x)
> pull_up(gpio_line_5)
>
> I want to read this GPIO line from device tree and parse it and do the
> above sequence in the driver.
> I'm thinking to follow the below approach to get this done.
>
See the thread "runtime interpreted power sequences"
> 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]>
>
The gpio controller defines the number of gpio cells. So technically you
could do that if you're defining the gpio controller's binding, but I
don't think thats a good idea. If the binding is already defined, then
you can't really change it anyway.
Rob
> My board requires one gpio line to pull up->pull down->pull up to set
> power and similarly
> other boards may require two gpio lines to follow the sequence in that
> case number of entries
> in dts file will increase.
>
> I want to know whether the above approach is acceptable in device-tree or not.
>
> Best Wishes,
> Leela Krishna Amudala.
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: <Query> Reg: Adding a gpio initialization sequence in dts is valid or not
[not found] ` <502269EC.2070008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-08-08 15:38 ` Stephen Warren
[not found] ` <50231B55.6070007@nvidia.com>
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2012-08-08 15:38 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
thomas.ab-Sze3O3UU22JBDgjK7y7TUQ, Alexandre Courbot
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: <Query> Reg: Adding a gpio initialization sequence in dts is valid or not
[not found] ` <50231B55.6070007-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-08-17 10:37 ` Leela Krishna Amudala
[not found] ` <CAL1wa8d-6qXOXS2+sVZAgnpGw0-x03WKpOhiVhSKZ3JoQZW1fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Leela Krishna Amudala @ 2012-08-17 10:37 UTC (permalink / raw)
To: Alex Courbot
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
thomas.ab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
[-- Attachment #1: Type: text/plain, Size: 4445 bytes --]
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@2 {
id = "enable-gpio1";
enable;
post-delay = <20>;
};
gpio@3 {
id = "enable-gpio1";
disable;
post-delay = <20>;
};
gpio@4 {
id = "enable-gpio1";
enable;
post-delay = <20>;
};
gpio@5 {
id = "enable-gpio2";
disable;
post-delay = <20>;
};
};
power-off-sequence {
gpio@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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> 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.
> -----------------------------------------------------------------------------------
[-- Attachment #2: gpio_sequence.jpg --]
[-- Type: image/jpeg, Size: 7302 bytes --]
[-- Attachment #3: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: <Query> Reg: Adding a gpio initialization sequence in dts is valid or not
[not found] ` <CAL1wa8d-6qXOXS2+sVZAgnpGw0-x03WKpOhiVhSKZ3JoQZW1fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-08-17 15:13 ` Stephen Warren
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2012-08-17 15:13 UTC (permalink / raw)
To: Leela Krishna Amudala
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
thomas.ab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, Alex Courbot
On 08/17/2012 04:37 AM, Leela Krishna Amudala wrote:
> Hello,
>
> I think you misinterpreted my question.
>
...
> 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.
Yes, I think that kind of thing is exactly what the power sequences
bindings/driver are for.
But ...
> 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>;
In your original email, you mentioned that some of those cells for the
GPIO control the state features such as pull-up/-down and
drive-strength. Those two features should really be configured by
pinctrl not by the GPIO bindings, although that's a comment on the GPIO
bindings itself, and nothing to do with power sequences.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-08-17 15:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08 9:52 <Query> Reg: Adding a gpio initialization sequence in dts is valid or not Leela Krishna Amudala
[not found] ` <CAL1wa8fjJg33vVM4ZOFuA2ACps55cahoK65MDf4ebAi9B6KUxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-08 13:30 ` Rob Herring
[not found] ` <502269EC.2070008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-08 15:38 ` Stephen Warren
[not found] ` <50231B55.6070007@nvidia.com>
[not found] ` <50231B55.6070007-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-17 10:37 ` Leela Krishna Amudala
[not found] ` <CAL1wa8d-6qXOXS2+sVZAgnpGw0-x03WKpOhiVhSKZ3JoQZW1fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-17 15:13 ` Stephen Warren
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).