• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/acpi/

Lines Matching refs:video

2  *  video.c - ACPI Video Driver ($Revision:$)
48 #include <acpi/video.h>
52 #define ACPI_VIDEO_CLASS "video"
70 ACPI_MODULE_NAME("video");
80 * By default, we don't allow duplicate ACPI video bus devices
98 .name = "video",
109 u8 multihead:1; /* can switch video heads */
110 u8 rom:1; /* can retrieve a video rom */
205 struct acpi_video_bus *video;
323 static void acpi_video_device_rebind(struct acpi_video_bus *video);
324 static void acpi_video_device_bind(struct acpi_video_bus *video,
326 static int acpi_video_device_enumerate(struct acpi_video_bus *video);
375 /*video output device sysfs support*/
404 struct acpi_video_device *video = acpi_driver_data(device);
406 *state = video->brightness->count - 3;
414 struct acpi_video_device *video = acpi_driver_data(device);
418 if (acpi_video_device_lcd_get_level_current(video, &level, 0))
420 for (offset = 2; offset < video->brightness->count; offset++)
421 if (level == video->brightness->levels[offset]) {
422 *state = video->brightness->count - offset - 1;
433 struct acpi_video_device *video = acpi_driver_data(device);
436 if ( state >= video->brightness->count - 2)
439 state = video->brightness->count - state;
440 level = video->brightness->levels[state -1];
441 return acpi_video_device_lcd_set_level(video, level);
687 * video : video bus device pointer
707 acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
719 video->dos_setting = arg0.integer.value;
720 acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL);
738 * device : video output device (LCD, CRT, ..)
898 * device : video output device (LCD, CRT, ..)
983 * not attempt to register video output if cooling
1023 * device : video output device (VGA)
1028 * Find out all required AML methods defined under the video bus device.
1031 static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
1035 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {
1036 video->cap._DOS = 1;
1038 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) {
1039 video->cap._DOD = 1;
1041 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) {
1042 video->cap._ROM = 1;
1044 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) {
1045 video->cap._GPD = 1;
1047 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) {
1048 video->cap._SPD = 1;
1050 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) {
1051 video->cap._VPO = 1;
1056 * Check whether the video bus device has required AML method to
1060 static int acpi_video_bus_check(struct acpi_video_bus *video)
1065 if (!video)
1068 dev = acpi_get_pci_dev(video->device->handle);
1077 /* Does this device support video switching? */
1078 if (video->cap._DOS || video->cap._DOD) {
1079 if (!video->cap._DOS) {
1082 acpi_device_bid(video->device));
1084 video->flags.multihead = 1;
1088 /* Does this device support retrieving a video ROM? */
1089 if (video->cap._ROM) {
1090 video->flags.rom = 1;
1094 /* Does this device support configuring which video device to POST? */
1095 if (video->cap._GPD && video->cap._SPD && video->cap._VPO) {
1096 video->flags.post = 1;
1110 /* video devices */
1336 vid_dev->video->dir);
1380 remove_proc_entry(acpi_device_bid(device), vid_dev->video->dir);
1390 if (!vid_dev || !vid_dev->video || !vid_dev->video->dir)
1399 remove_proc_entry(acpi_device_bid(device), vid_dev->video->dir);
1406 /* video bus */
1409 struct acpi_video_bus *video = seq->private;
1412 if (!video)
1416 video->flags.multihead ? "yes" : "no");
1418 video->flags.rom ? "yes" : "no");
1420 video->flags.post ? "yes" : "no");
1434 struct acpi_video_bus *video = seq->private;
1437 if (!video)
1453 acpi_video_bus_POST_options(struct acpi_video_bus *video,
1458 status = acpi_evaluate_integer(video->device->handle, "_VPO",
1467 struct acpi_video_bus *video = seq->private;
1472 if (!video)
1475 status = acpi_video_bus_POST_options(video, &options);
1484 seq_printf(seq, "can POST: <integrated video>");
1486 seq_printf(seq, " <PCI video>");
1488 seq_printf(seq, " <AGP video>");
1504 acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long long *id)
1508 status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id);
1515 struct acpi_video_bus *video = seq->private;
1520 if (!video)
1523 status = acpi_video_bus_get_POST(video, &id);
1536 struct acpi_video_bus *video = seq->private;
1539 seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting);
1556 acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
1566 status = acpi_evaluate_integer(video->device->handle, "_SPD",
1581 struct acpi_video_bus *video = m->private;
1586 if (!video || count >= sizeof(str))
1589 status = acpi_video_bus_POST_options(video, &options);
1605 status = acpi_video_bus_set_POST(video, opt);
1621 struct acpi_video_bus *video = m->private;
1626 if (!video || count >= sizeof(str))
1637 status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2);
1647 struct acpi_video_bus *video = acpi_driver_data(device);
1692 video->dir = acpi_device_dir(device) = device_dir;
1749 acpi_video_get_device_attr(struct acpi_video_bus *video, unsigned long device_id)
1754 for (i = 0; i < video->attached_count; i++) {
1755 ids = &video->attached_array[i];
1764 acpi_video_get_device_type(struct acpi_video_bus *video,
1770 for (i = 0; i < video->attached_count; i++) {
1771 ids = &video->attached_array[i];
1781 struct acpi_video_bus *video)
1788 if (!device || !video)
1804 data->video = video;
1807 attribute = acpi_video_get_device_attr(video, device_id);
1831 device_type = acpi_video_get_device_type(video,
1849 acpi_video_device_bind(video, data);
1866 mutex_lock(&video->device_list_lock);
1867 list_add_tail(&data->entry, &video->video_device_list);
1868 mutex_unlock(&video->device_list_lock);
1880 * video : video bus device
1885 * Enumerate the video device list of the video bus,
1886 * bind the ids with the corresponding video devices
1887 * under the video bus.
1890 static void acpi_video_device_rebind(struct acpi_video_bus *video)
1894 mutex_lock(&video->device_list_lock);
1896 list_for_each_entry(dev, &video->video_device_list, entry)
1897 acpi_video_device_bind(video, dev);
1899 mutex_unlock(&video->device_list_lock);
1904 * video : video bus device
1905 * device : video output device under the video
1911 * Bind the ids with the corresponding video devices
1912 * under the video bus.
1916 acpi_video_device_bind(struct acpi_video_bus *video,
1922 for (i = 0; i < video->attached_count; i++) {
1923 ids = &video->attached_array[i];
1933 * video : video bus device
1942 static int acpi_video_device_enumerate(struct acpi_video_bus *video)
1952 status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer);
1965 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d video heads in _DOD\n",
1993 kfree(video->attached_array);
1995 video->attached_array = active_list;
1996 video->attached_count = count;
2084 struct acpi_video_bus *video;
2093 video = acpi_driver_data(device);
2095 for (i = 0; i < video->attached_count; i++) {
2096 video_device = video->attached_array[i].bind_info;
2147 acpi_video_bus_get_devices(struct acpi_video_bus *video,
2153 acpi_video_device_enumerate(video);
2157 status = acpi_video_bus_get_one_device(dev, video);
2171 if (!device || !device->video)
2181 "Cant remove video notify handler\n");
2201 static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
2206 mutex_lock(&video->device_list_lock);
2208 list_for_each_entry_safe(dev, next, &video->video_device_list, entry) {
2213 "hhuuhhuu bug in acpi video driver.\n");
2223 mutex_unlock(&video->device_list_lock);
2230 static int acpi_video_bus_start_devices(struct acpi_video_bus *video)
2232 return acpi_video_bus_DOS(video, 0, 0);
2235 static int acpi_video_bus_stop_devices(struct acpi_video_bus *video)
2237 return acpi_video_bus_DOS(video, 0, 1);
2242 struct acpi_video_bus *video = acpi_driver_data(device);
2246 if (!video)
2249 input = video->input;
2258 case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video
2260 acpi_video_device_enumerate(video);
2261 acpi_video_device_rebind(video);
2309 bus = video_device->video;
2364 struct acpi_video_bus *video;
2375 video = container_of(nb, struct acpi_video_bus, pm_nb);
2377 dev_info(&video->device->dev, "Restoring backlight state\n");
2379 for (i = 0; i < video->attached_count; i++) {
2380 video_device = video->attached_array[i].bind_info;
2413 struct acpi_video_bus *video;
2424 "Duplicate ACPI video bus devices for the"
2426 "parameter \"video.allow_duplicates=1\""
2432 video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
2433 if (!video)
2449 video->device = device;
2452 device->driver_data = video;
2454 acpi_video_bus_find_cap(video);
2455 error = acpi_video_bus_check(video);
2463 mutex_init(&video->device_list_lock);
2464 INIT_LIST_HEAD(&video->video_device_list);
2466 acpi_video_bus_get_devices(video, device);
2467 acpi_video_bus_start_devices(video);
2469 video->input = input = input_allocate_device();
2475 snprintf(video->phys, sizeof(video->phys),
2476 "%s/video/input0", acpi_device_hid(video->device));
2478 input->name = acpi_device_name(video->device);
2479 input->phys = video->phys;
2499 video->flags.multihead ? "yes" : "no",
2500 video->flags.rom ? "yes" : "no",
2501 video->flags.post ? "yes" : "no");
2503 video->pm_nb.notifier_call = acpi_video_resume;
2504 video->pm_nb.priority = 0;
2505 register_pm_notifier(&video->pm_nb);
2512 acpi_video_bus_stop_devices(video);
2513 acpi_video_bus_put_devices(video);
2514 kfree(video->attached_array);
2517 kfree(video);
2525 struct acpi_video_bus *video = NULL;
2531 video = acpi_driver_data(device);
2533 unregister_pm_notifier(&video->pm_nb);
2535 acpi_video_bus_stop_devices(video);
2536 acpi_video_bus_put_devices(video);
2539 input_unregister_device(video->input);
2540 kfree(video->attached_array);
2541 kfree(video);
2603 * If the acpi video bus is already unloaded, don't
2622 * the video opregion code to be run first in order to initialise
2623 * state before any ACPI video calls are made. To handle this we defer
2624 * registration of the video class until the opregion code has run.