aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2009-09-22 19:47:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:52 -0400
commitb008c64b5dfe37ac14928668da60132e9c8361ff (patch)
treeaac9d95e0b6efb10a071db5af5326420927bdd86 /drivers/video/via
parent13147f291cb18489cbaa550b100dee6f9defd007 (diff)
viafb: clean up duoview
Clean the duoview handling up by replacing the varible with the funtion in the only place where it is used. This is a code cleanup only, no runtime change expected. 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>
Diffstat (limited to 'drivers/video/via')
-rw-r--r--drivers/video/via/viafbdev.c18
-rw-r--r--drivers/video/via/viafbdev.h1
2 files changed, 2 insertions, 17 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 50e9300d0de0..0cd112a36901 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1009,7 +1009,8 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1009 return -ENODEV; 1009 return -ENODEV;
1010 1010
1011 /* When duoview and using lcd , use soft cursor */ 1011 /* When duoview and using lcd , use soft cursor */
1012 if (viafb_LCD_ON || ((struct viafb_par *)(info->par))->duoview) 1012 if (viafb_LCD_ON || (!viafb_SAMM_ON &&
1013 viafb_LCD2_ON + viafb_DVI_ON + viafb_CRT_ON == 2))
1013 return -ENODEV; 1014 return -ENODEV;
1014 1015
1015 viafb_show_hw_cursor(info, HW_Cursor_OFF); 1016 viafb_show_hw_cursor(info, HW_Cursor_OFF);
@@ -1379,18 +1380,6 @@ static int get_primary_device(void)
1379 return primary_device; 1380 return primary_device;
1380} 1381}
1381 1382
1382static u8 is_duoview(void)
1383{
1384 if (0 == viafb_SAMM_ON) {
1385 if (viafb_LCD_ON + viafb_LCD2_ON +
1386 viafb_DVI_ON + viafb_CRT_ON == 2)
1387 return true;
1388 return false;
1389 } else {
1390 return false;
1391 }
1392}
1393
1394static void apply_second_mode_setting(struct fb_var_screeninfo 1383static void apply_second_mode_setting(struct fb_var_screeninfo
1395 *sec_var) 1384 *sec_var)
1396{ 1385{
@@ -1499,8 +1488,6 @@ static int apply_device_setting(struct viafb_ioctl_setting setting_info,
1499 need_set_mode = 1; 1488 need_set_mode = 1;
1500 } 1489 }
1501 1490
1502 viaparinfo->duoview = is_duoview();
1503
1504 if (!need_set_mode) { 1491 if (!need_set_mode) {
1505 ; 1492 ;
1506 } else { 1493 } else {
@@ -1621,7 +1608,6 @@ static void parse_active_dev(void)
1621 viafb_CRT_ON = STATE_ON; 1608 viafb_CRT_ON = STATE_ON;
1622 viafb_SAMM_ON = STATE_OFF; 1609 viafb_SAMM_ON = STATE_OFF;
1623 } 1610 }
1624 viaparinfo->duoview = is_duoview();
1625} 1611}
1626 1612
1627static void parse_video_dev(void) 1613static void parse_video_dev(void)
diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h
index cd3dff7cc170..92318770107e 100644
--- a/drivers/video/via/viafbdev.h
+++ b/drivers/video/via/viafbdev.h
@@ -52,7 +52,6 @@ struct viafb_par {
52 u32 VQ_end; /* Virtual Queue End Address */ 52 u32 VQ_end; /* Virtual Queue End Address */
53 u32 iga_path; 53 u32 iga_path;
54 struct proc_dir_entry *proc_entry; /*viafb proc entry */ 54 struct proc_dir_entry *proc_entry; /*viafb proc entry */
55 u8 duoview; /*Is working in duoview mode? */
56 55
57 /* I2C stuff */ 56 /* I2C stuff */
58 struct via_i2c_stuff i2c_stuff; 57 struct via_i2c_stuff i2c_stuff;