Skip to content

Commit 71a8638

Browse files
committed
Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6
* 'viafb-next' of git://github.com/schandinat/linux-2.6: (24 commits) viafb: Automatic OLPC XO-1.5 configuration viafb: remove unused CEA mode viafb: try to map less memory in case of failure viafb: use write combining for video ram viafb: add X server compatibility mode viafb: reduce OLPC refresh a bit viafb: fix OLPC XO 1.5 device connection viafb: fix OLPC DCON refresh rate viafb: delete clock and PLL initialization viafb: replace custom return values viafb: some small cleanup for global variables viafb: gather common good, old VGA initialization in one place viafb: add engine clock support viafb: add VIA slapping capability viafb: split clock and PLL code to an extra file viafb: add primary/secondary clock on/off switches viafb: add clock source selection and PLL power management support viafb: prepare for PLL separation viafb: call viafb_get_clk_value only in viafb_set_vclock viafb: remove unused max_hres/vres ...
2 parents 1723800 + 8aa4d96 commit 71a8638

19 files changed

+723
-706
lines changed

drivers/video/Kconfig

+11
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,17 @@ config FB_VIA_DIRECT_PROCFS
15621562
correct output device configuration.
15631563
Its use is strongly discouraged.
15641564

1565+
config FB_VIA_X_COMPATIBILITY
1566+
bool "X server compatibility"
1567+
depends on FB_VIA
1568+
default n
1569+
help
1570+
This option reduces the functionality (power saving, ...) of the
1571+
framebuffer to avoid negative impact on the OpenChrome X server.
1572+
If you use any X server other than fbdev you should enable this
1573+
otherwise it should be safe to disable it and allow using all
1574+
features.
1575+
15651576
endif
15661577

15671578
config FB_NEOMAGIC

drivers/video/via/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ obj-$(CONFIG_FB_VIA) += viafb.o
66

77
viafb-y :=viafbdev.o hw.o via_i2c.o dvi.o lcd.o ioctl.o accel.o \
88
via_utility.o vt1636.o global.o tblDPASetting.o viamode.o \
9-
via-core.o via-gpio.o via_modesetting.o
9+
via-core.o via-gpio.o via_modesetting.o via_clock.o

drivers/video/via/chip.h

-6
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,11 @@ struct chip_information {
137137
struct lvds_chip_information lvds_chip_info2;
138138
};
139139

140-
struct crt_setting_information {
141-
int iga_path;
142-
};
143-
144140
struct tmds_setting_information {
145141
int iga_path;
146142
int h_active;
147143
int v_active;
148144
int max_pixel_clock;
149-
int max_hres;
150-
int max_vres;
151145
};
152146

153147
struct lvds_setting_information {

drivers/video/via/dvi.c

+12-148
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,11 @@ static int tmds_register_read_bytes(int index, u8 *buff, int buff_len);
2828
static void __devinit dvi_get_panel_size_from_DDCv1(
2929
struct tmds_chip_information *tmds_chip,
3030
struct tmds_setting_information *tmds_setting);
31-
static void __devinit dvi_get_panel_size_from_DDCv2(
32-
struct tmds_chip_information *tmds_chip,
33-
struct tmds_setting_information *tmds_setting);
3431
static int viafb_dvi_query_EDID(void);
3532

36-
static int check_tmds_chip(int device_id_subaddr, int device_id)
33+
static inline bool check_tmds_chip(int device_id_subaddr, int device_id)
3734
{
38-
if (tmds_register_read(device_id_subaddr) == device_id)
39-
return OK;
40-
else
41-
return FAIL;
35+
return tmds_register_read(device_id_subaddr) == device_id;
4236
}
4337

4438
void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
@@ -47,22 +41,13 @@ void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
4741
DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n");
4842

4943
viafb_dvi_sense();
50-
switch (viafb_dvi_query_EDID()) {
51-
case 1:
44+
if (viafb_dvi_query_EDID() == 1)
5245
dvi_get_panel_size_from_DDCv1(tmds_chip, tmds_setting);
53-
break;
54-
case 2:
55-
dvi_get_panel_size_from_DDCv2(tmds_chip, tmds_setting);
56-
break;
57-
default:
58-
printk(KERN_WARNING "viafb_init_dvi_size: DVI panel size undetected!\n");
59-
break;
60-
}
6146

6247
return;
6348
}
6449

