diff options
Diffstat (limited to 'drivers/video/via/hw.c')
-rw-r--r-- | drivers/video/via/hw.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index 03303232e543..e65edcea46eb 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -718,6 +718,16 @@ static struct rgbLUT palLUT_table[] = { | |||
718 | 0x00} | 718 | 0x00} |
719 | }; | 719 | }; |
720 | 720 | ||
721 | static struct via_device_mapping device_mapping[] = { | ||
722 | {VIA_6C, "6C"}, | ||
723 | {VIA_93, "93"}, | ||
724 | {VIA_96, "96"}, | ||
725 | {VIA_CRT, "CRT"}, | ||
726 | {VIA_DVP1, "DVP1"}, | ||
727 | {VIA_LVDS1, "LVDS1"}, | ||
728 | {VIA_LVDS2, "LVDS2"} | ||
729 | }; | ||
730 | |||
721 | static void load_fix_bit_crtc_reg(void); | 731 | static void load_fix_bit_crtc_reg(void); |
722 | static void __devinit init_gfx_chip_info(int chip_type); | 732 | static void __devinit init_gfx_chip_info(int chip_type); |
723 | static void __devinit init_tmds_chip_info(void); | 733 | static void __devinit init_tmds_chip_info(void); |
@@ -1026,6 +1036,49 @@ void via_set_source(u32 devices, u8 iga) | |||
1026 | set_lvds2_source(iga); | 1036 | set_lvds2_source(iga); |
1027 | } | 1037 | } |
1028 | 1038 | ||
1039 | u32 via_parse_odev(char *input, char **end) | ||
1040 | { | ||
1041 | char *ptr = input; | ||
1042 | u32 odev = 0; | ||
1043 | bool next = true; | ||
1044 | int i, len; | ||
1045 | |||
1046 | while (next) { | ||
1047 | next = false; | ||
1048 | for (i = 0; i < ARRAY_SIZE(device_mapping); i++) { | ||
1049 | len = strlen(device_mapping[i].name); | ||
1050 | if (!strncmp(ptr, device_mapping[i].name, len)) { | ||
1051 | odev |= device_mapping[i].device; | ||
1052 | ptr += len; | ||
1053 | if (*ptr == ',') { | ||
1054 | ptr++; | ||
1055 | next = true; | ||
1056 | } | ||
1057 | } | ||
1058 | } | ||
1059 | } | ||
1060 | |||
1061 | *end = ptr; | ||
1062 | return odev; | ||
1063 | } | ||
1064 | |||
1065 | void via_odev_to_seq(struct seq_file *m, u32 odev) | ||
1066 | { | ||
1067 | int i, count = 0; | ||
1068 | |||
1069 | for (i = 0; i < ARRAY_SIZE(device_mapping); i++) { | ||
1070 | if (odev & device_mapping[i].device) { | ||
1071 | if (count > 0) | ||
1072 | seq_putc(m, ','); | ||
1073 | |||
1074 | seq_puts(m, device_mapping[i].name); | ||
1075 | count++; | ||
1076 | } | ||
1077 | } | ||
1078 | |||
1079 | seq_putc(m, '\n'); | ||
1080 | } | ||
1081 | |||
1029 | static void load_fix_bit_crtc_reg(void) | 1082 | static void load_fix_bit_crtc_reg(void) |
1030 | { | 1083 | { |
1031 | /* always set to 1 */ | 1084 | /* always set to 1 */ |