diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-09-19 00:20:55 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-09-23 22:15:23 -0400 |
commit | dd7a0b08cd921763e570f693ecc4816aa2f1a3fd (patch) | |
tree | 506b7a797e8f20cd21fa9518aa45e23a5553d36d /drivers/video | |
parent | 2e1abbdd1dbc49e16eabd13e8b2458ee48e7b560 (diff) |
viafb: add a mapping of supported output devices
This patch maps supported output devices to IGP versions. This list may
contain errors as most of it is derived of the driver source but it should
be correct enough to provide a good help. The devices are exported via a
proc entry in the same format as those showing the output devices per IGA.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/via/viafbdev.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 164c6ea603d2..50f486d9b087 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -56,6 +56,31 @@ static int viafb_pan_display(struct fb_var_screeninfo *var, | |||
56 | 56 | ||
57 | static struct fb_ops viafb_ops; | 57 | static struct fb_ops viafb_ops; |
58 | 58 | ||
59 | /* supported output devices on each IGP | ||
60 | * only CX700, VX800, VX855 were documented | ||
61 | * VIA_CRT should be everywhere | ||
62 | * VIA_6C can be onle pre-CX700 (probably only on CLE266) as 6C is used for PLL | ||
63 | * source selection on CX700 and later | ||
64 | * K400 seems to support VIA_96, VIA_DVP1, VIA_LVDS{1,2} as in viamode.c | ||
65 | */ | ||
66 | static const u32 supported_odev_map[] = { | ||
67 | [UNICHROME_CLE266] = VIA_CRT | VIA_6C | VIA_93, | ||
68 | [UNICHROME_K400] = VIA_CRT | VIA_96 | VIA_DVP1 | VIA_LVDS1 | ||
69 | | VIA_LVDS2, | ||
70 | [UNICHROME_K800] = VIA_CRT | VIA_96 | VIA_DVP1 | VIA_LVDS1 | ||
71 | | VIA_LVDS2, | ||
72 | [UNICHROME_PM800] = VIA_CRT | VIA_96 | VIA_DVP1 | VIA_LVDS1 | ||
73 | | VIA_LVDS2, | ||
74 | [UNICHROME_CN700] = VIA_CRT | VIA_96 | VIA_DVP1 | VIA_LVDS1 | ||
75 | | VIA_LVDS2, | ||
76 | [UNICHROME_CX700] = VIA_CRT | VIA_DVP1 | VIA_LVDS1 | VIA_LVDS2, | ||
77 | [UNICHROME_CN750] = VIA_CRT | VIA_DVP1 | VIA_LVDS1 | VIA_LVDS2, | ||
78 | [UNICHROME_K8M890] = VIA_CRT | VIA_DVP1 | VIA_LVDS1 | VIA_LVDS2, | ||
79 | [UNICHROME_P4M890] = VIA_CRT | VIA_DVP1 | VIA_LVDS1 | VIA_LVDS2, | ||
80 | [UNICHROME_P4M900] = VIA_CRT | VIA_DVP1 | VIA_LVDS1 | VIA_LVDS2, | ||
81 | [UNICHROME_VX800] = VIA_CRT | VIA_DVP1 | VIA_LVDS1 | VIA_LVDS2, | ||
82 | [UNICHROME_VX855] = VIA_CRT | VIA_DVP1 | VIA_LVDS1 | VIA_LVDS2, | ||
83 | }; | ||
59 | 84 | ||
60 | static void viafb_fill_var_color_info(struct fb_var_screeninfo *var, u8 depth) | 85 | static void viafb_fill_var_color_info(struct fb_var_screeninfo *var, u8 depth) |
61 | { | 86 | { |
@@ -1433,6 +1458,26 @@ static const struct file_operations viafb_vt1636_proc_fops = { | |||
1433 | 1458 | ||
1434 | #endif /* CONFIG_FB_VIA_DIRECT_PROCFS */ | 1459 | #endif /* CONFIG_FB_VIA_DIRECT_PROCFS */ |
1435 | 1460 | ||
1461 | static int viafb_sup_odev_proc_show(struct seq_file *m, void *v) | ||
1462 | { | ||
1463 | via_odev_to_seq(m, supported_odev_map[ | ||
1464 | viaparinfo->shared->chip_info.gfx_chip_name]); | ||
1465 | return 0; | ||
1466 | } | ||
1467 | |||
1468 | static int viafb_sup_odev_proc_open(struct inode *inode, struct file *file) | ||
1469 | { | ||
1470 | return single_open(file, viafb_sup_odev_proc_show, NULL); | ||
1471 | } | ||
1472 | |||
1473 | static const struct file_operations viafb_sup_odev_proc_fops = { | ||
1474 | .owner = THIS_MODULE, | ||
1475 | .open = viafb_sup_odev_proc_open, | ||
1476 | .read = seq_read, | ||
1477 | .llseek = seq_lseek, | ||
1478 | .release = single_release, | ||
1479 | }; | ||
1480 | |||
1436 | static ssize_t odev_update(const char __user *buffer, size_t count, u32 *odev) | 1481 | static ssize_t odev_update(const char __user *buffer, size_t count, u32 *odev) |
1437 | { | 1482 | { |
1438 | char buf[64], *ptr = buf; | 1483 | char buf[64], *ptr = buf; |
@@ -1561,6 +1606,8 @@ static void viafb_init_proc(struct viafb_shared *shared) | |||
1561 | &viafb_vt1636_proc_fops); | 1606 | &viafb_vt1636_proc_fops); |
1562 | #endif /* CONFIG_FB_VIA_DIRECT_PROCFS */ | 1607 | #endif /* CONFIG_FB_VIA_DIRECT_PROCFS */ |
1563 | 1608 | ||
1609 | proc_create("supported_output_devices", 0, viafb_entry, | ||
1610 | &viafb_sup_odev_proc_fops); | ||
1564 | iga1_entry = proc_mkdir("iga1", viafb_entry); | 1611 | iga1_entry = proc_mkdir("iga1", viafb_entry); |
1565 | shared->iga1_proc_entry = iga1_entry; | 1612 | shared->iga1_proc_entry = iga1_entry; |
1566 | proc_create("output_devices", 0, iga1_entry, | 1613 | proc_create("output_devices", 0, iga1_entry, |
@@ -1584,6 +1631,7 @@ static void viafb_remove_proc(struct viafb_shared *shared) | |||
1584 | remove_proc_entry("iga2", viafb_entry); | 1631 | remove_proc_entry("iga2", viafb_entry); |
1585 | remove_proc_entry("output_devices", iga1_entry); | 1632 | remove_proc_entry("output_devices", iga1_entry); |
1586 | remove_proc_entry("iga1", viafb_entry); | 1633 | remove_proc_entry("iga1", viafb_entry); |
1634 | remove_proc_entry("supported_output_devices", viafb_entry); | ||
1587 | 1635 | ||
1588 | #ifdef CONFIG_FB_VIA_DIRECT_PROCFS | 1636 | #ifdef CONFIG_FB_VIA_DIRECT_PROCFS |
1589 | remove_proc_entry("dvp0", viafb_entry);/* parent dir */ | 1637 | remove_proc_entry("dvp0", viafb_entry);/* parent dir */ |