Hello,
this is v2 of the series which addresses the review comments I got vor
(implicit) v1.
For patch 2 the question is still open if this is the right fix, but
without this the display doesn't stay on. Patches 1 and 3 should be
applicable independant of patch 2.
Best regards
Uwe
Uwe Kleine-König (3):
video: fbdev: imxfb: fix semantic of .get_power and .set_power
video: fbdev: imxfb: enable lcd regulator in .probe
video: fbdev: imxfb: add some error handling
drivers/video/fbdev/imxfb.c | 53 +++++++++++++++++++++++++++++++++++----------
1 file changed, 41 insertions(+), 12 deletions(-)
--
2.8.0.rc3
.set_power gets passed an FB_BLANK_XXX value, not a bool. So 0 signals
on; and >1 means off. The same applies for return values of .get_power.
Signed-off-by: Uwe Kleine-König <redacted>
---
Changes since (implicit) v1, sent with
Message-Id: 1457380425-20244-2-git-send-email-u.kleine-koenig@pengutronix.de
- Make it explicit that we're working on FB_BLANK_XXX values,
suggested by Philipp Zabel.
drivers/video/fbdev/imxfb.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
This asserts that the display is on after the driver is initialized.
Otherwise, depending on how the boot loader handled the display, it is
either disabled as the regulator doesn't seem in use, or it stays off.
Signed-off-by: Uwe Kleine-König <redacted>
---
No changes since (implicit) v1, sent with
Message-Id: 1457380425-20244-3-git-send-email-u.kleine-koenig@pengutronix.de
drivers/video/fbdev/imxfb.c | 9 +++++++++
1 file changed, 9 insertions(+)
clk_prepare_enable can fail and if it does the controller must not be
considered enabled. So check for errors, properly unwind and give the
error code back to the caller.
While touching the clock code also enable the clocks in the same
direction and disable in reverse order.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Uwe Kleine-König <redacted>
---
Changes since (implicit) v1, sent with
Message-Id: 1457380425-20244-4-git-send-email-u.kleine-koenig@pengutronix.de
- Some simplifications suggested and Reviewed-by Philipp Zabel
- Rework goto labels to have them at the end of the function
(Tomi Valkeinen).
drivers/video/fbdev/imxfb.c | 35 +++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)
Am Mittwoch, den 04.05.2016, 11:43 +0200 schrieb Uwe Kleine-König:
.set_power gets passed an FB_BLANK_XXX value, not a bool. So 0 signals
on; and >1 means off. The same applies for return values of .get_power.
Signed-off-by: Uwe Kleine-König <redacted>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
From: Tomi Valkeinen <hidden> Date: 2016-05-10 08:47:38
Hi,
On 04/05/16 12:43, Uwe Kleine-König wrote:
Hello,
this is v2 of the series which addresses the review comments I got vor
(implicit) v1.
For patch 2 the question is still open if this is the right fix, but
without this the display doesn't stay on. Patches 1 and 3 should be
applicable independant of patch 2.
I picked patches 1 and 3, they look fine.
I still think patch 2 is just broken, it doesn't make sense to me.
If the regulator is enabled in probe, then it's always on, and
imxfb_lcd_set_power() should be removed as it never has any effect. But
that doesn't sound correct, as presumably the imxfb_lcd_set_power() has
worked at some point.
And shouldn't the regulator be disabled at least when suspending?
Tomi
Hello Tomi,
On Tue, May 10, 2016 at 11:47:38AM +0300, Tomi Valkeinen wrote:
On 04/05/16 12:43, Uwe Kleine-König wrote:
quoted
this is v2 of the series which addresses the review comments I got vor
(implicit) v1.
For patch 2 the question is still open if this is the right fix, but
without this the display doesn't stay on. Patches 1 and 3 should be
applicable independant of patch 2.
I picked patches 1 and 3, they look fine.
Thanks.
I still think patch 2 is just broken, it doesn't make sense to me.
What do you think should happen during startup? Something should call
the set_power callback to enable the device? Or should that only happen
when something writes to /dev/fb0?
If the regulator is enabled in probe, then it's always on, and
imxfb_lcd_set_power() should be removed as it never has any effect. But
that doesn't sound correct, as presumably the imxfb_lcd_set_power() has
worked at some point.
I think it worked back when unused regulators were not disabled during
boot.
And shouldn't the regulator be disabled at least when suspending?
Yeah, but maybe the core should call set_power(off) then? (Don't know,
maybe that cannot work.)
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
From: Tomi Valkeinen <hidden> Date: 2016-05-10 10:06:56
On 10/05/16 12:05, Uwe Kleine-König wrote:
Hello Tomi,
On Tue, May 10, 2016 at 11:47:38AM +0300, Tomi Valkeinen wrote:
quoted
On 04/05/16 12:43, Uwe Kleine-König wrote:
quoted
this is v2 of the series which addresses the review comments I got vor
(implicit) v1.
For patch 2 the question is still open if this is the right fix, but
without this the display doesn't stay on. Patches 1 and 3 should be
applicable independant of patch 2.
I picked patches 1 and 3, they look fine.
Thanks.
quoted
I still think patch 2 is just broken, it doesn't make sense to me.
What do you think should happen during startup? Something should call
the set_power callback to enable the device? Or should that only happen
when something writes to /dev/fb0?
I think the panel should be enabled at startup, as with fbdev there's no
specific enable call. So I don't have a problem with enabling the panel
at startup, but just that the regulator enables/disables don't seem to
match.
quoted
If the regulator is enabled in probe, then it's always on, and
imxfb_lcd_set_power() should be removed as it never has any effect. But
that doesn't sound correct, as presumably the imxfb_lcd_set_power() has
worked at some point.
I think it worked back when unused regulators were not disabled during
boot.
Is imxfb_lcd_set_power() ever called, or just not at startup? If it is
called properly later, then perhaps you just need to kick it at startup
time to enable it. Maybe imxfb_lcd_set_power(lcd, FB_BLANK_UNBLANK);
Did you try unloading the module (both when the LCD is enabled and when
it's disabled), and seeing that the regulator gets disabled when you
unload it?
Tomi