From: Philipp Zabel <p.zabel@pengutronix.de>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] pwm-backlight: fix the panel power sequence
Date: Fri, 30 Oct 2015 10:34:31 +0000 [thread overview]
Message-ID: <1446201271.3334.22.camel@pengutronix.de> (raw)
In-Reply-To: <1446190900.17558.16.camel@mtksdaap41>
Am Freitag, den 30.10.2015, 15:41 +0800 schrieb YH Huang:
> > That won't work if the gpio is still configured as input. How about I
> > add the GPIOD_ASIS change to my patch you remove that and the above from
> > yours?
>
> I revise these two lines
> if (pb->enable_gpio)
> gpiod_direction_output(pb->enable_gpio, 0);
> into
> if (pb->enable_gpio) {
> if(gpiod_get_value(pb->enable_gpio) = 0)
> gpiod_direction_output(pb->enable_gpio, 0);
> else
> gpiod_direction_output(pb->enable_gpio, 1);
> }
If the GPIO is still configured as an input, the return value of
gpiod_get_value could be random.
> I am not sure what "phandle" is working for.
The reasoning is that devices where there is no phandle link pointing to
the backlight (for example from a simple-panel node), we should keep the
current default behaviour (enable during probe).
> My change is like your patch but remove the "phandle related" and
> "gpiod_get_direction(pb->enable_gpio) = GPIOF_DIR_OUT".
> Do we really need these?
See above, I wanted to be careful not to change existing behavior in
unexpected ways.
> Also, do you think it is right that I do the "pwm_enable(pb->pwm);"
> before "gpiod_set_value(pb->enable_gpio, 1);" in power on function?
That is unclear to me, because I'm sure that depends on the actual
constant current LED driver used.
I suspect EN and PWM pins are completely independent on a lot of them,
so enabling EN last should be ok to work around the problem that the PWM
pin state might not be well defined when the PWM is disabled.
For example, the STCS1A datasheet doesn't mention any order for enabling
EN and PWM. In the LP8545 datasheet, the modes of operation state
diagram suggests that enabling EN first is the proper way, on the other
hand the PWM interface characteristics table also lists a startup delay
for a rising EN edge while PWM is already active.
But I'm not sure that there aren't any LED drivers that somehow have a
problem with this order.
regards
Philipp
next prev parent reply other threads:[~2015-10-30 10:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 9:17 [PATCH v2] pwm-backlight: fix the panel power sequence YH Huang
2015-10-16 9:36 ` Philipp Zabel
2015-10-22 15:12 ` YH Huang
2015-10-29 15:40 ` Philipp Zabel
2015-10-30 7:41 ` YH Huang
2015-10-30 10:34 ` Philipp Zabel [this message]
2015-11-03 8:11 ` YH Huang
2015-11-03 11:08 ` Philipp Zabel
2015-11-04 1:47 ` YH Huang
2015-11-05 9:40 ` Philipp Zabel
2015-11-06 8:31 ` YH Huang
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=1446201271.3334.22.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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).