65-
int __devinit viafb_tmds_trasmitter_identify(void)
50+
bool __devinit viafb_tmds_trasmitter_identify(void)
6651
{
6752
unsigned char sr2a = 0, sr1e = 0, sr3e = 0;
6853

@@ -101,7 +86,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
10186
viaparinfo->chip_info->
10287
tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR;
10388
viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_31;
104-
if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) != FAIL) {
89+
if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)) {
10590
/*
10691
* Currently only support 12bits,dual edge,add 24bits mode later
10792
*/
@@ -112,11 +97,10 @@ int __devinit viafb_tmds_trasmitter_identify(void)
11297
viaparinfo->chip_info->tmds_chip_info.tmds_chip_name);
11398
DEBUG_MSG(KERN_INFO "\n %2d",
11499
viaparinfo->chip_info->tmds_chip_info.i2c_port);
115-
return OK;
100+
return true;
116101
} else {
117102
viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_2C;
118-
if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)
119-
!= FAIL) {
103+
if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)) {
120104
tmds_register_write(0x08, 0x3b);
121105
DEBUG_MSG(KERN_INFO "\n VT1632 TMDS ! \n");
122106
DEBUG_MSG(KERN_INFO "\n %2d",
@@ -125,7 +109,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
125109
DEBUG_MSG(KERN_INFO "\n %2d",
126110
viaparinfo->chip_info->
127111
tmds_chip_info.i2c_port);
128-
return OK;
112+
return true;
129113
}
130114
}
131115

@@ -135,7 +119,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
135119
((viafb_display_hardware_layout == HW_LAYOUT_DVI_ONLY) ||
136120
(viafb_display_hardware_layout == HW_LAYOUT_LCD_DVI))) {
137121
DEBUG_MSG(KERN_INFO "\n Integrated TMDS ! \n");
138-
return OK;
122+
return true;
139123
}
140124

141125
switch (viaparinfo->chip_info->gfx_chip_name) {
@@ -159,7 +143,7 @@ int __devinit viafb_tmds_trasmitter_identify(void)
159143
tmds_chip_info.tmds_chip_name = NON_TMDS_TRANSMITTER;
160144
viaparinfo->chip_info->tmds_chip_info.
161145
tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR;
162-
return FAIL;
146+
return false;
163147
}
164148

165149
static void tmds_register_write(int index, u8 data)
@@ -306,63 +290,23 @@ static int viafb_dvi_query_EDID(void)
306290
return EDID_VERSION_1; /* Found EDID1 Table */
307291
}
308292

309-
data0 = (u8) tmds_register_read(0x00);
310-
viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = restore;
311-
if (data0 == 0x20)
312-
return EDID_VERSION_2; /* Found EDID2 Table */
313-
else
314-
return false;
293+
return false;
315294
}
316295

317296
/* Get Panel Size Using EDID1 Table */
318297
static void __devinit dvi_get_panel_size_from_DDCv1(
319298
struct tmds_chip_information *tmds_chip,
320299
struct tmds_setting_information *tmds_setting)
321300
{
322-
int i, max_h = 0, tmp, restore;
323-
unsigned char rData;
301+
int i, restore;
324302
unsigned char EDID_DATA[18];
325303

326304
DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n");
327305

328306
restore = tmds_chip->tmds_chip_slave_addr;
329307
tmds_chip->tmds_chip_slave_addr = 0xA0;
330-
331-
rData = tmds_register_read(0x23);
332-
if (rData & 0x3C)
333-
max_h = 640;
334-
if (rData & 0xC0)
335-
max_h = 720;
336-
if (rData & 0x03)
337-
max_h = 800;
338-
339-
rData = tmds_register_read(0x24);
340-
if (rData & 0xC0)
341-
max_h = 800;
342-
if (rData & 0x1E)
343-
max_h = 1024;
344-
if (rData & 0x01)
345-
max_h = 1280;
346-
347308
for (i = 0x25; i < 0x6D; i++) {
348309
switch (i) {
349-
case 0x26:
350-
case 0x28:
351-
case 0x2A:
352-
case 0x2C:
353-
case 0x2E:
354-
case 0x30:
355-
case 0x32:
356-
case 0x34:
357-
rData = tmds_register_read(i);
358-
if (rData == 1)
359-
break;
360-
/* data = (data + 31) * 8 */
361-
tmp = (rData + 31) << 3;
362-
if (tmp > max_h)
363-
max_h = tmp;
364-
break;
365-
366310
case 0x36:
367311
case 0x48:
368312
case 0x5A:
@@ -383,91 +327,11 @@ static void __devinit dvi_get_panel_size_from_DDCv1(
383327
}
384328
}
385329

386-
tmds_setting->max_hres = max_h;
387-
switch (max_h) {
388-
case 640:
389-
tmds_setting->max_vres = 480;
390-
break;
391-
case 800:
392-
tmds_setting->max_vres = 600;
393-
break;
394-
case 1024:
395-
tmds_setting->max_vres = 768;
396-
break;
397-
case 1280:
398-
tmds_setting->max_vres = 1024;
399-
break;
400-
case 1400:
401-
tmds_setting->max_vres = 1050;
402-
break;
403-
case 1440:
404-
tmds_setting->max_vres = 1050;
405-
break;
406-
case 1600:
407-
tmds_setting->max_vres = 1200;
408-
break;
409-
case 1920:
410-
tmds_setting->max_vres = 1080;
411-
break;
412-
default:
413-
DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d ! "
414-
"set default panel size.\n", max_h);
415-
break;
416-
}
417-
418330
DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n",
419331
tmds_setting->max_pixel_clock);
420332
tmds_chip->tmds_chip_slave_addr = restore;
421333
}
422334

