aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-02-02 22:42:44 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 22:42:44 -0500
commitc6f4bc211122c86de85a6c93f139319957fd1f8a (patch)
treeff827115a39127b15933c072c3183ce2485ceb7a /drivers/acpi/video.c
parent7e23772f414cdbfb2a08aed237d6e926bb1cb728 (diff)
parent82cae99980c158cb9724415547ca59cf95c58792 (diff)
Pull bugzilla-7349 into test branch
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c58
1 files changed, 43 insertions, 15 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index cf60ca5515d2..a695aeb8b2a7 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -59,6 +59,11 @@
59#define ACPI_VIDEO_HEAD_END (~0u) 59#define ACPI_VIDEO_HEAD_END (~0u)
60#define MAX_NAME_LEN 20 60#define MAX_NAME_LEN 20
61 61
62#define ACPI_VIDEO_DISPLAY_CRT 1
63#define ACPI_VIDEO_DISPLAY_TV 2
64#define ACPI_VIDEO_DISPLAY_DVI 3
65#define ACPI_VIDEO_DISPLAY_LCD 4
66
62#define _COMPONENT ACPI_VIDEO_COMPONENT 67#define _COMPONENT ACPI_VIDEO_COMPONENT
63ACPI_MODULE_NAME("acpi_video") 68ACPI_MODULE_NAME("acpi_video")
64 69
@@ -135,9 +140,10 @@ struct acpi_video_device_flags {
135 u8 crt:1; 140 u8 crt:1;
136 u8 lcd:1; 141 u8 lcd:1;
137 u8 tvout:1; 142 u8 tvout:1;
143 u8 dvi:1;
138 u8 bios:1; 144 u8 bios:1;
139 u8 unknown:1; 145 u8 unknown:1;
140 u8 reserved:3; 146 u8 reserved:2;
141}; 147};
142 148
143struct acpi_video_device_cap { 149struct acpi_video_device_cap {
@@ -732,6 +738,8 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset)
732 seq_printf(seq, "LCD\n"); 738 seq_printf(seq, "LCD\n");
733 else if (dev->flags.tvout) 739 else if (dev->flags.tvout)
734 seq_printf(seq, "TVOUT\n"); 740 seq_printf(seq, "TVOUT\n");
741 else if (dev->flags.dvi)
742 seq_printf(seq, "DVI\n");
735 else 743 else
736 seq_printf(seq, "UNKNOWN\n"); 744 seq_printf(seq, "UNKNOWN\n");
737 745
@@ -1306,6 +1314,16 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device)
1306 -------------------------------------------------------------------------- */ 1314 -------------------------------------------------------------------------- */
1307 1315
1308/* device interface */ 1316/* device interface */
1317static struct acpi_video_device_attrib*
1318acpi_video_get_device_attr(struct acpi_video_bus *video, unsigned long device_id)
1319{
1320 int count;
1321
1322 for(count = 0; count < video->attached_count; count++)
1323 if((video->attached_array[count].value.int_val & 0xffff) == device_id)
1324 return &(video->attached_array[count].value.attrib);
1325 return NULL;
1326}
1309 1327
1310static int 1328static int
1311acpi_video_bus_get_one_device(struct acpi_device *device, 1329acpi_video_bus_get_one_device(struct acpi_device *device,
@@ -1314,7 +1332,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1314 unsigned long device_id; 1332 unsigned long device_id;
1315 int status; 1333 int status;
1316 struct acpi_video_device *data; 1334 struct acpi_video_device *data;
1317 1335 struct acpi_video_device_attrib* attribute;
1318 1336
1319 if (!device || !video) 1337 if (!device || !video)
1320 return -EINVAL; 1338 return -EINVAL;
@@ -1335,20 +1353,30 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1335 data->video = video; 1353 data->video = video;
1336 data->dev = device; 1354 data->dev = device;
1337 1355
1338 switch (device_id & 0xffff) { 1356 attribute = acpi_video_get_device_attr(video, device_id);
1339 case 0x0100: 1357
1340 data->flags.crt = 1; 1358 if((attribute != NULL) && attribute->device_id_scheme) {
1341 break; 1359 switch (attribute->display_type) {
1342 case 0x0400: 1360 case ACPI_VIDEO_DISPLAY_CRT:
1343 data->flags.lcd = 1; 1361 data->flags.crt = 1;
1344 break; 1362 break;
1345 case 0x0200: 1363 case ACPI_VIDEO_DISPLAY_TV:
1346 data->flags.tvout = 1; 1364 data->flags.tvout = 1;
1347 break; 1365 break;
1348 default: 1366 case ACPI_VIDEO_DISPLAY_DVI:
1367 data->flags.dvi = 1;
1368 break;
1369 case ACPI_VIDEO_DISPLAY_LCD:
1370 data->flags.lcd = 1;
1371 break;
1372 default:
1373 data->flags.unknown = 1;
1374 break;
1375 }
1376 if(attribute->bios_can_detect)
1377 data->flags.bios = 1;
1378 } else
1349 data->flags.unknown = 1; 1379 data->flags.unknown = 1;
1350 break;
1351 }
1352 1380
1353 acpi_video_device_bind(video, data); 1381 acpi_video_device_bind(video, data);
1354 acpi_video_device_find_cap(data); 1382 acpi_video_device_find_cap(data);