Lines Matching refs:video
182 struct acpi_video_bus *video; member
286 static void acpi_video_device_rebind(struct acpi_video_bus *video);
287 static void acpi_video_device_bind(struct acpi_video_bus *video,
289 static int acpi_video_device_enumerate(struct acpi_video_bus *video);
364 struct acpi_video_device *video = acpi_driver_data(device); in video_get_max_state() local
366 return sprintf(buf, "%d\n", video->brightness->count - 3); in video_get_max_state()
372 struct acpi_video_device *video = acpi_driver_data(device); in video_get_cur_state() local
376 acpi_video_device_lcd_get_level_current(video, &level); in video_get_cur_state()
377 for (state = 2; state < video->brightness->count; state++) in video_get_cur_state()
378 if (level == video->brightness->levels[state]) in video_get_cur_state()
380 video->brightness->count - state - 1); in video_get_cur_state()
389 struct acpi_video_device *video = acpi_driver_data(device); in video_set_cur_state() local
392 if ( state >= video->brightness->count - 2) in video_set_cur_state()
395 state = video->brightness->count - state; in video_set_cur_state()
396 level = video->brightness->levels[state -1]; in video_set_cur_state()
397 return acpi_video_device_lcd_set_level(video, level); in video_set_cur_state()
554 acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) in acpi_video_bus_set_POST() argument
564 status = acpi_evaluate_integer(video->device->handle, "_SPD", &args, &tmp); in acpi_video_bus_set_POST()
572 acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long long *id) in acpi_video_bus_get_POST() argument
576 status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id); in acpi_video_bus_get_POST()
582 acpi_video_bus_POST_options(struct acpi_video_bus *video, in acpi_video_bus_POST_options() argument
587 status = acpi_evaluate_integer(video->device->handle, "_VPO", NULL, options); in acpi_video_bus_POST_options()
615 acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) in acpi_video_bus_DOS() argument
627 video->dos_setting = arg0.integer.value; in acpi_video_bus_DOS()
628 acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL); in acpi_video_bus_DOS()
835 static void acpi_video_bus_find_cap(struct acpi_video_bus *video) in acpi_video_bus_find_cap() argument
839 memset(&video->cap, 0, sizeof(video->cap)); in acpi_video_bus_find_cap()
840 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) { in acpi_video_bus_find_cap()
841 video->cap._DOS = 1; in acpi_video_bus_find_cap()
843 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) { in acpi_video_bus_find_cap()
844 video->cap._DOD = 1; in acpi_video_bus_find_cap()
846 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) { in acpi_video_bus_find_cap()
847 video->cap._ROM = 1; in acpi_video_bus_find_cap()
849 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) { in acpi_video_bus_find_cap()
850 video->cap._GPD = 1; in acpi_video_bus_find_cap()
852 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) { in acpi_video_bus_find_cap()
853 video->cap._SPD = 1; in acpi_video_bus_find_cap()
855 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) { in acpi_video_bus_find_cap()
856 video->cap._VPO = 1; in acpi_video_bus_find_cap()
865 static int acpi_video_bus_check(struct acpi_video_bus *video) in acpi_video_bus_check() argument
870 if (!video) in acpi_video_bus_check()
873 dev = acpi_get_physical_pci_device(video->device->handle); in acpi_video_bus_check()
883 if (video->cap._DOS) { in acpi_video_bus_check()
884 video->flags.multihead = 1; in acpi_video_bus_check()
889 if (video->cap._ROM) { in acpi_video_bus_check()
890 video->flags.rom = 1; in acpi_video_bus_check()
895 if (video->cap._GPD && video->cap._SPD && video->cap._VPO) { in acpi_video_bus_check()
896 video->flags.post = 1; in acpi_video_bus_check()
1124 vid_dev->video->dir); in acpi_video_device_add_fs()
1173 remove_proc_entry(acpi_device_bid(device), vid_dev->video->dir); in acpi_video_device_add_fs()
1183 if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) in acpi_video_device_remove_fs()
1192 remove_proc_entry(acpi_device_bid(device), vid_dev->video->dir); in acpi_video_device_remove_fs()
1202 struct acpi_video_bus *video = seq->private; in acpi_video_bus_info_seq_show() local
1205 if (!video) in acpi_video_bus_info_seq_show()
1209 video->flags.multihead ? "yes" : "no"); in acpi_video_bus_info_seq_show()
1211 video->flags.rom ? "yes" : "no"); in acpi_video_bus_info_seq_show()
1213 video->flags.post ? "yes" : "no"); in acpi_video_bus_info_seq_show()
1227 struct acpi_video_bus *video = seq->private; in acpi_video_bus_ROM_seq_show() local
1230 if (!video) in acpi_video_bus_ROM_seq_show()
1247 struct acpi_video_bus *video = seq->private; in acpi_video_bus_POST_info_seq_show() local
1252 if (!video) in acpi_video_bus_POST_info_seq_show()
1255 status = acpi_video_bus_POST_options(video, &options); in acpi_video_bus_POST_info_seq_show()
1285 struct acpi_video_bus *video = seq->private; in acpi_video_bus_POST_seq_show() local
1290 if (!video) in acpi_video_bus_POST_seq_show()
1293 status = acpi_video_bus_get_POST(video, &id); in acpi_video_bus_POST_seq_show()
1306 struct acpi_video_bus *video = seq->private; in acpi_video_bus_DOS_seq_show() local
1309 seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); in acpi_video_bus_DOS_seq_show()
1332 struct acpi_video_bus *video = m->private; in acpi_video_bus_write_POST() local
1337 if (!video || count + 1 > sizeof str) in acpi_video_bus_write_POST()
1340 status = acpi_video_bus_POST_options(video, &options); in acpi_video_bus_write_POST()
1356 status = acpi_video_bus_set_POST(video, opt); in acpi_video_bus_write_POST()
1372 struct acpi_video_bus *video = m->private; in acpi_video_bus_write_DOS() local
1377 if (!video || count + 1 > sizeof str) in acpi_video_bus_write_DOS()
1388 status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2); in acpi_video_bus_write_DOS()
1398 struct acpi_video_bus *video = acpi_driver_data(device); in acpi_video_bus_add_fs() local
1447 video->dir = acpi_device_dir(device) = device_dir; in acpi_video_bus_add_fs()
1486 acpi_video_get_device_attr(struct acpi_video_bus *video, unsigned long device_id) in acpi_video_get_device_attr() argument
1491 for (i = 0; i < video->attached_count; i++) { in acpi_video_get_device_attr()
1492 ids = &video->attached_array[i]; in acpi_video_get_device_attr()
1502 struct acpi_video_bus *video) in acpi_video_bus_get_one_device() argument
1509 if (!device || !video) in acpi_video_bus_get_one_device()
1525 data->video = video; in acpi_video_bus_get_one_device()
1528 attribute = acpi_video_get_device_attr(video, device_id); in acpi_video_bus_get_one_device()
1553 acpi_video_device_bind(video, data); in acpi_video_bus_get_one_device()
1570 mutex_lock(&video->device_list_lock); in acpi_video_bus_get_one_device()
1571 list_add_tail(&data->entry, &video->video_device_list); in acpi_video_bus_get_one_device()
1572 mutex_unlock(&video->device_list_lock); in acpi_video_bus_get_one_device()
1594 static void acpi_video_device_rebind(struct acpi_video_bus *video) in acpi_video_device_rebind() argument
1598 mutex_lock(&video->device_list_lock); in acpi_video_device_rebind()
1600 list_for_each_entry(dev, &video->video_device_list, entry) in acpi_video_device_rebind()
1601 acpi_video_device_bind(video, dev); in acpi_video_device_rebind()
1603 mutex_unlock(&video->device_list_lock); in acpi_video_device_rebind()
1620 acpi_video_device_bind(struct acpi_video_bus *video, in acpi_video_device_bind() argument
1626 for (i = 0; i < video->attached_count; i++) { in acpi_video_device_bind()
1627 ids = &video->attached_array[i]; in acpi_video_device_bind()
1646 static int acpi_video_device_enumerate(struct acpi_video_bus *video) in acpi_video_device_enumerate() argument
1656 status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer); in acpi_video_device_enumerate()
1697 kfree(video->attached_array); in acpi_video_device_enumerate()
1699 video->attached_array = active_list; in acpi_video_device_enumerate()
1700 video->attached_count = count; in acpi_video_device_enumerate()
1764 acpi_video_bus_get_devices(struct acpi_video_bus *video, in acpi_video_bus_get_devices() argument
1770 acpi_video_device_enumerate(video); in acpi_video_bus_get_devices()
1774 status = acpi_video_bus_get_one_device(dev, video); in acpi_video_bus_get_devices()
1787 struct acpi_video_bus *video; in acpi_video_bus_put_one_device() local
1790 if (!device || !device->video) in acpi_video_bus_put_one_device()
1793 video = device->video; in acpi_video_bus_put_one_device()
1814 static int acpi_video_bus_put_devices(struct acpi_video_bus *video) in acpi_video_bus_put_devices() argument
1819 mutex_lock(&video->device_list_lock); in acpi_video_bus_put_devices()
1821 list_for_each_entry_safe(dev, next, &video->video_device_list, entry) { in acpi_video_bus_put_devices()
1836 mutex_unlock(&video->device_list_lock); in acpi_video_bus_put_devices()
1843 static int acpi_video_bus_start_devices(struct acpi_video_bus *video) in acpi_video_bus_start_devices() argument
1845 return acpi_video_bus_DOS(video, 0, 0); in acpi_video_bus_start_devices()
1848 static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) in acpi_video_bus_stop_devices() argument
1850 return acpi_video_bus_DOS(video, 0, 1); in acpi_video_bus_stop_devices()
1855 struct acpi_video_bus *video = data; in acpi_video_bus_notify() local
1860 if (!video) in acpi_video_bus_notify()
1863 device = video->device; in acpi_video_bus_notify()
1864 input = video->input; in acpi_video_bus_notify()
1875 acpi_video_device_enumerate(video); in acpi_video_bus_notify()
1876 acpi_video_device_rebind(video); in acpi_video_bus_notify()
1922 bus = video_device->video; in acpi_video_device_notify()
1975 struct acpi_video_bus *video; in acpi_video_resume() local
1982 video = acpi_driver_data(device); in acpi_video_resume()
1984 for (i = 0; i < video->attached_count; i++) { in acpi_video_resume()
1985 video_device = video->attached_array[i].bind_info; in acpi_video_resume()
1995 struct acpi_video_bus *video; in acpi_video_bus_add() local
1999 video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); in acpi_video_bus_add()
2000 if (!video) in acpi_video_bus_add()
2016 video->device = device; in acpi_video_bus_add()
2019 device->driver_data = video; in acpi_video_bus_add()
2021 acpi_video_bus_find_cap(video); in acpi_video_bus_add()
2022 error = acpi_video_bus_check(video); in acpi_video_bus_add()
2030 mutex_init(&video->device_list_lock); in acpi_video_bus_add()
2031 INIT_LIST_HEAD(&video->video_device_list); in acpi_video_bus_add()
2033 acpi_video_bus_get_devices(video, device); in acpi_video_bus_add()
2034 acpi_video_bus_start_devices(video); in acpi_video_bus_add()
2038 acpi_video_bus_notify, video); in acpi_video_bus_add()
2046 video->input = input = input_allocate_device(); in acpi_video_bus_add()
2052 snprintf(video->phys, sizeof(video->phys), in acpi_video_bus_add()
2053 "%s/video/input0", acpi_device_hid(video->device)); in acpi_video_bus_add()
2055 input->name = acpi_device_name(video->device); in acpi_video_bus_add()
2056 input->phys = video->phys; in acpi_video_bus_add()
2077 video->flags.multihead ? "yes" : "no", in acpi_video_bus_add()
2078 video->flags.rom ? "yes" : "no", in acpi_video_bus_add()
2079 video->flags.post ? "yes" : "no"); in acpi_video_bus_add()
2089 acpi_video_bus_stop_devices(video); in acpi_video_bus_add()
2090 acpi_video_bus_put_devices(video); in acpi_video_bus_add()
2091 kfree(video->attached_array); in acpi_video_bus_add()
2094 kfree(video); in acpi_video_bus_add()
2103 struct acpi_video_bus *video = NULL; in acpi_video_bus_remove() local
2109 video = acpi_driver_data(device); in acpi_video_bus_remove()
2111 acpi_video_bus_stop_devices(video); in acpi_video_bus_remove()
2113 status = acpi_remove_notify_handler(video->device->handle, in acpi_video_bus_remove()
2117 acpi_video_bus_put_devices(video); in acpi_video_bus_remove()
2120 input_unregister_device(video->input); in acpi_video_bus_remove()
2121 kfree(video->attached_array); in acpi_video_bus_remove()
2122 kfree(video); in acpi_video_bus_remove()