aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c2
-rw-r--r--arch/arm/mach-at91/board-neocore926.c2
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c4
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c2
-rw-r--r--drivers/video/Kconfig1
-rw-r--r--drivers/video/Makefile2
-rw-r--r--drivers/video/atmel_lcdfb.c41
-rw-r--r--drivers/video/cirrusfb.c268
-rw-r--r--drivers/video/display/Kconfig24
-rw-r--r--drivers/video/display/Makefile6
-rw-r--r--drivers/video/display/display-sysfs.c219
-rw-r--r--drivers/video/s3c-fb.c3
-rw-r--r--include/linux/display.h61
-rw-r--r--include/linux/zorro_ids.h4
16 files changed, 186 insertions, 457 deletions
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index 5dffd3be62d2..911d9862e6ff 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -299,7 +299,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
299 .xres = 240, .yres = 320, 299 .xres = 240, .yres = 320,
300 .pixclock = KHZ2PICOS(4965), 300 .pixclock = KHZ2PICOS(4965),
301 301
302 .left_margin = 1, .right_margin = 33, 302 .left_margin = 1, .right_margin = 34,
303 .upper_margin = 1, .lower_margin = 0, 303 .upper_margin = 1, .lower_margin = 0,
304 .hsync_len = 5, .vsync_len = 1, 304 .hsync_len = 5, .vsync_len = 1,
305 305
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index ef816c17dc61..190dc19ce467 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -230,7 +230,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
230 .xres = 240, .yres = 320, 230 .xres = 240, .yres = 320,
231 .pixclock = KHZ2PICOS(5000), 231 .pixclock = KHZ2PICOS(5000),
232 232
233 .left_margin = 1, .right_margin = 33, 233 .left_margin = 1, .right_margin = 34,
234 .upper_margin = 1, .lower_margin = 0, 234 .upper_margin = 1, .lower_margin = 0,
235 .hsync_len = 5, .vsync_len = 1, 235 .hsync_len = 5, .vsync_len = 1,
236 236
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index b005b738e8ff..4f469ea46969 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -365,7 +365,7 @@ static struct fb_videomode at91_stn_modes[] = {
365 .xres = 320, .yres = 240, 365 .xres = 320, .yres = 240,
366 .pixclock = KHZ2PICOS(1440), 366 .pixclock = KHZ2PICOS(1440),
367 367
368 .left_margin = 1, .right_margin = 1, 368 .left_margin = 1, .right_margin = 2,
369 .upper_margin = 0, .lower_margin = 0, 369 .upper_margin = 0, .lower_margin = 0,
370 .hsync_len = 1, .vsync_len = 1, 370 .hsync_len = 1, .vsync_len = 1,
371 371
@@ -426,7 +426,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
426 .xres = 240, .yres = 320, 426 .xres = 240, .yres = 320,
427 .pixclock = KHZ2PICOS(4965), 427 .pixclock = KHZ2PICOS(4965),
428 428
429 .left_margin = 1, .right_margin = 33, 429 .left_margin = 1, .right_margin = 34,
430 .upper_margin = 1, .lower_margin = 0, 430 .upper_margin = 1, .lower_margin = 0,
431 .hsync_len = 5, .vsync_len = 1, 431 .hsync_len = 5, .vsync_len = 1,
432 432
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index bccdcf23caa1..0e96ee9e4ad3 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -253,7 +253,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
253 .xres = 240, .yres = 320, 253 .xres = 240, .yres = 320,
254 .pixclock = KHZ2PICOS(4965), 254 .pixclock = KHZ2PICOS(4965),
255 255
256 .left_margin = 1, .right_margin = 33, 256 .left_margin = 1, .right_margin = 34,
257 .upper_margin = 1, .lower_margin = 0, 257 .upper_margin = 1, .lower_margin = 0,
258 .hsync_len = 5, .vsync_len = 1, 258 .hsync_len = 5, .vsync_len = 1,
259 259
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 92de9127923a..855c68b378d6 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -192,7 +192,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
192 .xres = 480, .yres = 272, 192 .xres = 480, .yres = 272,
193 .pixclock = KHZ2PICOS(9000), 193 .pixclock = KHZ2PICOS(9000),
194 194
195 .left_margin = 1, .right_margin = 1, 195 .left_margin = 1, .right_margin = 2,
196 .upper_margin = 40, .lower_margin = 1, 196 .upper_margin = 40, .lower_margin = 1,
197 .hsync_len = 45, .vsync_len = 1, 197 .hsync_len = 45, .vsync_len = 1,
198 198
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index b2b748239f36..0e943a2d9502 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -149,7 +149,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
149 .xres = 240, .yres = 320, 149 .xres = 240, .yres = 320,
150 .pixclock = KHZ2PICOS(4965), 150 .pixclock = KHZ2PICOS(4965),
151 151
152 .left_margin = 1, .right_margin = 33, 152 .left_margin = 1, .right_margin = 34,
153 .upper_margin = 1, .lower_margin = 0, 153 .upper_margin = 1, .lower_margin = 0,
154 .hsync_len = 5, .vsync_len = 1, 154 .hsync_len = 5, .vsync_len = 1,
155 155
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index d83e967e4e15..dcf0a828f66e 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2413,7 +2413,6 @@ source "drivers/video/omap/Kconfig"
2413source "drivers/video/omap2/Kconfig" 2413source "drivers/video/omap2/Kconfig"
2414 2414
2415source "drivers/video/backlight/Kconfig" 2415source "drivers/video/backlight/Kconfig"
2416source "drivers/video/display/Kconfig"
2417 2416
2418if VT 2417if VT
2419 source "drivers/video/console/Kconfig" 2418 source "drivers/video/console/Kconfig"
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 9b9d8fff7732..142606814d98 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -13,7 +13,7 @@ fb-objs := $(fb-y)
13 13
14obj-$(CONFIG_VT) += console/ 14obj-$(CONFIG_VT) += console/
15obj-$(CONFIG_LOGO) += logo/ 15obj-$(CONFIG_LOGO) += logo/
16obj-y += backlight/ display/ 16obj-y += backlight/
17 17
18obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o 18obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o
19obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o 19obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 63409c122ae8..ced4419e56e2 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -100,8 +100,11 @@ static int atmel_bl_update_status(struct backlight_device *bl)
100 brightness = 0; 100 brightness = 0;
101 101
102 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness); 102 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness);
103 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 103 if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE)
104 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
104 brightness ? contrast_ctr : 0); 105 brightness ? contrast_ctr : 0);
106 else
107 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
105 108
106 bl->props.fb_blank = bl->props.power = sinfo->bl_power = power; 109 bl->props.fb_blank = bl->props.power = sinfo->bl_power = power;
107 110
@@ -397,7 +400,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
397 var->lower_margin = min_t(u32, var->lower_margin, 400 var->lower_margin = min_t(u32, var->lower_margin,
398 ATMEL_LCDC_VFP); 401 ATMEL_LCDC_VFP);
399 var->right_margin = min_t(u32, var->right_margin, 402 var->right_margin = min_t(u32, var->right_margin,
400 (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 1); 403 (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 2);
401 var->hsync_len = min_t(u32, var->hsync_len, 404 var->hsync_len = min_t(u32, var->hsync_len,
402 (ATMEL_LCDC_HPW >> ATMEL_LCDC_HPW_OFFSET) + 1); 405 (ATMEL_LCDC_HPW >> ATMEL_LCDC_HPW_OFFSET) + 1);
403 var->left_margin = min_t(u32, var->left_margin, 406 var->left_margin = min_t(u32, var->left_margin,
@@ -582,7 +585,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
582 lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value); 585 lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value);
583 586
584 /* Horizontal timing */ 587 /* Horizontal timing */
585 value = (info->var.right_margin - 1) << ATMEL_LCDC_HFP_OFFSET; 588 value = (info->var.right_margin - 2) << ATMEL_LCDC_HFP_OFFSET;
586 value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET; 589 value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET;
587 value |= (info->var.left_margin - 1); 590 value |= (info->var.left_margin - 1);
588 dev_dbg(info->device, " * LCDTIM2 = %08lx\n", value); 591 dev_dbg(info->device, " * LCDTIM2 = %08lx\n", value);
@@ -682,14 +685,30 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
682 685
683 case FB_VISUAL_PSEUDOCOLOR: 686 case FB_VISUAL_PSEUDOCOLOR:
684 if (regno < 256) { 687 if (regno < 256) {
685 val = ((red >> 11) & 0x001f); 688 if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
686 val |= ((green >> 6) & 0x03e0); 689 || cpu_is_at91sam9rl()) {
687 val |= ((blue >> 1) & 0x7c00); 690 /* old style I+BGR:555 */
688 691 val = ((red >> 11) & 0x001f);
689 /* 692 val |= ((green >> 6) & 0x03e0);
690 * TODO: intensity bit. Maybe something like 693 val |= ((blue >> 1) & 0x7c00);
691 * ~(red[10] ^ green[10] ^ blue[10]) & 1 694
692 */ 695 /*
696 * TODO: intensity bit. Maybe something like
697 * ~(red[10] ^ green[10] ^ blue[10]) & 1
698 */
699 } else {
700 /* new style BGR:565 / RGB:565 */
701 if (sinfo->lcd_wiring_mode ==
702 ATMEL_LCDC_WIRING_RGB) {
703 val = ((blue >> 11) & 0x001f);
704 val |= ((red >> 0) & 0xf800);
705 } else {
706 val = ((red >> 11) & 0x001f);
707 val |= ((blue >> 0) & 0xf800);
708 }
709
710 val |= ((green >> 5) & 0x07e0);
711 }
693 712
694 lcdc_writel(sinfo, ATMEL_LCDC_LUT(regno), val); 713 lcdc_writel(sinfo, ATMEL_LCDC_LUT(regno), val);
695 ret = 0; 714 ret = 0;
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 6df7c54db0a3..6ea505c6f0c8 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -280,52 +280,74 @@ MODULE_DEVICE_TABLE(pci, cirrusfb_pci_table);
280#endif /* CONFIG_PCI */ 280#endif /* CONFIG_PCI */
281 281
282#ifdef CONFIG_ZORRO 282#ifdef CONFIG_ZORRO
283static const struct zorro_device_id cirrusfb_zorro_table[] = { 283struct zorrocl {
284 enum cirrus_board type; /* Board type */
285 u32 regoffset; /* Offset of registers in first Zorro device */
286 u32 ramsize; /* Size of video RAM in first Zorro device */
287 /* If zero, use autoprobe on RAM device */
288 u32 ramoffset; /* Offset of video RAM in first Zorro device */
289 zorro_id ramid; /* Zorro ID of RAM device */
290 zorro_id ramid2; /* Zorro ID of optional second RAM device */
291};
292
293static const struct zorrocl zcl_sd64 __devinitconst = {
294 .type = BT_SD64,
295 .ramid = ZORRO_PROD_HELFRICH_SD64_RAM,
296};
297
298static const struct zorrocl zcl_piccolo __devinitconst = {
299 .type = BT_PICCOLO,
300 .ramid = ZORRO_PROD_HELFRICH_PICCOLO_RAM,
301};
302
303static const struct zorrocl zcl_picasso __devinitconst = {
304 .type = BT_PICASSO,
305 .ramid = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM,
306};
307
308static const struct zorrocl zcl_spectrum __devinitconst = {
309 .type = BT_SPECTRUM,
310 .ramid = ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM,
311};
312
313static const struct zorrocl zcl_picasso4_z3 __devinitconst = {
314 .type = BT_PICASSO4,
315 .regoffset = 0x00600000,
316 .ramsize = 4 * MB_,
317 .ramoffset = 0x01000000, /* 0x02000000 for 64 MiB boards */
318};
319
320static const struct zorrocl zcl_picasso4_z2 __devinitconst = {
321 .type = BT_PICASSO4,
322 .regoffset = 0x10000,
323 .ramid = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1,
324 .ramid2 = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM2,
325};
326
327
328static const struct zorro_device_id cirrusfb_zorro_table[] __devinitconst = {
284 { 329 {
285 .id = ZORRO_PROD_HELFRICH_SD64_RAM, 330 .id = ZORRO_PROD_HELFRICH_SD64_REG,
286 .driver_data = BT_SD64, 331 .driver_data = (unsigned long)&zcl_sd64,
287 }, { 332 }, {
288 .id = ZORRO_PROD_HELFRICH_PICCOLO_RAM, 333 .id = ZORRO_PROD_HELFRICH_PICCOLO_REG,
289 .driver_data = BT_PICCOLO, 334 .driver_data = (unsigned long)&zcl_piccolo,
290 }, { 335 }, {
291 .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM, 336 .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG,
292 .driver_data = BT_PICASSO, 337 .driver_data = (unsigned long)&zcl_picasso,
293 }, { 338 }, {
294 .id = ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM, 339 .id = ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG,
295 .driver_data = BT_SPECTRUM, 340 .driver_data = (unsigned long)&zcl_spectrum,
296 }, { 341 }, {
297 .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3, 342 .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3,
298 .driver_data = BT_PICASSO4, 343 .driver_data = (unsigned long)&zcl_picasso4_z3,
344 }, {
345 .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG,
346 .driver_data = (unsigned long)&zcl_picasso4_z2,
299 }, 347 },
300 { 0 } 348 { 0 }
301}; 349};
302MODULE_DEVICE_TABLE(zorro, cirrusfb_zorro_table); 350MODULE_DEVICE_TABLE(zorro, cirrusfb_zorro_table);
303
304static const struct {
305 zorro_id id2;
306 unsigned long size;
307} cirrusfb_zorro_table2[] = {
308 [BT_SD64] = {
309 .id2 = ZORRO_PROD_HELFRICH_SD64_REG,
310 .size = 0x400000
311 },
312 [BT_PICCOLO] = {
313 .id2 = ZORRO_PROD_HELFRICH_PICCOLO_REG,
314 .size = 0x200000
315 },
316 [BT_PICASSO] = {
317 .id2 = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG,
318 .size = 0x200000
319 },
320 [BT_SPECTRUM] = {
321 .id2 = ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG,
322 .size = 0x200000
323 },
324 [BT_PICASSO4] = {
325 .id2 = 0,
326 .size = 0x400000
327 }
328};
329#endif /* CONFIG_ZORRO */ 351#endif /* CONFIG_ZORRO */
330 352
331#ifdef CIRRUSFB_DEBUG 353#ifdef CIRRUSFB_DEBUG
@@ -1956,16 +1978,12 @@ static void cirrusfb_zorro_unmap(struct fb_info *info)
1956 struct cirrusfb_info *cinfo = info->par; 1978 struct cirrusfb_info *cinfo = info->par;
1957 struct zorro_dev *zdev = to_zorro_dev(info->device); 1979 struct zorro_dev *zdev = to_zorro_dev(info->device);
1958 1980
1959 zorro_release_device(zdev); 1981 if (info->fix.smem_start > 16 * MB_)
1960
1961 if (cinfo->btype == BT_PICASSO4) {
1962 cinfo->regbase -= 0x600000;
1963 iounmap((void *)cinfo->regbase);
1964 iounmap(info->screen_base); 1982 iounmap(info->screen_base);
1965 } else { 1983 if (info->fix.mmio_start > 16 * MB_)
1966 if (zorro_resource_start(zdev) > 0x01000000) 1984 iounmap(cinfo->regbase);
1967 iounmap(info->screen_base); 1985
1968 } 1986 zorro_release_device(zdev);
1969} 1987}
1970#endif /* CONFIG_ZORRO */ 1988#endif /* CONFIG_ZORRO */
1971 1989
@@ -2222,115 +2240,116 @@ static struct pci_driver cirrusfb_pci_driver = {
2222static int __devinit cirrusfb_zorro_register(struct zorro_dev *z, 2240static int __devinit cirrusfb_zorro_register(struct zorro_dev *z,
2223 const struct zorro_device_id *ent) 2241 const struct zorro_device_id *ent)
2224{ 2242{
2225 struct cirrusfb_info *cinfo;
2226 struct fb_info *info; 2243 struct fb_info *info;
2244 int error;
2245 const struct zorrocl *zcl;
2227 enum cirrus_board btype; 2246 enum cirrus_board btype;
2228 struct zorro_dev *z2 = NULL; 2247 unsigned long regbase, ramsize, rambase;
2229 unsigned long board_addr, board_size, size; 2248 struct cirrusfb_info *cinfo;
2230 int ret;
2231
2232 btype = ent->driver_data;
2233 if (cirrusfb_zorro_table2[btype].id2)
2234 z2 = zorro_find_device(cirrusfb_zorro_table2[btype].id2, NULL);
2235 size = cirrusfb_zorro_table2[btype].size;
2236 2249
2237 info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev); 2250 info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev);
2238 if (!info) { 2251 if (!info) {
2239 printk(KERN_ERR "cirrusfb: could not allocate memory\n"); 2252 printk(KERN_ERR "cirrusfb: could not allocate memory\n");
2240 ret = -ENOMEM; 2253 return -ENOMEM;
2241 goto err_out; 2254 }
2255
2256 zcl = (const struct zorrocl *)ent->driver_data;
2257 btype = zcl->type;
2258 regbase = zorro_resource_start(z) + zcl->regoffset;
2259 ramsize = zcl->ramsize;
2260 if (ramsize) {
2261 rambase = zorro_resource_start(z) + zcl->ramoffset;
2262 if (zorro_resource_len(z) == 64 * MB_) {
2263 /* Quirk for 64 MiB Picasso IV */
2264 rambase += zcl->ramoffset;
2265 }
2266 } else {
2267 struct zorro_dev *ram = zorro_find_device(zcl->ramid, NULL);
2268 if (!ram || !zorro_resource_len(ram)) {
2269 dev_err(info->device, "No video RAM found\n");
2270 error = -ENODEV;
2271 goto err_release_fb;
2272 }
2273 rambase = zorro_resource_start(ram);
2274 ramsize = zorro_resource_len(ram);
2275 if (zcl->ramid2 &&
2276 (ram = zorro_find_device(zcl->ramid2, NULL))) {
2277 if (zorro_resource_start(ram) != rambase + ramsize) {
2278 dev_warn(info->device,
2279 "Skipping non-contiguous RAM at %pR\n",
2280 &ram->resource);
2281 } else {
2282 ramsize += zorro_resource_len(ram);
2283 }
2284 }
2242 } 2285 }
2243 2286
2244 dev_info(info->device, "%s board detected\n", 2287 dev_info(info->device,
2245 cirrusfb_board_info[btype].name); 2288 "%s board detected, REG at 0x%lx, %lu MiB RAM at 0x%lx\n",
2246 2289 cirrusfb_board_info[btype].name, regbase, ramsize / MB_,
2247 cinfo = info->par; 2290 rambase);
2248 cinfo->btype = btype;
2249
2250 assert(z);
2251 assert(btype != BT_NONE);
2252
2253 board_addr = zorro_resource_start(z);
2254 board_size = zorro_resource_len(z);
2255 info->screen_size = size;
2256 2291
2257 if (!zorro_request_device(z, "cirrusfb")) { 2292 if (!zorro_request_device(z, "cirrusfb")) {
2258 dev_err(info->device, "cannot reserve region 0x%lx, abort\n", 2293 dev_err(info->device, "Cannot reserve %pR\n", &z->resource);
2259 board_addr); 2294 error = -EBUSY;
2260 ret = -EBUSY;
2261 goto err_release_fb; 2295 goto err_release_fb;
2262 } 2296 }
2263 2297
2264 ret = -EIO; 2298 cinfo = info->par;
2265 2299 cinfo->btype = btype;
2266 if (btype == BT_PICASSO4) {
2267 dev_info(info->device, " REG at $%lx\n", board_addr + 0x600000);
2268
2269 /* To be precise, for the P4 this is not the */
2270 /* begin of the board, but the begin of RAM. */
2271 /* for P4, map in its address space in 2 chunks (### TEST! ) */
2272 /* (note the ugly hardcoded 16M number) */
2273 cinfo->regbase = ioremap(board_addr, 16777216);
2274 if (!cinfo->regbase)
2275 goto err_release_region;
2276
2277 dev_dbg(info->device, "Virtual address for board set to: $%p\n",
2278 cinfo->regbase);
2279 cinfo->regbase += 0x600000;
2280 info->fix.mmio_start = board_addr + 0x600000;
2281
2282 info->fix.smem_start = board_addr + 16777216;
2283 info->screen_base = ioremap(info->fix.smem_start, 16777216);
2284 if (!info->screen_base)
2285 goto err_unmap_regbase;
2286 } else {
2287 dev_info(info->device, " REG at $%lx\n",
2288 (unsigned long) z2->resource.start);
2289
2290 info->fix.smem_start = board_addr;
2291 if (board_addr > 0x01000000)
2292 info->screen_base = ioremap(board_addr, board_size);
2293 else
2294 info->screen_base = (caddr_t) ZTWO_VADDR(board_addr);
2295 if (!info->screen_base)
2296 goto err_release_region;
2297 2300
2298 /* set address for REG area of board */ 2301 info->fix.mmio_start = regbase;
2299 cinfo->regbase = (caddr_t) ZTWO_VADDR(z2->resource.start); 2302 cinfo->regbase = regbase > 16 * MB_ ? ioremap(regbase, 64 * 1024)
2300 info->fix.mmio_start = z2->resource.start; 2303 : (caddr_t)ZTWO_VADDR(regbase);
2304 if (!cinfo->regbase) {
2305 dev_err(info->device, "Cannot map registers\n");
2306 error = -EIO;
2307 goto err_release_dev;
2308 }
2301 2309
2302 dev_dbg(info->device, "Virtual address for board set to: $%p\n", 2310 info->fix.smem_start = rambase;
2303 cinfo->regbase); 2311 info->screen_size = ramsize;
2312 info->screen_base = rambase > 16 * MB_ ? ioremap(rambase, ramsize)
2313 : (caddr_t)ZTWO_VADDR(rambase);
2314 if (!info->screen_base) {
2315 dev_err(info->device, "Cannot map video RAM\n");
2316 error = -EIO;
2317 goto err_unmap_reg;
2304 } 2318 }
2319
2305 cinfo->unmap = cirrusfb_zorro_unmap; 2320 cinfo->unmap = cirrusfb_zorro_unmap;
2306 2321
2307 dev_info(info->device, 2322 dev_info(info->device,
2308 "Cirrus Logic chipset on Zorro bus, RAM (%lu MB) at $%lx\n", 2323 "Cirrus Logic chipset on Zorro bus, RAM (%lu MiB) at 0x%lx\n",
2309 board_size / MB_, board_addr); 2324 ramsize / MB_, rambase);
2310
2311 zorro_set_drvdata(z, info);
2312 2325
2313 /* MCLK select etc. */ 2326 /* MCLK select etc. */
2314 if (cirrusfb_board_info[btype].init_sr1f) 2327 if (cirrusfb_board_info[btype].init_sr1f)
2315 vga_wseq(cinfo->regbase, CL_SEQR1F, 2328 vga_wseq(cinfo->regbase, CL_SEQR1F,
2316 cirrusfb_board_info[btype].sr1f); 2329 cirrusfb_board_info[btype].sr1f);
2317 2330
2318 ret = cirrusfb_register(info); 2331 error = cirrusfb_register(info);
2319 if (!ret) 2332 if (error) {
2320 return 0; 2333 dev_err(info->device, "Failed to register device, error %d\n",
2334 error);
2335 goto err_unmap_ram;
2336 }
2321 2337
2322 if (btype == BT_PICASSO4 || board_addr > 0x01000000) 2338 zorro_set_drvdata(z, info);
2339 return 0;
2340
2341err_unmap_ram:
2342 if (rambase > 16 * MB_)
2323 iounmap(info->screen_base); 2343 iounmap(info->screen_base);
2324 2344
2325err_unmap_regbase: 2345err_unmap_reg:
2326 if (btype == BT_PICASSO4) 2346 if (regbase > 16 * MB_)
2327 iounmap(cinfo->regbase - 0x600000); 2347 iounmap(cinfo->regbase);
2328err_release_region: 2348err_release_dev:
2329 release_region(board_addr, board_size); 2349 zorro_release_device(z);
2330err_release_fb: 2350err_release_fb:
2331 framebuffer_release(info); 2351 framebuffer_release(info);
2332err_out: 2352 return error;
2333 return ret;
2334} 2353}
2335 2354
2336void __devexit cirrusfb_zorro_unregister(struct zorro_dev *z) 2355void __devexit cirrusfb_zorro_unregister(struct zorro_dev *z)
@@ -2338,6 +2357,7 @@ void __devexit cirrusfb_zorro_unregister(struct zorro_dev *z)
2338 struct fb_info *info = zorro_get_drvdata(z); 2357 struct fb_info *info = zorro_get_drvdata(z);
2339 2358
2340 cirrusfb_cleanup(info); 2359 cirrusfb_cleanup(info);
2360 zorro_set_drvdata(z, NULL);
2341} 2361}
2342 2362
2343static struct zorro_driver cirrusfb_zorro_driver = { 2363static struct zorro_driver cirrusfb_zorro_driver = {
diff --git a/drivers/video/display/Kconfig b/drivers/video/display/Kconfig
deleted file mode 100644
index f99af931d4f8..000000000000
--- a/drivers/video/display/Kconfig
+++ /dev/null
@@ -1,24 +0,0 @@
1#
2# Display drivers configuration
3#
4
5menu "Display device support"
6
7config DISPLAY_SUPPORT
8 tristate "Display panel/monitor support"
9 ---help---
10 This framework adds support for low-level control of a display.
11 This includes support for power.
12
13 Enable this to be able to choose the drivers for controlling the
14 physical display panel/monitor on some platforms. This not only
15 covers LCD displays for PDAs but also other types of displays
16 such as CRT, TVout etc.
17
18 To have support for your specific display panel you will have to
19 select the proper drivers which depend on this option.
20
21comment "Display hardware drivers"
22 depends on DISPLAY_SUPPORT
23
24endmenu
diff --git a/drivers/video/display/Makefile b/drivers/video/display/Makefile
deleted file mode 100644
index c0ea832bf171..000000000000
--- a/drivers/video/display/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Display drivers
2
3display-objs := display-sysfs.o
4
5obj-$(CONFIG_DISPLAY_SUPPORT) += display.o
6
diff --git a/drivers/video/display/display-sysfs.c b/drivers/video/display/display-sysfs.c
deleted file mode 100644
index 0c647d7af0ee..000000000000
--- a/drivers/video/display/display-sysfs.c
+++ /dev/null
@@ -1,219 +0,0 @@
1/*
2 * display-sysfs.c - Display output driver sysfs interface
3 *
4 * Copyright (C) 2007 James Simmons <jsimmons@infradead.org>
5 *
6 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 */
24#include <linux/module.h>
25#include <linux/display.h>
26#include <linux/ctype.h>
27#include <linux/idr.h>
28#include <linux/err.h>
29#include <linux/kdev_t.h>
30#include <linux/slab.h>
31
32static ssize_t display_show_name(struct device *dev,
33 struct device_attribute *attr, char *buf)
34{
35 struct display_device *dsp = dev_get_drvdata(dev);
36 return snprintf(buf, PAGE_SIZE, "%s\n", dsp->name);
37}
38
39static ssize_t display_show_type(struct device *dev,
40 struct device_attribute *attr, char *buf)
41{
42 struct display_device *dsp = dev_get_drvdata(dev);
43 return snprintf(buf, PAGE_SIZE, "%s\n", dsp->type);
44}
45
46static ssize_t display_show_contrast(struct device *dev,
47 struct device_attribute *attr, char *buf)
48{
49 struct display_device *dsp = dev_get_drvdata(dev);
50 ssize_t rc = -ENXIO;
51
52 mutex_lock(&dsp->lock);
53 if (likely(dsp->driver) && dsp->driver->get_contrast)
54 rc = sprintf(buf, "%d\n", dsp->driver->get_contrast(dsp));
55 mutex_unlock(&dsp->lock);
56 return rc;
57}
58
59static ssize_t display_store_contrast(struct device *dev,
60 struct device_attribute *attr,
61 const char *buf, size_t count)
62{
63 struct display_device *dsp = dev_get_drvdata(dev);
64 ssize_t ret = -EINVAL, size;
65 int contrast;
66 char *endp;
67
68 contrast = simple_strtoul(buf, &endp, 0);
69 size = endp - buf;
70
71 if (isspace(*endp))
72 size++;
73
74 if (size != count)
75 return ret;
76
77 mutex_lock(&dsp->lock);
78 if (likely(dsp->driver && dsp->driver->set_contrast)) {
79 pr_debug("display: set contrast to %d\n", contrast);
80 dsp->driver->set_contrast(dsp, contrast);
81 ret = count;
82 }
83 mutex_unlock(&dsp->lock);
84 return ret;
85}
86
87static ssize_t display_show_max_contrast(struct device *dev,
88 struct device_attribute *attr,
89 char *buf)
90{
91 struct display_device *dsp = dev_get_drvdata(dev);
92 ssize_t rc = -ENXIO;
93
94 mutex_lock(&dsp->lock);
95 if (likely(dsp->driver))
96 rc = sprintf(buf, "%d\n", dsp->driver->max_contrast);
97 mutex_unlock(&dsp->lock);
98 return rc;
99}
100
101static struct device_attribute display_attrs[] = {
102 __ATTR(name, S_IRUGO, display_show_name, NULL),
103 __ATTR(type, S_IRUGO, display_show_type, NULL),
104 __ATTR(contrast, S_IRUGO | S_IWUSR, display_show_contrast, display_store_contrast),
105 __ATTR(max_contrast, S_IRUGO, display_show_max_contrast, NULL),
106};
107
108static int display_suspend(struct device *dev, pm_message_t state)
109{
110 struct display_device *dsp = dev_get_drvdata(dev);
111
112 mutex_lock(&dsp->lock);
113 if (likely(dsp->driver->suspend))
114 dsp->driver->suspend(dsp, state);
115 mutex_unlock(&dsp->lock);
116 return 0;
117};
118
119static int display_resume(struct device *dev)
120{
121 struct display_device *dsp = dev_get_drvdata(dev);
122
123 mutex_lock(&dsp->lock);
124 if (likely(dsp->driver->resume))
125 dsp->driver->resume(dsp);
126 mutex_unlock(&dsp->lock);
127 return 0;
128};
129
130static struct mutex allocated_dsp_lock;
131static DEFINE_IDR(allocated_dsp);
132static struct class *display_class;
133
134struct display_device *display_device_register(struct display_driver *driver,
135 struct device *parent, void *devdata)
136{
137 struct display_device *new_dev = NULL;
138 int ret = -EINVAL;
139
140 if (unlikely(!driver))
141 return ERR_PTR(ret);
142
143 mutex_lock(&allocated_dsp_lock);
144 ret = idr_pre_get(&allocated_dsp, GFP_KERNEL);
145 mutex_unlock(&allocated_dsp_lock);
146 if (!ret)
147 return ERR_PTR(ret);
148
149 new_dev = kzalloc(sizeof(struct display_device), GFP_KERNEL);
150 if (likely(new_dev) && unlikely(driver->probe(new_dev, devdata))) {
151 // Reserve the index for this display
152 mutex_lock(&allocated_dsp_lock);
153 ret = idr_get_new(&allocated_dsp, new_dev, &new_dev->idx);
154 mutex_unlock(&allocated_dsp_lock);
155
156 if (!ret) {
157 new_dev->dev = device_create(display_class, parent,
158 MKDEV(0, 0), new_dev,
159 "display%d", new_dev->idx);
160 if (!IS_ERR(new_dev->dev)) {
161 new_dev->parent = parent;
162 new_dev->driver = driver;
163 mutex_init(&new_dev->lock);
164 return new_dev;
165 }
166 mutex_lock(&allocated_dsp_lock);
167 idr_remove(&allocated_dsp, new_dev->idx);
168 mutex_unlock(&allocated_dsp_lock);
169 ret = -EINVAL;
170 }
171 }
172 kfree(new_dev);
173 return ERR_PTR(ret);
174}
175EXPORT_SYMBOL(display_device_register);
176
177void display_device_unregister(struct display_device *ddev)
178{
179 if (!ddev)
180 return;
181 // Free device
182 mutex_lock(&ddev->lock);
183 device_unregister(ddev->dev);
184 mutex_unlock(&ddev->lock);
185 // Mark device index as available
186 mutex_lock(&allocated_dsp_lock);
187 idr_remove(&allocated_dsp, ddev->idx);
188 mutex_unlock(&allocated_dsp_lock);
189 kfree(ddev);
190}
191EXPORT_SYMBOL(display_device_unregister);
192
193static int __init display_class_init(void)
194{
195 display_class = class_create(THIS_MODULE, "display");
196 if (IS_ERR(display_class)) {
197 printk(KERN_ERR "Failed to create display class\n");
198 display_class = NULL;
199 return -EINVAL;
200 }
201 display_class->dev_attrs = display_attrs;
202 display_class->suspend = display_suspend;
203 display_class->resume = display_resume;
204 mutex_init(&allocated_dsp_lock);
205 return 0;
206}
207
208static void __exit display_class_exit(void)
209{
210 class_destroy(display_class);
211}
212
213module_init(display_class_init);
214module_exit(display_class_exit);
215
216MODULE_DESCRIPTION("Display Hardware handling");
217MODULE_AUTHOR("James Simmons <jsimmons@infradead.org>");
218MODULE_LICENSE("GPL");
219
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 0753b1cfcb8b..12eaee0b29e6 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -621,7 +621,8 @@ static int s3c_fb_set_par(struct fb_info *info)
621 } else if (var->transp.length == 1) 621 } else if (var->transp.length == 1)
622 data |= WINCON1_BPPMODE_25BPP_A1888 622 data |= WINCON1_BPPMODE_25BPP_A1888
623 | WINCON1_BLD_PIX; 623 | WINCON1_BLD_PIX;
624 else if (var->transp.length == 4) 624 else if ((var->transp.length == 4) ||
625 (var->transp.length == 8))
625 data |= WINCON1_BPPMODE_28BPP_A4888 626 data |= WINCON1_BPPMODE_28BPP_A4888
626 | WINCON1_BLD_PIX | WINCON1_ALPHA_SEL; 627 | WINCON1_BLD_PIX | WINCON1_ALPHA_SEL;
627 else 628 else
diff --git a/include/linux/display.h b/include/linux/display.h
deleted file mode 100644
index 3bf70d639728..000000000000
--- a/include/linux/display.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Copyright (C) 2006 James Simmons <jsimmons@infradead.org>
3 *
4 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 *
20 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 */
22
23#ifndef _LINUX_DISPLAY_H
24#define _LINUX_DISPLAY_H
25
26#include <linux/device.h>
27
28struct display_device;
29
30/* This structure defines all the properties of a Display. */
31struct display_driver {
32 int (*set_contrast)(struct display_device *, unsigned int);
33 int (*get_contrast)(struct display_device *);
34 void (*suspend)(struct display_device *, pm_message_t state);
35 void (*resume)(struct display_device *);
36 int (*probe)(struct display_device *, void *);
37 int (*remove)(struct display_device *);
38 int max_contrast;
39};
40
41struct display_device {
42 struct module *owner; /* Owner module */
43 struct display_driver *driver;
44 struct device *parent; /* This is the parent */
45 struct device *dev; /* This is this display device */
46 struct mutex lock;
47 void *priv_data;
48 char type[16];
49 char *name;
50 int idx;
51};
52
53extern struct display_device *display_device_register(struct display_driver *driver,
54 struct device *dev, void *devdata);
55extern void display_device_unregister(struct display_device *dev);
56
57extern int probe_edid(struct display_device *dev, void *devdata);
58
59#define to_display_device(obj) container_of(obj, struct display_device, class_dev)
60
61#endif
diff --git a/include/linux/zorro_ids.h b/include/linux/zorro_ids.h
index 7e749088910d..74bc53bcfdcf 100644
--- a/include/linux/zorro_ids.h
+++ b/include/linux/zorro_ids.h
@@ -360,8 +360,8 @@
360#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0) 360#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0)
361#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0) 361#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0)
362#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0) 362#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0)
363#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0) 363#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0)
364#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0) 364#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0)
365#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0) 365#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0)
366#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0) 366#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0)
367#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0) 367#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0)