diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2009-09-22 19:47:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:52 -0400 |
commit | b852abc263519e89a364dc81e697cba0d4371cf3 (patch) | |
tree | edeebdccaabae0bf96a20a96d36da19f655089b4 | |
parent | db88e382a043bf288a6257dc5069f19c5ae67df6 (diff) |
viafb: remove unused video device stuff
Remove everything related to video devices from the driver as it did not
influence the driver operation. This patch does change the userspace
behaviour as it removes two IOCTLs and one module parameter. But this is
good as it removes useless stuff and helps the user to figure out the
options that do affect the driver behaviour (which are still too many).
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Harald Welte <laforge@gnumonks.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/via/ioctl.h | 6 | ||||
-rw-r--r-- | drivers/video/via/viafbdev.c | 77 | ||||
-rw-r--r-- | drivers/video/via/viafbdev.h | 6 |
3 files changed, 1 insertions, 88 deletions
diff --git a/drivers/video/via/ioctl.h b/drivers/video/via/ioctl.h index 842fe30b9868..de899807eade 100644 --- a/drivers/video/via/ioctl.h +++ b/drivers/video/via/ioctl.h | |||
@@ -50,8 +50,6 @@ | |||
50 | #define VIAFB_GET_GAMMA_LUT 0x56494124 | 50 | #define VIAFB_GET_GAMMA_LUT 0x56494124 |
51 | #define VIAFB_SET_GAMMA_LUT 0x56494125 | 51 | #define VIAFB_SET_GAMMA_LUT 0x56494125 |
52 | #define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126 | 52 | #define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126 |
53 | #define VIAFB_SET_VIDEO_DEVICE 0x56494127 | ||
54 | #define VIAFB_GET_VIDEO_DEVICE 0x56494128 | ||
55 | #define VIAFB_SET_SECOND_MODE 0x56494129 | 53 | #define VIAFB_SET_SECOND_MODE 0x56494129 |
56 | #define VIAFB_SYNC_SURFACE 0x56494130 | 54 | #define VIAFB_SYNC_SURFACE 0x56494130 |
57 | #define VIAFB_GET_DRIVER_CAPS 0x56494131 | 55 | #define VIAFB_GET_DRIVER_CAPS 0x56494131 |
@@ -179,9 +177,7 @@ struct viafb_ioctl_setting { | |||
179 | unsigned short second_dev_bpp; | 177 | unsigned short second_dev_bpp; |
180 | /* Indicate which device are primary display device. */ | 178 | /* Indicate which device are primary display device. */ |
181 | unsigned int primary_device; | 179 | unsigned int primary_device; |
182 | /* Indicate which device will show video. only valid in duoview mode */ | 180 | unsigned int struct_reserved[35]; |
183 | unsigned int video_device_status; | ||
184 | unsigned int struct_reserved[34]; | ||
185 | struct viafb_ioctl_lcd_attribute lcd_attributes; | 181 | struct viafb_ioctl_lcd_attribute lcd_attributes; |
186 | }; | 182 | }; |
187 | 183 | ||
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 86835ee41027..924177cc814e 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -36,9 +36,6 @@ static char *viafb_mode1 = "640x480"; | |||
36 | /* Added for specifying active devices.*/ | 36 | /* Added for specifying active devices.*/ |
37 | char *viafb_active_dev = ""; | 37 | char *viafb_active_dev = ""; |
38 | 38 | ||
39 | /* Added for specifying video on devices.*/ | ||
40 | char *viafb_video_dev = ""; | ||
41 | |||
42 | /*Added for specify lcd output port*/ | 39 | /*Added for specify lcd output port*/ |
43 | char *viafb_lcd_port = ""; | 40 | char *viafb_lcd_port = ""; |
44 | char *viafb_dvi_port = ""; | 41 | char *viafb_dvi_port = ""; |
@@ -50,8 +47,6 @@ static void apply_second_mode_setting(struct fb_var_screeninfo | |||
50 | *sec_var); | 47 | *sec_var); |
51 | static void retrieve_device_setting(struct viafb_ioctl_setting | 48 | static void retrieve_device_setting(struct viafb_ioctl_setting |
52 | *setting_info); | 49 | *setting_info); |
53 | static void viafb_set_video_device(u32 video_dev_info); | ||
54 | static void viafb_get_video_device(u32 *video_dev_info); | ||
55 | 50 | ||
56 | static struct fb_ops viafb_ops; | 51 | static struct fb_ops viafb_ops; |
57 | 52 | ||
@@ -488,7 +483,6 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) | |||
488 | 483 | ||
489 | u32 __user *argp = (u32 __user *) arg; | 484 | u32 __user *argp = (u32 __user *) arg; |
490 | u32 gpu32; | 485 | u32 gpu32; |
491 | u32 video_dev_info = 0; | ||
492 | 486 | ||
493 | DEBUG_MSG(KERN_INFO "viafb_ioctl: 0x%X !!\n", cmd); | 487 | DEBUG_MSG(KERN_INFO "viafb_ioctl: 0x%X !!\n", cmd); |
494 | memset(&u, 0, sizeof(u)); | 488 | memset(&u, 0, sizeof(u)); |
@@ -720,15 +714,6 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) | |||
720 | if (put_user(state_info, argp)) | 714 | if (put_user(state_info, argp)) |
721 | return -EFAULT; | 715 | return -EFAULT; |
722 | break; | 716 | break; |
723 | case VIAFB_SET_VIDEO_DEVICE: | ||
724 | get_user(video_dev_info, argp); | ||
725 | viafb_set_video_device(video_dev_info); | ||
726 | break; | ||
727 | case VIAFB_GET_VIDEO_DEVICE: | ||
728 | viafb_get_video_device(&video_dev_info); | ||
729 | if (put_user(video_dev_info, argp)) | ||
730 | return -EFAULT; | ||
731 | break; | ||
732 | case VIAFB_SYNC_SURFACE: | 717 | case VIAFB_SYNC_SURFACE: |
733 | DEBUG_MSG(KERN_INFO "lobo VIAFB_SYNC_SURFACE\n"); | 718 | DEBUG_MSG(KERN_INFO "lobo VIAFB_SYNC_SURFACE\n"); |
734 | break; | 719 | break; |
@@ -1309,32 +1294,6 @@ static void viafb_set_device(struct device_t active_dev) | |||
1309 | viafb_set_iga_path(); | 1294 | viafb_set_iga_path(); |
1310 | } | 1295 | } |
1311 | 1296 | ||
1312 | static void viafb_set_video_device(u32 video_dev_info) | ||
1313 | { | ||
1314 | viaparinfo->video_on_crt = STATE_OFF; | ||
1315 | viaparinfo->video_on_dvi = STATE_OFF; | ||
1316 | viaparinfo->video_on_lcd = STATE_OFF; | ||
1317 | |||
1318 | /* Check available device to enable: */ | ||
1319 | if ((video_dev_info & CRT_Device) == CRT_Device) | ||
1320 | viaparinfo->video_on_crt = STATE_ON; | ||
1321 | else if ((video_dev_info & DVI_Device) == DVI_Device) | ||
1322 | viaparinfo->video_on_dvi = STATE_ON; | ||
1323 | else if ((video_dev_info & LCD_Device) == LCD_Device) | ||
1324 | viaparinfo->video_on_lcd = STATE_ON; | ||
1325 | } | ||
1326 | |||
1327 | static void viafb_get_video_device(u32 *video_dev_info) | ||
1328 | { | ||
1329 | *video_dev_info = None_Device; | ||
1330 | if (viaparinfo->video_on_crt == STATE_ON) | ||
1331 | *video_dev_info |= CRT_Device; | ||
1332 | else if (viaparinfo->video_on_dvi == STATE_ON) | ||
1333 | *video_dev_info |= DVI_Device; | ||
1334 | else if (viaparinfo->video_on_lcd == STATE_ON) | ||
1335 | *video_dev_info |= LCD_Device; | ||
1336 | } | ||
1337 | |||
1338 | static int get_primary_device(void) | 1297 | static int get_primary_device(void) |
1339 | { | 1298 | { |
1340 | int primary_device = 0; | 1299 | int primary_device = 0; |
@@ -1506,18 +1465,6 @@ static void retrieve_device_setting(struct viafb_ioctl_setting | |||
1506 | setting_info->device_status |= LCD_Device; | 1465 | setting_info->device_status |= LCD_Device; |
1507 | if (viafb_LCD2_ON == 1) | 1466 | if (viafb_LCD2_ON == 1) |
1508 | setting_info->device_status |= LCD2_Device; | 1467 | setting_info->device_status |= LCD2_Device; |
1509 | if ((viaparinfo->video_on_crt == 1) && (viafb_CRT_ON == 1)) { | ||
1510 | setting_info->video_device_status = | ||
1511 | viaparinfo->crt_setting_info->iga_path; | ||
1512 | } else if ((viaparinfo->video_on_dvi == 1) && (viafb_DVI_ON == 1)) { | ||
1513 | setting_info->video_device_status = | ||
1514 | viaparinfo->tmds_setting_info->iga_path; | ||
1515 | } else if ((viaparinfo->video_on_lcd == 1) && (viafb_LCD_ON == 1)) { | ||
1516 | setting_info->video_device_status = | ||
1517 | viaparinfo->lvds_setting_info->iga_path; | ||
1518 | } else { | ||
1519 | setting_info->video_device_status = 0; | ||
1520 | } | ||
1521 | 1468 | ||
1522 | setting_info->samm_status = viafb_SAMM_ON; | 1469 | setting_info->samm_status = viafb_SAMM_ON; |
1523 | setting_info->primary_device = get_primary_device(); | 1470 | setting_info->primary_device = get_primary_device(); |
@@ -1606,24 +1553,6 @@ static void parse_active_dev(void) | |||
1606 | } | 1553 | } |
1607 | } | 1554 | } |
1608 | 1555 | ||
1609 | static void parse_video_dev(void) | ||
1610 | { | ||
1611 | viaparinfo->video_on_crt = STATE_OFF; | ||
1612 | viaparinfo->video_on_dvi = STATE_OFF; | ||
1613 | viaparinfo->video_on_lcd = STATE_OFF; | ||
1614 | |||
1615 | if (!strncmp(viafb_video_dev, "CRT", 3)) { | ||
1616 | /* Video on CRT */ | ||
1617 | viaparinfo->video_on_crt = STATE_ON; | ||
1618 | } else if (!strncmp(viafb_video_dev, "DVI", 3)) { | ||
1619 | /* Video on DVI */ | ||
1620 | viaparinfo->video_on_dvi = STATE_ON; | ||
1621 | } else if (!strncmp(viafb_video_dev, "LCD", 3)) { | ||
1622 | /* Video on LCD */ | ||
1623 | viaparinfo->video_on_lcd = STATE_ON; | ||
1624 | } | ||
1625 | } | ||
1626 | |||
1627 | static int parse_port(char *opt_str, int *output_interface) | 1556 | static int parse_port(char *opt_str, int *output_interface) |
1628 | { | 1557 | { |
1629 | if (!strncmp(opt_str, "DVP0", 4)) | 1558 | if (!strncmp(opt_str, "DVP0", 4)) |
@@ -2054,7 +1983,6 @@ static int __devinit via_pci_probe(void) | |||
2054 | if (viafb_dual_fb) | 1983 | if (viafb_dual_fb) |
2055 | viafb_SAMM_ON = 1; | 1984 | viafb_SAMM_ON = 1; |
2056 | parse_active_dev(); | 1985 | parse_active_dev(); |
2057 | parse_video_dev(); | ||
2058 | parse_lcd_port(); | 1986 | parse_lcd_port(); |
2059 | parse_dvi_port(); | 1987 | parse_dvi_port(); |
2060 | 1988 | ||
@@ -2354,8 +2282,6 @@ static int __init viafb_setup(char *options) | |||
2354 | else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) | 2282 | else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) |
2355 | strict_strtoul(this_opt + 15, 0, | 2283 | strict_strtoul(this_opt + 15, 0, |
2356 | (unsigned long *)&viafb_lcd_mode); | 2284 | (unsigned long *)&viafb_lcd_mode); |
2357 | else if (!strncmp(this_opt, "viafb_video_dev=", 16)) | ||
2358 | viafb_video_dev = kstrdup(this_opt + 16, GFP_KERNEL); | ||
2359 | else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) | 2285 | else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) |
2360 | viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL); | 2286 | viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL); |
2361 | else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) | 2287 | else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) |
@@ -2476,9 +2402,6 @@ module_param(viafb_lcd_mode, int, 0); | |||
2476 | MODULE_PARM_DESC(viafb_lcd_mode, | 2402 | MODULE_PARM_DESC(viafb_lcd_mode, |
2477 | "Set Flat Panel mode(Default=OPENLDI)"); | 2403 | "Set Flat Panel mode(Default=OPENLDI)"); |
2478 | 2404 | ||
2479 | module_param(viafb_video_dev, charp, 0); | ||
2480 | MODULE_PARM_DESC(viafb_video_dev, "Specify video devices."); | ||
2481 | |||
2482 | module_param(viafb_lcd_port, charp, 0); | 2405 | module_param(viafb_lcd_port, charp, 0); |
2483 | MODULE_PARM_DESC(viafb_lcd_port, "Specify LCD output port."); | 2406 | MODULE_PARM_DESC(viafb_lcd_port, "Specify LCD output port."); |
2484 | 2407 | ||
diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h index e5a247c1bb91..cd871f95498b 100644 --- a/drivers/video/via/viafbdev.h +++ b/drivers/video/via/viafbdev.h | |||
@@ -61,12 +61,6 @@ struct viafb_par { | |||
61 | struct lvds_setting_information *lvds_setting_info; | 61 | struct lvds_setting_information *lvds_setting_info; |
62 | struct lvds_setting_information *lvds_setting_info2; | 62 | struct lvds_setting_information *lvds_setting_info2; |
63 | struct chip_information *chip_info; | 63 | struct chip_information *chip_info; |
64 | |||
65 | /* some information related to video playing */ | ||
66 | int video_on_crt; | ||
67 | int video_on_dvi; | ||
68 | int video_on_lcd; | ||
69 | |||
70 | }; | 64 | }; |
71 | 65 | ||
72 | extern unsigned int viafb_second_virtual_yres; | 66 | extern unsigned int viafb_second_virtual_yres; |