aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-28 19:09:57 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-28 19:09:57 -0400
commit2604f6da1afb56fae5930b58349e43a2b0345933 (patch)
tree1744196a8cf6bf3edfd7ad63c6a10f1609bd206a
parent18c8baff8fe151ea02e00047afc369ee31939e9b (diff)
parent0f7ad450394560a6b6c72115e04bf7afd6230e70 (diff)
Automatic merge of master.kernel.org:/home/rmk/linux-2.6-rmk.git
-rw-r--r--drivers/video/amba-clcd.c14
-rw-r--r--include/asm-arm/hardware/amba_clcd.h31
-rw-r--r--include/asm-arm/hardware/clock.h7
3 files changed, 34 insertions, 18 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index acdba0c67fb8..3e386fd4c5c6 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -125,11 +125,11 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
125 case 2: 125 case 2:
126 case 4: 126 case 4:
127 case 8: 127 case 8:
128 var->red.length = 8; 128 var->red.length = var->bits_per_pixel;
129 var->red.offset = 0; 129 var->red.offset = 0;
130 var->green.length = 8; 130 var->green.length = var->bits_per_pixel;
131 var->green.offset = 0; 131 var->green.offset = 0;
132 var->blue.length = 8; 132 var->blue.length = var->bits_per_pixel;
133 var->blue.offset = 0; 133 var->blue.offset = 0;
134 break; 134 break;
135 case 16: 135 case 16:
@@ -146,7 +146,7 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
146 var->blue.offset = 10; 146 var->blue.offset = 10;
147 } 147 }
148 break; 148 break;
149 case 24: 149 case 32:
150 if (fb->panel->cntl & CNTL_LCDTFT) { 150 if (fb->panel->cntl & CNTL_LCDTFT) {
151 var->red.length = 8; 151 var->red.length = 8;
152 var->green.length = 8; 152 var->green.length = 8;
@@ -178,6 +178,12 @@ static int clcdfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
178 178
179 if (fb->board->check) 179 if (fb->board->check)
180 ret = fb->board->check(fb, var); 180 ret = fb->board->check(fb, var);
181
182 if (ret == 0 &&
183 var->xres_virtual * var->bits_per_pixel / 8 *
184 var->yres_virtual > fb->fb.fix.smem_len)
185 ret = -EINVAL;
186
181 if (ret == 0) 187 if (ret == 0)
182 ret = clcdfb_set_bitfields(fb, var); 188 ret = clcdfb_set_bitfields(fb, var);
183 189
diff --git a/include/asm-arm/hardware/amba_clcd.h b/include/asm-arm/hardware/amba_clcd.h
index 2149be7c7023..ce4cf5c1c05d 100644
--- a/include/asm-arm/hardware/amba_clcd.h
+++ b/include/asm-arm/hardware/amba_clcd.h
@@ -153,7 +153,7 @@ struct clcd_fb {
153 153
154static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) 154static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
155{ 155{
156 u32 val; 156 u32 val, cpl;
157 157
158 /* 158 /*
159 * Program the CLCD controller registers and start the CLCD 159 * Program the CLCD controller registers and start the CLCD
@@ -164,7 +164,10 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
164 val |= (fb->fb.var.left_margin - 1) << 24; 164 val |= (fb->fb.var.left_margin - 1) << 24;
165 regs->tim0 = val; 165 regs->tim0 = val;
166 166
167 val = fb->fb.var.yres - 1; 167 val = fb->fb.var.yres;
168 if (fb->panel->cntl & CNTL_LCDDUAL)
169 val /= 2;
170 val -= 1;
168 val |= (fb->fb.var.vsync_len - 1) << 10; 171 val |= (fb->fb.var.vsync_len - 1) << 10;
169 val |= fb->fb.var.lower_margin << 16; 172 val |= fb->fb.var.lower_margin << 16;
170 val |= fb->fb.var.upper_margin << 24; 173 val |= fb->fb.var.upper_margin << 24;
@@ -174,13 +177,17 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
174 val |= fb->fb.var.sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS; 177 val |= fb->fb.var.sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS;
175 val |= fb->fb.var.sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS; 178 val |= fb->fb.var.sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS;
176 179
177 if (fb->panel->cntl & CNTL_LCDTFT) 180 cpl = fb->fb.var.xres_virtual;
178 val |= (fb->fb.var.xres_virtual - 1) << 16; 181 if (fb->panel->cntl & CNTL_LCDTFT) /* TFT */
179 else if (fb->panel->cntl & CNTL_LCDBW) 182 /* / 1 */;
180 printk("what value for CPL for stnmono panels?"); 183 else if (!fb->fb.var.grayscale) /* STN color */
181 else 184 cpl = cpl * 8 / 3;
182 val |= ((fb->fb.var.xres_virtual * 8 / 3) - 1) << 16; 185 else if (fb->panel->cntl & CNTL_LCDMONO8) /* STN monochrome, 8bit */
183 regs->tim2 = val; 186 cpl /= 8;
187 else /* STN monochrome, 4bit */
188 cpl /= 4;
189
190 regs->tim2 = val | ((cpl - 1) << 16);
184 191
185 regs->tim3 = fb->panel->tim3; 192 regs->tim3 = fb->panel->tim3;
186 193
@@ -204,7 +211,7 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
204 case 16: 211 case 16:
205 val |= CNTL_LCDBPP16; 212 val |= CNTL_LCDBPP16;
206 break; 213 break;
207 case 24: 214 case 32:
208 val |= CNTL_LCDBPP24; 215 val |= CNTL_LCDBPP24;
209 break; 216 break;
210 } 217 }
@@ -215,8 +222,8 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
215 222
216static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) 223static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var)
217{ 224{
218 var->xres_virtual = var->xres = (var->xres + 7) & ~7; 225 var->xres_virtual = var->xres = (var->xres + 15) & ~15;
219 var->yres_virtual = var->yres; 226 var->yres_virtual = var->yres = (var->yres + 1) & ~1;
220 227
221#define CHECK(e,l,h) (var->e < l || var->e > h) 228#define CHECK(e,l,h) (var->e < l || var->e > h)
222 if (CHECK(right_margin, (5+1), 256) || /* back porch */ 229 if (CHECK(right_margin, (5+1), 256) || /* back porch */
diff --git a/include/asm-arm/hardware/clock.h b/include/asm-arm/hardware/clock.h
index 4983449ff2c7..19da861e523d 100644
--- a/include/asm-arm/hardware/clock.h
+++ b/include/asm-arm/hardware/clock.h
@@ -26,10 +26,13 @@ struct clk;
26/** 26/**
27 * clk_get - lookup and obtain a reference to a clock producer. 27 * clk_get - lookup and obtain a reference to a clock producer.
28 * @dev: device for clock "consumer" 28 * @dev: device for clock "consumer"
29 * @id: device ID 29 * @id: clock comsumer ID
30 * 30 *
31 * Returns a struct clk corresponding to the clock producer, or 31 * Returns a struct clk corresponding to the clock producer, or
32 * valid IS_ERR() condition containing errno. 32 * valid IS_ERR() condition containing errno. The implementation
33 * uses @dev and @id to determine the clock consumer, and thereby
34 * the clock producer. (IOW, @id may be identical strings, but
35 * clk_get may return different clock producers depending on @dev.)
33 */ 36 */
34struct clk *clk_get(struct device *dev, const char *id); 37struct clk *clk_get(struct device *dev, const char *id);
35 38