diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/amba-clcd.c | 54 | ||||
-rw-r--r-- | drivers/video/backlight/Kconfig | 8 | ||||
-rw-r--r-- | drivers/video/backlight/Makefile | 1 | ||||
-rw-r--r-- | drivers/video/backlight/backlight.c | 1 | ||||
-rw-r--r-- | drivers/video/backlight/hp680_bl.c | 189 | ||||
-rw-r--r-- | drivers/video/backlight/lcd.c | 1 | ||||
-rw-r--r-- | drivers/video/console/sticore.c | 45 | ||||
-rw-r--r-- | drivers/video/cyblafb.c | 1 | ||||
-rw-r--r-- | drivers/video/i810/i810-i2c.c | 6 | ||||
-rw-r--r-- | drivers/video/i810/i810.h | 1 | ||||
-rw-r--r-- | drivers/video/i810/i810_main.c | 13 | ||||
-rw-r--r-- | drivers/video/pmag-ba-fb.c | 1 | ||||
-rw-r--r-- | drivers/video/pmagb-b-fb.c | 1 |
13 files changed, 260 insertions, 62 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index b2187175d03f..6761b68c35e9 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c | |||
@@ -116,9 +116,10 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) | |||
116 | int ret = 0; | 116 | int ret = 0; |
117 | 117 | ||
118 | memset(&var->transp, 0, sizeof(var->transp)); | 118 | memset(&var->transp, 0, sizeof(var->transp)); |
119 | memset(&var->red, 0, sizeof(var->red)); | 119 | |
120 | memset(&var->green, 0, sizeof(var->green)); | 120 | var->red.msb_right = 0; |
121 | memset(&var->blue, 0, sizeof(var->blue)); | 121 | var->green.msb_right = 0; |
122 | var->blue.msb_right = 0; | ||
122 | 123 | ||
123 | switch (var->bits_per_pixel) { | 124 | switch (var->bits_per_pixel) { |
124 | case 1: | 125 | case 1: |
@@ -133,34 +134,20 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) | |||
133 | var->blue.offset = 0; | 134 | var->blue.offset = 0; |
134 | break; | 135 | break; |
135 | case 16: | 136 | case 16: |
136 | var->red.length = 5; | 137 | var->red.length = 5; |
137 | var->green.length = 6; | 138 | var->blue.length = 5; |
138 | var->blue.length = 5; | 139 | /* |
139 | if (fb->panel->cntl & CNTL_BGR) { | 140 | * Green length can be 5 or 6 depending whether |
140 | var->red.offset = 11; | 141 | * we're operating in RGB555 or RGB565 mode. |
141 | var->green.offset = 5; | 142 | */ |
142 | var->blue.offset = 0; | 143 | if (var->green.length != 5 && var->green.length != 6) |
143 | } else { | 144 | var->green.length = 6; |
144 | var->red.offset = 0; | ||
145 | var->green.offset = 5; | ||
146 | var->blue.offset = 11; | ||
147 | } | ||
148 | break; | 145 | break; |
149 | case 32: | 146 | case 32: |
150 | if (fb->panel->cntl & CNTL_LCDTFT) { | 147 | if (fb->panel->cntl & CNTL_LCDTFT) { |
151 | var->red.length = 8; | 148 | var->red.length = 8; |
152 | var->green.length = 8; | 149 | var->green.length = 8; |
153 | var->blue.length = 8; | 150 | var->blue.length = 8; |
154 | |||
155 | if (fb->panel->cntl & CNTL_BGR) { | ||
156 | var->red.offset = 16; | ||
157 | var->green.offset = 8; | ||
158 | var->blue.offset = 0; | ||
159 | } else { | ||
160 | var->red.offset = 0; | ||
161 | var->green.offset = 8; | ||
162 | var->blue.offset = 16; | ||
163 | } | ||
164 | break; | 151 | break; |
165 | } | 152 | } |
166 | default: | 153 | default: |
@@ -168,6 +155,23 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) | |||
168 | break; | 155 | break; |
169 | } | 156 | } |
170 | 157 | ||
158 | /* | ||
159 | * >= 16bpp displays have separate colour component bitfields | ||
160 | * encoded in the pixel data. Calculate their position from | ||
161 | * the bitfield length defined above. | ||
162 | */ | ||
163 | if (ret == 0 && var->bits_per_pixel >= 16) { | ||
164 | if (fb->panel->cntl & CNTL_BGR) { | ||
165 | var->blue.offset = 0; | ||
166 | var->green.offset = var->blue.offset + var->blue.length; | ||
167 | var->red.offset = var->green.offset + var->green.length; | ||
168 | } else { | ||
169 | var->red.offset = 0; | ||
170 | var->green.offset = var->red.offset + var->red.length; | ||
171 | var->blue.offset = var->green.offset + var->green.length; | ||
172 | } | ||
173 | } | ||
174 | |||
171 | return ret; | 175 | return ret; |
172 | } | 176 | } |
173 | 177 | ||
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 996d543d6609..9d996f2c10d5 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig | |||
@@ -50,3 +50,11 @@ config BACKLIGHT_CORGI | |||
50 | If you have a Sharp Zaurus SL-C7xx, say y to enable the | 50 | If you have a Sharp Zaurus SL-C7xx, say y to enable the |
51 | backlight driver. | 51 | backlight driver. |
52 | 52 | ||
53 | config BACKLIGHT_HP680 | ||
54 | tristate "HP Jornada 680 Backlight Driver" | ||
55 | depends on BACKLIGHT_DEVICE && SH_HP6XX | ||
56 | default y | ||
57 | help | ||
58 | If you have a HP Jornada 680, say y to enable the | ||
59 | backlight driver. | ||
60 | |||
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 4af321fae390..744210c38e74 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile | |||
@@ -3,4 +3,5 @@ | |||
3 | obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o | 3 | obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o |
4 | obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o | 4 | obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o |
5 | obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o | 5 | obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o |
6 | obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o | ||
6 | obj-$(CONFIG_SHARP_LOCOMO) += locomolcd.o | 7 | obj-$(CONFIG_SHARP_LOCOMO) += locomolcd.o |
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 9d5015e99372..bd39bbd88d41 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/ctype.h> | 13 | #include <linux/ctype.h> |
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/fb.h> | 15 | #include <linux/fb.h> |
16 | #include <asm/bug.h> | ||
17 | 16 | ||
18 | static ssize_t backlight_show_power(struct class_device *cdev, char *buf) | 17 | static ssize_t backlight_show_power(struct class_device *cdev, char *buf) |
19 | { | 18 | { |
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c new file mode 100644 index 000000000000..95da4c9ed1f1 --- /dev/null +++ b/drivers/video/backlight/hp680_bl.c | |||
@@ -0,0 +1,189 @@ | |||
1 | /* | ||
2 | * Backlight Driver for HP Jornada 680 | ||
3 | * | ||
4 | * Copyright (c) 2005 Andriy Skulysh | ||
5 | * | ||
6 | * Based on Sharp's Corgi Backlight Driver | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | |||
13 | #include <linux/module.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/fb.h> | ||
19 | #include <linux/backlight.h> | ||
20 | |||
21 | #include <asm/cpu/dac.h> | ||
22 | #include <asm/hp6xx/hp6xx.h> | ||
23 | #include <asm/hd64461/hd64461.h> | ||
24 | |||
25 | #define HP680_MAX_INTENSITY 255 | ||
26 | #define HP680_DEFAULT_INTENSITY 10 | ||
27 | |||
28 | static int hp680bl_powermode = FB_BLANK_UNBLANK; | ||
29 | static int current_intensity = 0; | ||
30 | static spinlock_t bl_lock = SPIN_LOCK_UNLOCKED; | ||
31 | |||
32 | static void hp680bl_send_intensity(int intensity) | ||
33 | { | ||
34 | unsigned long flags; | ||
35 | |||
36 | if (hp680bl_powermode != FB_BLANK_UNBLANK) | ||
37 | intensity = 0; | ||
38 | |||
39 | spin_lock_irqsave(&bl_lock, flags); | ||
40 | sh_dac_output(255-(u8)intensity, DAC_LCD_BRIGHTNESS); | ||
41 | spin_unlock_irqrestore(&bl_lock, flags); | ||
42 | } | ||
43 | |||
44 | static void hp680bl_blank(int blank) | ||
45 | { | ||
46 | u16 v; | ||
47 | |||
48 | switch(blank) { | ||
49 | |||
50 | case FB_BLANK_NORMAL: | ||
51 | case FB_BLANK_VSYNC_SUSPEND: | ||
52 | case FB_BLANK_HSYNC_SUSPEND: | ||
53 | case FB_BLANK_POWERDOWN: | ||
54 | if (hp680bl_powermode == FB_BLANK_UNBLANK) { | ||
55 | hp680bl_send_intensity(0); | ||
56 | hp680bl_powermode = blank; | ||
57 | sh_dac_disable(DAC_LCD_BRIGHTNESS); | ||
58 | v = inw(HD64461_GPBDR); | ||
59 | v |= HD64461_GPBDR_LCDOFF; | ||
60 | outw(v, HD64461_GPBDR); | ||
61 | } | ||
62 | break; | ||
63 | case FB_BLANK_UNBLANK: | ||
64 | if (hp680bl_powermode != FB_BLANK_UNBLANK) { | ||
65 | sh_dac_enable(DAC_LCD_BRIGHTNESS); | ||
66 | v = inw(HD64461_GPBDR); | ||
67 | v &= ~HD64461_GPBDR_LCDOFF; | ||
68 | outw(v, HD64461_GPBDR); | ||
69 | hp680bl_powermode = blank; | ||
70 | hp680bl_send_intensity(current_intensity); | ||
71 | } | ||
72 | break; | ||
73 | } | ||
74 | } | ||
75 | |||
76 | #ifdef CONFIG_PM | ||
77 | static int hp680bl_suspend(struct device *dev, pm_message_t state, u32 level) | ||
78 | { | ||
79 | if (level == SUSPEND_POWER_DOWN) | ||
80 | hp680bl_blank(FB_BLANK_POWERDOWN); | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static int hp680bl_resume(struct device *dev, u32 level) | ||
85 | { | ||
86 | if (level == RESUME_POWER_ON) | ||
87 | hp680bl_blank(FB_BLANK_UNBLANK); | ||
88 | return 0; | ||
89 | } | ||
90 | #else | ||
91 | #define hp680bl_suspend NULL | ||
92 | #define hp680bl_resume NULL | ||
93 | #endif | ||
94 | |||
95 | |||
96 | static int hp680bl_set_power(struct backlight_device *bd, int state) | ||
97 | { | ||
98 | hp680bl_blank(state); | ||
99 | return 0; | ||
100 | } | ||
101 | |||
102 | static int hp680bl_get_power(struct backlight_device *bd) | ||
103 | { | ||
104 | return hp680bl_powermode; | ||
105 | } | ||
106 | |||
107 | static int hp680bl_set_intensity(struct backlight_device *bd, int intensity) | ||
108 | { | ||
109 | if (intensity > HP680_MAX_INTENSITY) | ||
110 | intensity = HP680_MAX_INTENSITY; | ||
111 | hp680bl_send_intensity(intensity); | ||
112 | current_intensity = intensity; | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | static int hp680bl_get_intensity(struct backlight_device *bd) | ||
117 | { | ||
118 | return current_intensity; | ||
119 | } | ||
120 | |||
121 | static struct backlight_properties hp680bl_data = { | ||
122 | .owner = THIS_MODULE, | ||
123 | .get_power = hp680bl_get_power, | ||
124 | .set_power = hp680bl_set_power, | ||
125 | .max_brightness = HP680_MAX_INTENSITY, | ||
126 | .get_brightness = hp680bl_get_intensity, | ||
127 | .set_brightness = hp680bl_set_intensity, | ||
128 | }; | ||
129 | |||
130 | static struct backlight_device *hp680_backlight_device; | ||
131 | |||
132 | static int __init hp680bl_probe(struct device *dev) | ||
133 | { | ||
134 | hp680_backlight_device = backlight_device_register ("hp680-bl", | ||
135 | NULL, &hp680bl_data); | ||
136 | if (IS_ERR (hp680_backlight_device)) | ||
137 | return PTR_ERR (hp680_backlight_device); | ||
138 | |||
139 | hp680bl_set_intensity(NULL, HP680_DEFAULT_INTENSITY); | ||
140 | |||
141 | return 0; | ||
142 | } | ||
143 | |||
144 | static int hp680bl_remove(struct device *dev) | ||
145 | { | ||
146 | backlight_device_unregister(hp680_backlight_device); | ||
147 | |||
148 | return 0; | ||
149 | } | ||
150 | |||
151 | static struct device_driver hp680bl_driver = { | ||
152 | .name = "hp680-bl", | ||
153 | .bus = &platform_bus_type, | ||
154 | .probe = hp680bl_probe, | ||
155 | .remove = hp680bl_remove, | ||
156 | .suspend = hp680bl_suspend, | ||
157 | .resume = hp680bl_resume, | ||
158 | }; | ||
159 | |||
160 | static struct platform_device hp680bl_device = { | ||
161 | .name = "hp680-bl", | ||
162 | .id = -1, | ||
163 | }; | ||
164 | |||
165 | static int __init hp680bl_init(void) | ||
166 | { | ||
167 | int ret; | ||
168 | |||
169 | ret=driver_register(&hp680bl_driver); | ||
170 | if (!ret) { | ||
171 | ret = platform_device_register(&hp680bl_device); | ||
172 | if (ret) | ||
173 | driver_unregister(&hp680bl_driver); | ||
174 | } | ||
175 | return ret; | ||
176 | } | ||
177 | |||
178 | static void __exit hp680bl_exit(void) | ||
179 | { | ||
180 | platform_device_unregister(&hp680bl_device); | ||
181 | driver_unregister(&hp680bl_driver); | ||
182 | } | ||
183 | |||
184 | module_init(hp680bl_init); | ||
185 | module_exit(hp680bl_exit); | ||
186 | |||
187 | MODULE_AUTHOR("Andriy Skulysh <askulysh@image.kiev.ua>"); | ||
188 | MODULE_DESCRIPTION("HP Jornada 680 Backlight Driver"); | ||
189 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 68c690605aa7..9e32485ee7bb 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/ctype.h> | 13 | #include <linux/ctype.h> |
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/fb.h> | 15 | #include <linux/fb.h> |
16 | #include <asm/bug.h> | ||
17 | 16 | ||
18 | static ssize_t lcd_show_power(struct class_device *cdev, char *buf) | 17 | static ssize_t lcd_show_power(struct class_device *cdev, char *buf) |
19 | { | 18 | { |
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c index a7bcd17112c0..0339f5640a78 100644 --- a/drivers/video/console/sticore.c +++ b/drivers/video/console/sticore.c | |||
@@ -30,10 +30,11 @@ | |||
30 | 30 | ||
31 | #define STI_DRIVERVERSION "Version 0.9a" | 31 | #define STI_DRIVERVERSION "Version 0.9a" |
32 | 32 | ||
33 | struct sti_struct *default_sti; | 33 | struct sti_struct *default_sti __read_mostly; |
34 | 34 | ||
35 | static int num_sti_roms; /* # of STI ROMS found */ | 35 | /* number of STI ROMS found and their ptrs to each struct */ |
36 | static struct sti_struct *sti_roms[MAX_STI_ROMS]; /* ptr to each sti_struct */ | 36 | static int num_sti_roms __read_mostly; |
37 | static struct sti_struct *sti_roms[MAX_STI_ROMS] __read_mostly; | ||
37 | 38 | ||
38 | 39 | ||
39 | /* The colour indices used by STI are | 40 | /* The colour indices used by STI are |
@@ -266,7 +267,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest) | |||
266 | 267 | ||
267 | 268 | ||
268 | 269 | ||
269 | static char default_sti_path[21]; | 270 | static char default_sti_path[21] __read_mostly; |
270 | 271 | ||
271 | #ifndef MODULE | 272 | #ifndef MODULE |
272 | static int __init sti_setup(char *str) | 273 | static int __init sti_setup(char *str) |
@@ -414,10 +415,10 @@ sti_init_glob_cfg(struct sti_struct *sti, | |||
414 | if (!sti->sti_mem_request) | 415 | if (!sti->sti_mem_request) |
415 | sti->sti_mem_request = 256; /* STI default */ | 416 | sti->sti_mem_request = 256; /* STI default */ |
416 | 417 | ||
417 | glob_cfg = kmalloc(sizeof(*sti->glob_cfg), GFP_KERNEL); | 418 | glob_cfg = kzalloc(sizeof(*sti->glob_cfg), GFP_KERNEL); |
418 | glob_cfg_ext = kmalloc(sizeof(*glob_cfg_ext), GFP_KERNEL); | 419 | glob_cfg_ext = kzalloc(sizeof(*glob_cfg_ext), GFP_KERNEL); |
419 | save_addr = kmalloc(save_addr_size, GFP_KERNEL); | 420 | save_addr = kzalloc(save_addr_size, GFP_KERNEL); |
420 | sti_mem_addr = kmalloc(sti->sti_mem_request, GFP_KERNEL); | 421 | sti_mem_addr = kzalloc(sti->sti_mem_request, GFP_KERNEL); |
421 | 422 | ||
422 | if (!(glob_cfg && glob_cfg_ext && save_addr && sti_mem_addr)) { | 423 | if (!(glob_cfg && glob_cfg_ext && save_addr && sti_mem_addr)) { |
423 | kfree(glob_cfg); | 424 | kfree(glob_cfg); |
@@ -427,11 +428,6 @@ sti_init_glob_cfg(struct sti_struct *sti, | |||
427 | return -ENOMEM; | 428 | return -ENOMEM; |
428 | } | 429 | } |
429 | 430 | ||
430 | memset(glob_cfg, 0, sizeof(*glob_cfg)); | ||
431 | memset(glob_cfg_ext, 0, sizeof(*glob_cfg_ext)); | ||
432 | memset(save_addr, 0, save_addr_size); | ||
433 | memset(sti_mem_addr, 0, sti->sti_mem_request); | ||
434 | |||
435 | glob_cfg->ext_ptr = STI_PTR(glob_cfg_ext); | 431 | glob_cfg->ext_ptr = STI_PTR(glob_cfg_ext); |
436 | glob_cfg->save_addr = STI_PTR(save_addr); | 432 | glob_cfg->save_addr = STI_PTR(save_addr); |
437 | for (i=0; i<8; i++) { | 433 | for (i=0; i<8; i++) { |
@@ -502,9 +498,9 @@ sti_init_glob_cfg(struct sti_struct *sti, | |||
502 | 498 | ||
503 | #ifdef CONFIG_FB | 499 | #ifdef CONFIG_FB |
504 | struct sti_cooked_font * __init | 500 | struct sti_cooked_font * __init |
505 | sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | 501 | sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) |
506 | { | 502 | { |
507 | struct font_desc *fbfont; | 503 | const struct font_desc *fbfont; |
508 | unsigned int size, bpc; | 504 | unsigned int size, bpc; |
509 | void *dest; | 505 | void *dest; |
510 | struct sti_rom_font *nf; | 506 | struct sti_rom_font *nf; |
@@ -525,10 +521,9 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | |||
525 | size = bpc * 256; | 521 | size = bpc * 256; |
526 | size += sizeof(struct sti_rom_font); | 522 | size += sizeof(struct sti_rom_font); |
527 | 523 | ||
528 | nf = kmalloc(size, GFP_KERNEL); | 524 | nf = kzalloc(size, GFP_KERNEL); |
529 | if (!nf) | 525 | if (!nf) |
530 | return NULL; | 526 | return NULL; |
531 | memset(nf, 0, size); | ||
532 | 527 | ||
533 | nf->first_char = 0; | 528 | nf->first_char = 0; |
534 | nf->last_char = 255; | 529 | nf->last_char = 255; |
@@ -544,7 +539,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | |||
544 | dest += sizeof(struct sti_rom_font); | 539 | dest += sizeof(struct sti_rom_font); |
545 | memcpy(dest, fbfont->data, bpc*256); | 540 | memcpy(dest, fbfont->data, bpc*256); |
546 | 541 | ||
547 | cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); | 542 | cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); |
548 | if (!cooked_font) { | 543 | if (!cooked_font) { |
549 | kfree(nf); | 544 | kfree(nf); |
550 | return NULL; | 545 | return NULL; |
@@ -559,7 +554,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | |||
559 | } | 554 | } |
560 | #else | 555 | #else |
561 | struct sti_cooked_font * __init | 556 | struct sti_cooked_font * __init |
562 | sti_select_fbfont(struct sti_cooked_rom *cooked_rom, char *fbfont_name) | 557 | sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) |
563 | { | 558 | { |
564 | return NULL; | 559 | return NULL; |
565 | } | 560 | } |
@@ -617,7 +612,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom, | |||
617 | struct sti_rom_font *raw_font, *font_start; | 612 | struct sti_rom_font *raw_font, *font_start; |
618 | struct sti_cooked_font *cooked_font; | 613 | struct sti_cooked_font *cooked_font; |
619 | 614 | ||
620 | cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); | 615 | cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); |
621 | if (!cooked_font) | 616 | if (!cooked_font) |
622 | return 0; | 617 | return 0; |
623 | 618 | ||
@@ -631,7 +626,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom, | |||
631 | while (raw_font->next_font) { | 626 | while (raw_font->next_font) { |
632 | raw_font = ((void *)font_start) + (raw_font->next_font); | 627 | raw_font = ((void *)font_start) + (raw_font->next_font); |
633 | 628 | ||
634 | cooked_font->next_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); | 629 | cooked_font->next_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); |
635 | if (!cooked_font->next_font) | 630 | if (!cooked_font->next_font) |
636 | return 1; | 631 | return 1; |
637 | 632 | ||
@@ -668,10 +663,9 @@ sti_bmode_font_raw(struct sti_cooked_font *f) | |||
668 | unsigned char *n, *p, *q; | 663 | unsigned char *n, *p, *q; |
669 | int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font); | 664 | int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font); |
670 | 665 | ||
671 | n = kmalloc (4*size, GFP_KERNEL); | 666 | n = kzalloc (4*size, GFP_KERNEL); |
672 | if (!n) | 667 | if (!n) |
673 | return NULL; | 668 | return NULL; |
674 | memset (n, 0, 4*size); | ||
675 | p = n + 3; | 669 | p = n + 3; |
676 | q = (unsigned char *)f->raw; | 670 | q = (unsigned char *)f->raw; |
677 | while (size--) { | 671 | while (size--) { |
@@ -816,13 +810,12 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd | |||
816 | return NULL; | 810 | return NULL; |
817 | } | 811 | } |
818 | 812 | ||
819 | sti = kmalloc(sizeof(*sti), GFP_KERNEL); | 813 | sti = kzalloc(sizeof(*sti), GFP_KERNEL); |
820 | if (!sti) { | 814 | if (!sti) { |
821 | printk(KERN_ERR "Not enough memory !\n"); | 815 | printk(KERN_ERR "Not enough memory !\n"); |
822 | return NULL; | 816 | return NULL; |
823 | } | 817 | } |
824 | 818 | ||
825 | memset(sti, 0, sizeof(*sti)); | ||
826 | spin_lock_init(&sti->lock); | 819 | spin_lock_init(&sti->lock); |
827 | 820 | ||
828 | test_rom: | 821 | test_rom: |
@@ -1035,7 +1028,7 @@ static struct parisc_driver pa_sti_driver = { | |||
1035 | * sti_init_roms() - detects all STI ROMs and stores them in sti_roms[] | 1028 | * sti_init_roms() - detects all STI ROMs and stores them in sti_roms[] |
1036 | */ | 1029 | */ |
1037 | 1030 | ||
1038 | static int sticore_initialized; | 1031 | static int sticore_initialized __read_mostly; |
1039 | 1032 | ||
1040 | static void __init sti_init_roms(void) | 1033 | static void __init sti_init_roms(void) |
1041 | { | 1034 | { |
diff --git a/drivers/video/cyblafb.c b/drivers/video/cyblafb.c index 2b972461a030..0ae0a97b0fed 100644 --- a/drivers/video/cyblafb.c +++ b/drivers/video/cyblafb.c | |||
@@ -1665,7 +1665,6 @@ static int __devinit cyblafb_init(void) | |||
1665 | } | 1665 | } |
1666 | #endif | 1666 | #endif |
1667 | output("CyblaFB version %s initializing\n", VERSION); | 1667 | output("CyblaFB version %s initializing\n", VERSION); |
1668 | return pci_module_init(&cyblafb_pci_driver); | ||
1669 | return pci_register_driver(&cyblafb_pci_driver); | 1668 | return pci_register_driver(&cyblafb_pci_driver); |
1670 | } | 1669 | } |
1671 | 1670 | ||
diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c index bd410e06db73..e3c8b5f1ca76 100644 --- a/drivers/video/i810/i810-i2c.c +++ b/drivers/video/i810/i810-i2c.c | |||
@@ -191,11 +191,11 @@ int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid, int conn) | |||
191 | u8 *edid = NULL; | 191 | u8 *edid = NULL; |
192 | int i; | 192 | int i; |
193 | 193 | ||
194 | DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn); | 194 | DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn+1); |
195 | if (conn < 4) { | 195 | if (conn < par->ddc_num) { |
196 | for (i = 0; i < 3; i++) { | 196 | for (i = 0; i < 3; i++) { |
197 | /* Do the real work */ | 197 | /* Do the real work */ |
198 | edid = i810_do_probe_i2c_edid(&par->chan[conn-1]); | 198 | edid = i810_do_probe_i2c_edid(&par->chan[conn]); |
199 | if (edid) | 199 | if (edid) |
200 | break; | 200 | break; |
201 | } | 201 | } |
diff --git a/drivers/video/i810/i810.h b/drivers/video/i810/i810.h index 6c187d5fe951..579195c2bea3 100644 --- a/drivers/video/i810/i810.h +++ b/drivers/video/i810/i810.h | |||
@@ -280,6 +280,7 @@ struct i810fb_par { | |||
280 | u32 blit_bpp; | 280 | u32 blit_bpp; |
281 | u32 ovract; | 281 | u32 ovract; |
282 | u32 cur_state; | 282 | u32 cur_state; |
283 | u32 ddc_num; | ||
283 | int mtrr_reg; | 284 | int mtrr_reg; |
284 | u16 bltcntl; | 285 | u16 bltcntl; |
285 | u8 interlace; | 286 | u8 interlace; |
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 266d0ab92663..d8467c03b49f 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
@@ -149,6 +149,7 @@ static int vyres __devinitdata; | |||
149 | static int sync __devinitdata; | 149 | static int sync __devinitdata; |
150 | static int extvga __devinitdata; | 150 | static int extvga __devinitdata; |
151 | static int dcolor __devinitdata; | 151 | static int dcolor __devinitdata; |
152 | static int ddc3 __devinitdata = 2; | ||
152 | 153 | ||
153 | /*------------------------------------------------------------*/ | 154 | /*------------------------------------------------------------*/ |
154 | 155 | ||
@@ -1763,6 +1764,8 @@ static void __devinit i810_init_defaults(struct i810fb_par *par, | |||
1763 | if (sync) | 1764 | if (sync) |
1764 | par->dev_flags |= ALWAYS_SYNC; | 1765 | par->dev_flags |= ALWAYS_SYNC; |
1765 | 1766 | ||
1767 | par->ddc_num = ddc3; | ||
1768 | |||
1766 | if (bpp < 8) | 1769 | if (bpp < 8) |
1767 | bpp = 8; | 1770 | bpp = 8; |
1768 | 1771 | ||
@@ -1885,7 +1888,7 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info) | |||
1885 | int found = 0; | 1888 | int found = 0; |
1886 | #ifdef CONFIG_FB_I810_I2C | 1889 | #ifdef CONFIG_FB_I810_I2C |
1887 | int i; | 1890 | int i; |
1888 | int err; | 1891 | int err = 1; |
1889 | struct i810fb_par *par = info->par; | 1892 | struct i810fb_par *par = info->par; |
1890 | #endif | 1893 | #endif |
1891 | 1894 | ||
@@ -1895,8 +1898,8 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info) | |||
1895 | #ifdef CONFIG_FB_I810_I2C | 1898 | #ifdef CONFIG_FB_I810_I2C |
1896 | i810_create_i2c_busses(par); | 1899 | i810_create_i2c_busses(par); |
1897 | 1900 | ||
1898 | for (i = 0; i < 4; i++) { | 1901 | for (i = 0; i < par->ddc_num + 1; i++) { |
1899 | err = i810_probe_i2c_connector(info, &par->edid, i+1); | 1902 | err = i810_probe_i2c_connector(info, &par->edid, i); |
1900 | if (!err) | 1903 | if (!err) |
1901 | break; | 1904 | break; |
1902 | } | 1905 | } |
@@ -1983,6 +1986,8 @@ static int __devinit i810fb_setup(char *options) | |||
1983 | vsync2 = simple_strtoul(this_opt+7, NULL, 0); | 1986 | vsync2 = simple_strtoul(this_opt+7, NULL, 0); |
1984 | else if (!strncmp(this_opt, "dcolor", 6)) | 1987 | else if (!strncmp(this_opt, "dcolor", 6)) |
1985 | dcolor = 1; | 1988 | dcolor = 1; |
1989 | else if (!strncmp(this_opt, "ddc3", 4)) | ||
1990 | ddc3 = 3; | ||
1986 | else | 1991 | else |
1987 | mode_option = this_opt; | 1992 | mode_option = this_opt; |
1988 | } | 1993 | } |
@@ -2190,6 +2195,8 @@ MODULE_PARM_DESC(sync, "wait for accel engine to finish drawing" | |||
2190 | module_param(dcolor, bool, 0); | 2195 | module_param(dcolor, bool, 0); |
2191 | MODULE_PARM_DESC(dcolor, "use DirectColor visuals" | 2196 | MODULE_PARM_DESC(dcolor, "use DirectColor visuals" |
2192 | " (default = 0 = TrueColor)"); | 2197 | " (default = 0 = TrueColor)"); |
2198 | module_param(ddc3, bool, 0); | ||
2199 | MODULE_PARM_DESC(ddc3, "Probe DDC bus 3 (default = 0 = no)"); | ||
2193 | module_param(mode_option, charp, 0); | 2200 | module_param(mode_option, charp, 0); |
2194 | MODULE_PARM_DESC(mode_option, "Specify initial video mode"); | 2201 | MODULE_PARM_DESC(mode_option, "Specify initial video mode"); |
2195 | 2202 | ||
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c index f3927b6cda9d..f5361cd8ccce 100644 --- a/drivers/video/pmag-ba-fb.c +++ b/drivers/video/pmag-ba-fb.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | 32 | ||
33 | #include <asm/bug.h> | ||
34 | #include <asm/io.h> | 33 | #include <asm/io.h> |
35 | #include <asm/system.h> | 34 | #include <asm/system.h> |
36 | 35 | ||
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c index 25148de5fe67..eeeac924b500 100644 --- a/drivers/video/pmagb-b-fb.c +++ b/drivers/video/pmagb-b-fb.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | 29 | ||
30 | #include <asm/bug.h> | ||
31 | #include <asm/io.h> | 30 | #include <asm/io.h> |
32 | #include <asm/system.h> | 31 | #include <asm/system.h> |
33 | 32 | ||