aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorRui Zhang <rui.zhang@intel.com>2007-01-03 23:40:53 -0500
committerLen Brown <len.brown@intel.com>2007-01-03 23:40:53 -0500
commit82cae99980c158cb9724415547ca59cf95c58792 (patch)
tree4aea5e429ec85f758ad46687302074909e2cfad0 /drivers/acpi/video.c
parent7523c4dd9923cab748dad9b79d0165e118e3d03b (diff)
ACPI: video: fix LCD monitor seen as CRT
http://bugzilla.kernel.org/show_bug.cgi?id=7349 Signed-off-by: Len Brown <len.brown@intel.com>
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 36b37d755dbc..6f760b51ca2d 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -57,6 +57,11 @@
57#define ACPI_VIDEO_HEAD_INVALID (~0u - 1) 57#define ACPI_VIDEO_HEAD_INVALID (~0u - 1)
58#define ACPI_VIDEO_HEAD_END (~0u) 58#define ACPI_VIDEO_HEAD_END (~0u)
59 59
60#define ACPI_VIDEO_DISPLAY_CRT 1
61#define ACPI_VIDEO_DISPLAY_TV 2
62#define ACPI_VIDEO_DISPLAY_DVI 3
63#define ACPI_VIDEO_DISPLAY_LCD 4
64
60#define _COMPONENT ACPI_VIDEO_COMPONENT 65#define _COMPONENT ACPI_VIDEO_COMPONENT
61ACPI_MODULE_NAME("acpi_video") 66ACPI_MODULE_NAME("acpi_video")
62 67
@@ -133,9 +138,10 @@ struct acpi_video_device_flags {
133 u8 crt:1; 138 u8 crt:1;
134 u8 lcd:1; 139 u8 lcd:1;
135 u8 tvout:1; 140 u8 tvout:1;
141 u8 dvi:1;
136 u8 bios:1; 142 u8 bios:1;
137 u8 unknown:1; 143 u8 unknown:1;
138 u8 reserved:3; 144 u8 reserved:2;
139}; 145};
140 146
141struct acpi_video_device_cap { 147struct acpi_video_device_cap {
@@ -668,6 +674,8 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset)
668 seq_printf(seq, "LCD\n"); 674 seq_printf(seq, "LCD\n");
669 else if (dev->flags.tvout) 675 else if (dev->flags.tvout)
670 seq_printf(seq, "TVOUT\n"); 676 seq_printf(seq, "TVOUT\n");
677 else if (dev->flags.dvi)
678 seq_printf(seq, "DVI\n");
671 else 679 else
672 seq_printf(seq, "UNKNOWN\n"); 680 seq_printf(seq, "UNKNOWN\n");
673 681
@@ -1242,6 +1250,16 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device)
1242 -------------------------------------------------------------------------- */ 1250 -------------------------------------------------------------------------- */
1243 1251
1244/* device interface */ 1252/* device interface */
1253static struct acpi_video_device_attrib*
1254acpi_video_get_device_attr(struct acpi_video_bus *video, unsigned long device_id)
1255{
1256 int count;
1257
1258 for(count = 0; count < video->attached_count; count++)
1259 if((video->attached_array[count].value.int_val & 0xffff) == device_id)
1260 return &(video->attached_array[count].value.attrib);
1261 return NULL;
1262}
1245 1263
1246static int 1264static int
1247acpi_video_bus_get_one_device(struct acpi_device *device, 1265acpi_video_bus_get_one_device(struct acpi_device *device,
@@ -1250,7 +1268,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1250 unsigned long device_id; 1268 unsigned long device_id;
1251 int status; 1269 int status;
1252 struct acpi_video_device *data; 1270 struct acpi_video_device *data;
1253 1271 struct acpi_video_device_attrib* attribute;
1254 1272
1255 if (!device || !video) 1273 if (!device || !video)
1256 return -EINVAL; 1274 return -EINVAL;
@@ -1271,20 +1289,30 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1271 data->video = video; 1289 data->video = video;
1272 data->dev = device; 1290 data->dev = device;
1273 1291
1274 switch (device_id & 0xffff) { 1292 attribute = acpi_video_get_device_attr(video, device_id);
1275 case 0x0100: 1293
1276 data->flags.crt = 1; 1294 if((attribute != NULL) && attribute->device_id_scheme) {
1277 break; 1295 switch (attribute->display_type) {
1278 case 0x0400: 1296 case ACPI_VIDEO_DISPLAY_CRT:
1279 data->flags.lcd = 1; 1297 data->flags.crt = 1;
1280 break; 1298 break;
1281 case 0x0200: 1299 case ACPI_VIDEO_DISPLAY_TV:
1282 data->flags.tvout = 1; 1300 data->flags.tvout = 1;
1283 break; 1301 break;
1284 default: 1302 case ACPI_VIDEO_DISPLAY_DVI:
1303 data->flags.dvi = 1;
1304 break;
1305 case ACPI_VIDEO_DISPLAY_LCD:
1306 data->flags.lcd = 1;
1307 break;
1308 default:
1309 data->flags.unknown = 1;
1310 break;
1311 }
1312 if(attribute->bios_can_detect)
1313 data->flags.bios = 1;
1314 } else
1285 data->flags.unknown = 1; 1315 data->flags.unknown = 1;
1286 break;
1287 }
1288 1316
1289 acpi_video_device_bind(video, data); 1317 acpi_video_device_bind(video, data);
1290 acpi_video_device_find_cap(data); 1318 acpi_video_device_find_cap(data);