423-
/* Get Panel Size Using EDID2 Table */
424-
static void __devinit dvi_get_panel_size_from_DDCv2(
425-
struct tmds_chip_information *tmds_chip,
426-
struct tmds_setting_information *tmds_setting)
427-
{
428-
int restore;
429-
unsigned char R_Buffer[2];
430-
431-
DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv2 \n");
432-
433-
restore = tmds_chip->tmds_chip_slave_addr;
434-
tmds_chip->tmds_chip_slave_addr = 0xA2;
435-
436-
/* Horizontal: 0x76, 0x77 */
437-
tmds_register_read_bytes(0x76, R_Buffer, 2);
438-
tmds_setting->max_hres = R_Buffer[0] + (R_Buffer[1] << 8);
439-
440-
switch (tmds_setting->max_hres) {
441-
case 640:
442-
tmds_setting->max_vres = 480;
443-
break;
444-
case 800:
445-
tmds_setting->max_vres = 600;
446-
break;
447-
case 1024:
448-
tmds_setting->max_vres = 768;
449-
break;
450-
case 1280:
451-
tmds_setting->max_vres = 1024;
452-
break;
453-
case 1400:
454-
tmds_setting->max_vres = 1050;
455-
break;
456-
case 1440:
457-
tmds_setting->max_vres = 1050;
458-
break;
459-
case 1600:
460-
tmds_setting->max_vres = 1200;
461-
break;
462-
default:
463-
DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d! "
464-
"set default panel size.\n", tmds_setting->max_hres);
465-
break;
466-
}
467-
468-
tmds_chip->tmds_chip_slave_addr = restore;
469-
}
470-
471335
/* If Disable DVI, turn off pad */
472336
void viafb_dvi_disable(void)
473337
{

drivers/video/via/dvi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
int viafb_dvi_sense(void);
5757
void viafb_dvi_disable(void);
5858
void viafb_dvi_enable(void);
59-
int __devinit viafb_tmds_trasmitter_identify(void);
59+
bool __devinit viafb_tmds_trasmitter_identify(void);
6060
void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
6161
struct tmds_setting_information *tmds_setting);
6262
void viafb_dvi_set_mode(struct VideoModeTable *videoMode, int mode_bpp,

drivers/video/via/global.c

-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ int viafb_hotplug_Yres = 480;
4040
int viafb_hotplug_bpp = 32;
4141
int viafb_hotplug_refresh = 60;
4242
int viafb_primary_dev = None_Device;
43-
unsigned int viafb_second_xres = 640;
44-
unsigned int viafb_second_yres = 480;
45-
unsigned int viafb_second_virtual_xres;
46-
unsigned int viafb_second_virtual_yres;
4743
int viafb_lcd_panel_id = LCD_PANEL_ID_MAXIMUM + 1;
4844
struct fb_info *viafbinfo;
4945
struct fb_info *viafbinfo1;

drivers/video/via/global.h

-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ extern int viafb_hotplug_bpp;
7373
extern int viafb_hotplug_refresh;
7474
extern int viafb_primary_dev;
7575

76-
extern unsigned int viafb_second_xres;
77-
extern unsigned int viafb_second_yres;
7876
extern int viafb_lcd_panel_id;
7977

8078
#endif /* __GLOBAL_H__ */

0 commit comments

Comments
 (0)