* [PATCH] amba_clcd: Check min clock limits based on selected mode
@ 2010-09-01 15:12 wellsk40 at gmail.com
2010-09-02 16:08 ` Russell King - ARM Linux
0 siblings, 1 reply; 2+ messages in thread
From: wellsk40 at gmail.com @ 2010-09-01 15:12 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
Check the minimum clock limits based on whether TFT or STN mode
is selected. Some TFT panels have nominal values under the
minimum STN constraints.
Tested on a PL111/TFT LCD combo at hsync_len=3(HSW),
right_margin=3(HBP), and left_margin=22(HFP).
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
include/linux/amba/clcd.h | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h
index be33b3a..c1efe89 100644
--- a/include/linux/amba/clcd.h
+++ b/include/linux/amba/clcd.h
@@ -233,14 +233,29 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var)
{
+ u32 hbp, hfp, hsw;
+
+ /*
+ * These clock constraints are for the pl11x DMA latency. TFT mode
+ * is slightly faster than STN
+ */
+ if (fb->panel->cntl & CNTL_LCDTFT) {
+ /* No TFT constraint given for min TFT HFP clocks in TRM */
+ hbp = hfp = (2 + 1);
+ hsw = (2 + 1);
+ } else {
+ hbp = hfp = (5 + 1);
+ hsw = (3 + 1);
+ }
+
var->xres_virtual = var->xres = (var->xres + 15) & ~15;
var->yres_virtual = var->yres = (var->yres + 1) & ~1;
#define CHECK(e,l,h) (var->e < l || var->e > h)
- if (CHECK(right_margin, (5+1), 256) || /* back porch */
- CHECK(left_margin, (5+1), 256) || /* front porch */
- CHECK(hsync_len, (5+1), 256) ||
- var->xres > 4096 ||
+ if (CHECK(right_margin, hbp, 256) || /* back porch */
+ CHECK(left_margin, hfp, 256) || /* front porch */
+ CHECK(hsync_len, hsw, 256) ||
+ var->xres > 1024 ||
var->lower_margin > 255 || /* back porch */
var->upper_margin > 255 || /* front porch */
var->vsync_len > 32 ||
--
1.7.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] amba_clcd: Check min clock limits based on selected mode
2010-09-01 15:12 [PATCH] amba_clcd: Check min clock limits based on selected mode wellsk40 at gmail.com
@ 2010-09-02 16:08 ` Russell King - ARM Linux
0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2010-09-02 16:08 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 01, 2010 at 08:12:14AM -0700, wellsk40 at gmail.com wrote:
> From: Kevin Wells <wellsk40@gmail.com>
>
> Check the minimum clock limits based on whether TFT or STN mode
> is selected. Some TFT panels have nominal values under the
> minimum STN constraints.
>
> Tested on a PL111/TFT LCD combo at hsync_len=3(HSW),
> right_margin=3(HBP), and left_margin=22(HFP).
Ok.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-02 16:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-01 15:12 [PATCH] amba_clcd: Check min clock limits based on selected mode wellsk40 at gmail.com
2010-09-02 16:08 ` Russell King - ARM Linux
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).