aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/hw.c
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2010-09-05 01:33:28 +0000
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2010-09-24 02:14:59 +0000
commit2a9183923af1f6f4da66aeabf9fa5af0dc58ccec (patch)
tree710f8f8fc1b5f922e4c6405abf60eedaff5eb715 /drivers/video/via/hw.c
parentcd7e9103e983ff0f518ac0e85cee265027ccbfa4 (diff)
downloadkernel_samsung_smdk4412-2a9183923af1f6f4da66aeabf9fa5af0dc58ccec.zip
kernel_samsung_smdk4412-2a9183923af1f6f4da66aeabf9fa5af0dc58ccec.tar.gz
kernel_samsung_smdk4412-2a9183923af1f6f4da66aeabf9fa5af0dc58ccec.tar.bz2
viafb: add interface for output device configuration
This patch extends the proc entry to contain a possibility to view and change the output devices for each IGA. This is useful for debugging output problems as it provides a reliable way to query which low level devices are active after VIAs output device configuration nightmare happended. It's as well suitable for daily use as one can change the output configuration on the fly for example to connect a projector. At the moment it's still unstable. The reason is that we have to handle a bunch of undocumented output devices (those without a proper name) and that this patch is the first step to collect and verify the needed information. Basically the only configuration change that is expected to work at the moment is switching output devices between IGA1 and IGA2. 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/via/hw.c')
-rw-r--r--drivers/video/via/hw.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 0330323..e65edce 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -718,6 +718,16 @@ static struct rgbLUT palLUT_table[] = {
0x00}
};
+static struct via_device_mapping device_mapping[] = {
+ {VIA_6C, "6C"},
+ {VIA_93, "93"},
+ {VIA_96, "96"},
+ {VIA_CRT, "CRT"},
+ {VIA_DVP1, "DVP1"},
+ {VIA_LVDS1, "LVDS1"},
+ {VIA_LVDS2, "LVDS2"}
+};
+
static void load_fix_bit_crtc_reg(void);
static void __devinit init_gfx_chip_info(int chip_type);
static void __devinit init_tmds_chip_info(void);
@@ -1026,6 +1036,49 @@ void via_set_source(u32 devices, u8 iga)
set_lvds2_source(iga);
}
+u32 via_parse_odev(char *input, char **end)
+{
+ char *ptr = input;
+ u32 odev = 0;
+ bool next = true;
+ int i, len;
+
+ while (next) {
+ next = false;
+ for (i = 0; i < ARRAY_SIZE(device_mapping); i++) {
+ len = strlen(device_mapping[i].name);
+ if (!strncmp(ptr, device_mapping[i].name, len)) {
+ odev |= device_mapping[i].device;
+ ptr += len;
+ if (*ptr == ',') {
+ ptr++;
+ next = true;
+ }
+ }
+ }
+ }
+
+ *end = ptr;
+ return odev;
+}
+
+void via_odev_to_seq(struct seq_file *m, u32 odev)
+{
+ int i, count = 0;
+
+ for (i = 0; i < ARRAY_SIZE(device_mapping); i++) {
+ if (odev & device_mapping[i].device) {
+ if (count > 0)
+ seq_putc(m, ',');
+
+ seq_puts(m, device_mapping[i].name);
+ count++;
+ }
+ }
+
+ seq_putc(m, '\n');
+}
+
static void load_fix_bit_crtc_reg(void)
{
/* always set to 1 */