* [PATCH] backlight: l4f00242t03: Fix reset sequence
@ 2010-11-28 17:13 Alberto Panizzo
2010-11-29 15:36 ` [PATCH] backlight: l4f00242t03: Prevent unbalanced calls to regulator enable/disable Alberto Panizzo
2011-01-04 23:59 ` [PATCH] backlight: l4f00242t03: Fix reset sequence Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Alberto Panizzo @ 2010-11-28 17:13 UTC (permalink / raw)
To: Andrew Morton
Cc: Richard Purdie, Marek Vasut, Tejun Heo, Axel Lin, linux-kernel
The reset command is part of the init sequence and it take effect
only if the lcd is powered.
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---
This patch is built on top of:
http://userweb.kernel.org/~akpm/mmotm/broken-out/drivers-video-backlight-l4f00242t03c-full-implement-fb-power-states-for-this-lcd.patch
drivers/video/backlight/l4f00242t03.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index 5d25743..c04aa90 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -62,6 +62,8 @@ static void l4f00242t03_lcd_init(struct spi_device *spi)
regulator_enable(priv->core_reg);
}
+ l4f00242t03_reset(pdata->reset_gpio);
+
gpio_set_value(pdata->data_enable_gpio, 1);
msleep(60);
spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16));
@@ -225,7 +227,6 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
}
/* Init the LCD */
- l4f00242t03_reset(pdata->reset_gpio);
l4f00242t03_lcd_init(spi);
priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_UNBLANK);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] backlight: l4f00242t03: Prevent unbalanced calls to regulator enable/disable
2010-11-28 17:13 [PATCH] backlight: l4f00242t03: Fix reset sequence Alberto Panizzo
@ 2010-11-29 15:36 ` Alberto Panizzo
2011-01-04 23:59 ` [PATCH] backlight: l4f00242t03: Fix reset sequence Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Alberto Panizzo @ 2010-11-29 15:36 UTC (permalink / raw)
To: Andrew Morton
Cc: Richard Purdie, Marek Vasut, Tejun Heo, Axel Lin, linux-kernel
Otherwise a double call to:
$ echo 4 > /sys/class/lcd/l4f00242t03/lcd_power
Will, the first power down the lcd and regulators correctly and the
second produce an unbalanced call to regulator disable.
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---
This patch follow the one this mail is answering.
Thanks for reviewing.
Best regards,
Alberto!
drivers/video/backlight/l4f00242t03.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index c04aa90..98ad3e5 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -136,10 +136,12 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
}
} else {
/* power == FB_BLANK_POWERDOWN */
- /* Clear the screen before shutting down */
- spi_write(spi, (const u8 *)&disoff, sizeof(u16));
- msleep(60);
- l4f00242t03_lcd_powerdown(spi);
+ if (priv->lcd_state != FB_BLANK_POWERDOWN) {
+ /* Clear the screen before shutting down */
+ spi_write(spi, (const u8 *)&disoff, sizeof(u16));
+ msleep(60);
+ l4f00242t03_lcd_powerdown(spi);
+ }
}
priv->lcd_state = power;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] backlight: l4f00242t03: Fix reset sequence
2010-11-28 17:13 [PATCH] backlight: l4f00242t03: Fix reset sequence Alberto Panizzo
2010-11-29 15:36 ` [PATCH] backlight: l4f00242t03: Prevent unbalanced calls to regulator enable/disable Alberto Panizzo
@ 2011-01-04 23:59 ` Andrew Morton
2011-01-05 0:32 ` Alberto Panizzo
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2011-01-04 23:59 UTC (permalink / raw)
To: Alberto Panizzo
Cc: Richard Purdie, Marek Vasut, Tejun Heo, Axel Lin, linux-kernel
On Sun, 28 Nov 2010 18:13:53 +0100
Alberto Panizzo <maramaopercheseimorto@gmail.com> wrote:
> The reset command is part of the init sequence and it take effect
> only if the lcd is powered.
>
> Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
> ---
>
> This patch is built on top of:
> http://userweb.kernel.org/~akpm/mmotm/broken-out/drivers-video-backlight-l4f00242t03c-full-implement-fb-power-states-for-this-lcd.patch
>
> drivers/video/backlight/l4f00242t03.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
> index 5d25743..c04aa90 100644
> --- a/drivers/video/backlight/l4f00242t03.c
> +++ b/drivers/video/backlight/l4f00242t03.c
> @@ -62,6 +62,8 @@ static void l4f00242t03_lcd_init(struct spi_device *spi)
> regulator_enable(priv->core_reg);
> }
>
> + l4f00242t03_reset(pdata->reset_gpio);
> +
> gpio_set_value(pdata->data_enable_gpio, 1);
> msleep(60);
> spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16));
> @@ -225,7 +227,6 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
> }
>
> /* Init the LCD */
> - l4f00242t03_reset(pdata->reset_gpio);
> l4f00242t03_lcd_init(spi);
> priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
> l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_UNBLANK);
What were the user-visible effects of the bug which you just fixed?
Please always include this info when sending a bugfix! Because without
that info it's much harder to work out whether we should backport the
fix into earlier kernels and it's harder for end-users and distro
maintainers to work out if the patch will fix particular behaviour
which they or their customers are seeing.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] backlight: l4f00242t03: Fix reset sequence
2011-01-04 23:59 ` [PATCH] backlight: l4f00242t03: Fix reset sequence Andrew Morton
@ 2011-01-05 0:32 ` Alberto Panizzo
0 siblings, 0 replies; 4+ messages in thread
From: Alberto Panizzo @ 2011-01-05 0:32 UTC (permalink / raw)
To: Andrew Morton
Cc: Richard Purdie, Marek Vasut, Tejun Heo, Axel Lin, linux-kernel
On Tue, 2011-01-04 at 15:59 -0800, Andrew Morton wrote:
> On Sun, 28 Nov 2010 18:13:53 +0100
> Alberto Panizzo <maramaopercheseimorto@gmail.com> wrote:
>
> > The reset command is part of the init sequence and it take effect
> > only if the lcd is powered.
> >
> > Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
> > ---
> >
> > This patch is built on top of:
> > http://userweb.kernel.org/~akpm/mmotm/broken-out/drivers-video-backlight-l4f00242t03c-full-implement-fb-power-states-for-this-lcd.patch
> >
> > drivers/video/backlight/l4f00242t03.c | 3 ++-
> > 1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
> > index 5d25743..c04aa90 100644
> > --- a/drivers/video/backlight/l4f00242t03.c
> > +++ b/drivers/video/backlight/l4f00242t03.c
> > @@ -62,6 +62,8 @@ static void l4f00242t03_lcd_init(struct spi_device *spi)
> > regulator_enable(priv->core_reg);
> > }
> >
> > + l4f00242t03_reset(pdata->reset_gpio);
> > +
> > gpio_set_value(pdata->data_enable_gpio, 1);
> > msleep(60);
> > spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16));
> > @@ -225,7 +227,6 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
> > }
> >
> > /* Init the LCD */
> > - l4f00242t03_reset(pdata->reset_gpio);
> > l4f00242t03_lcd_init(spi);
> > priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
> > l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_UNBLANK);
>
> What were the user-visible effects of the bug which you just fixed?
>
> Please always include this info when sending a bugfix! Because without
> that info it's much harder to work out whether we should backport the
> fix into earlier kernels and it's harder for end-users and distro
> maintainers to work out if the patch will fix particular behaviour
> which they or their customers are seeing.
>
The effect of the bug was that the sequence:
set lcd power_state to FB_BLANK_POWERDOWN
set lcd power_state to FB_BLANK_UNBLANK
Did not produced a complete reboot of the LCD which was showing fuzzy
colours.
This was not experienced before implementing correctly all the LCD power
states with the patch [1]. Since before the patch [1] the regulators
were not touched and the LCD shutdown was reached with a register
write. After the patch [1] a complete boot sequence with an initial
reset is needed for the display every time the LCD is powered up.
drivers-video-backlight-l4f00242t03c-full-implement-fb-power-states-for-this-lcd.patch
Best Regards,
--
Alberto!
Be Persistent!
- Greg Kroah-Hartman (FOSDEM 2010)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-05 0:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-28 17:13 [PATCH] backlight: l4f00242t03: Fix reset sequence Alberto Panizzo
2010-11-29 15:36 ` [PATCH] backlight: l4f00242t03: Prevent unbalanced calls to regulator enable/disable Alberto Panizzo
2011-01-04 23:59 ` [PATCH] backlight: l4f00242t03: Fix reset sequence Andrew Morton
2011-01-05 0:32 ` Alberto Panizzo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox