ACPI video: make procfs I/F depend on CONFIG_ACPI_PROCFS

Mark ACPI video driver procfs I/F deprecated, including:
/proc/acpi/video/*/info
/proc/acpi/video/*/DOS
/proc/acpi/video/*/ROM
/proc/acpi/video/*/POST
/proc/acpi/video/*/POST_info
/proc/acpi/video/*/*/info
/proc/acpi/video/*/*/state
/proc/acpi/video/*/*/EDID
and
/proc/acpi/video/*/*/brightness, because
1. we already have the sysfs I/F /sysclass/backlight/ as the replacement
of /proc/acpi/video/*/*/brightness.
2. the other procfs I/F is not useful for userspace.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by Zhang Rui and committed by Len Brown 6e37c658 d09fe555

+82 -50
+1
drivers/acpi/Kconfig
··· 56 57 /proc/acpi/processor/*/throttling (/sys/class/thermal/ 58 cooling_device*/*) 59 This option has no effect on /proc/acpi/ files 60 and functions which do not yet exist in /sys. 61
··· 56 57 /proc/acpi/processor/*/throttling (/sys/class/thermal/ 58 cooling_device*/*) 59 + /proc/acpi/video/*/brightness (/sys/class/backlight/) 60 This option has no effect on /proc/acpi/ files 61 and functions which do not yet exist in /sys. 62
+81 -50
drivers/acpi/video.c
··· 152 struct acpi_video_bus_flags flags; 153 struct list_head video_device_list; 154 struct mutex device_list_lock; /* protects video_device_list */ 155 struct proc_dir_entry *dir; 156 struct input_dev *input; 157 char phys[32]; /* for input device */ 158 struct notifier_block pm_nb; ··· 210 struct output_device *output_dev; 211 }; 212 213 /* bus */ 214 static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file); 215 static const struct file_operations acpi_video_bus_info_fops = { ··· 310 .llseek = seq_lseek, 311 .release = single_release, 312 }; 313 314 static const char device_decode[][30] = { 315 "motherboard VGA device", ··· 452 -------------------------------------------------------------------------- */ 453 454 /* device */ 455 - 456 - static int 457 - acpi_video_device_query(struct acpi_video_device *device, unsigned long long *state) 458 - { 459 - int status; 460 - 461 - status = acpi_evaluate_integer(device->dev->handle, "_DGS", NULL, state); 462 - 463 - return status; 464 - } 465 466 static int 467 acpi_video_device_get_state(struct acpi_video_device *device, ··· 691 } 692 693 /* bus */ 694 - 695 - static int 696 - acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) 697 - { 698 - int status; 699 - unsigned long long tmp; 700 - union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 701 - struct acpi_object_list args = { 1, &arg0 }; 702 - 703 - 704 - arg0.integer.value = option; 705 - 706 - status = acpi_evaluate_integer(video->device->handle, "_SPD", &args, &tmp); 707 - if (ACPI_SUCCESS(status)) 708 - status = tmp ? (-EINVAL) : (AE_OK); 709 - 710 - return status; 711 - } 712 - 713 - static int 714 - acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long long *id) 715 - { 716 - int status; 717 - 718 - status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id); 719 - 720 - return status; 721 - } 722 - 723 - static int 724 - acpi_video_bus_POST_options(struct acpi_video_bus *video, 725 - unsigned long long *options) 726 - { 727 - int status; 728 - 729 - status = acpi_evaluate_integer(video->device->handle, "_VPO", NULL, options); 730 - *options &= 3; 731 - 732 - return status; 733 - } 734 735 /* 736 * Arg: ··· 1113 /* -------------------------------------------------------------------------- 1114 FS Interface (/proc) 1115 -------------------------------------------------------------------------- */ 1116 1117 static struct proc_dir_entry *acpi_video_dir; 1118 ··· 1151 { 1152 return single_open(file, acpi_video_device_info_seq_show, 1153 PDE(inode)->data); 1154 } 1155 1156 static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) ··· 1459 return single_open(file, acpi_video_bus_ROM_seq_show, PDE(inode)->data); 1460 } 1461 1462 static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) 1463 { 1464 struct acpi_video_bus *video = seq->private; ··· 1508 { 1509 return single_open(file, acpi_video_bus_POST_info_seq_show, 1510 PDE(inode)->data); 1511 } 1512 1513 static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) ··· 1560 static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file) 1561 { 1562 return single_open(file, acpi_video_bus_DOS_seq_show, PDE(inode)->data); 1563 } 1564 1565 static ssize_t ··· 1731 1732 return 0; 1733 } 1734 1735 /* -------------------------------------------------------------------------- 1736 Driver Interface ··· 2584 return 0; 2585 } 2586 2587 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); 2588 if (!acpi_video_dir) 2589 return -ENODEV; 2590 2591 result = acpi_bus_register_driver(&acpi_video_bus); 2592 if (result < 0) { ··· 2617 } 2618 acpi_bus_unregister_driver(&acpi_video_bus); 2619 2620 remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); 2621 2622 register_count = 0; 2623
··· 152 struct acpi_video_bus_flags flags; 153 struct list_head video_device_list; 154 struct mutex device_list_lock; /* protects video_device_list */ 155 + #ifdef CONFIG_ACPI_PROCFS 156 struct proc_dir_entry *dir; 157 + #endif 158 struct input_dev *input; 159 char phys[32]; /* for input device */ 160 struct notifier_block pm_nb; ··· 208 struct output_device *output_dev; 209 }; 210 211 + #ifdef CONFIG_ACPI_PROCFS 212 /* bus */ 213 static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file); 214 static const struct file_operations acpi_video_bus_info_fops = { ··· 307 .llseek = seq_lseek, 308 .release = single_release, 309 }; 310 + #endif /* CONFIG_ACPI_PROCFS */ 311 312 static const char device_decode[][30] = { 313 "motherboard VGA device", ··· 448 -------------------------------------------------------------------------- */ 449 450 /* device */ 451 452 static int 453 acpi_video_device_get_state(struct acpi_video_device *device, ··· 697 } 698 699 /* bus */ 700 701 /* 702 * Arg: ··· 1159 /* -------------------------------------------------------------------------- 1160 FS Interface (/proc) 1161 -------------------------------------------------------------------------- */ 1162 + #ifdef CONFIG_ACPI_PROCFS 1163 1164 static struct proc_dir_entry *acpi_video_dir; 1165 ··· 1196 { 1197 return single_open(file, acpi_video_device_info_seq_show, 1198 PDE(inode)->data); 1199 + } 1200 + 1201 + static int 1202 + acpi_video_device_query(struct acpi_video_device *device, 1203 + unsigned long long *state) 1204 + { 1205 + int status; 1206 + 1207 + status = acpi_evaluate_integer(device->dev->handle, "_DGS", 1208 + NULL, state); 1209 + 1210 + return status; 1211 } 1212 1213 static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) ··· 1492 return single_open(file, acpi_video_bus_ROM_seq_show, PDE(inode)->data); 1493 } 1494 1495 + static int 1496 + acpi_video_bus_POST_options(struct acpi_video_bus *video, 1497 + unsigned long long *options) 1498 + { 1499 + int status; 1500 + 1501 + status = acpi_evaluate_integer(video->device->handle, "_VPO", 1502 + NULL, options); 1503 + *options &= 3; 1504 + 1505 + return status; 1506 + } 1507 + 1508 static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) 1509 { 1510 struct acpi_video_bus *video = seq->private; ··· 1528 { 1529 return single_open(file, acpi_video_bus_POST_info_seq_show, 1530 PDE(inode)->data); 1531 + } 1532 + 1533 + static int 1534 + acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long long *id) 1535 + { 1536 + int status; 1537 + 1538 + status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id); 1539 + 1540 + return status; 1541 } 1542 1543 static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) ··· 1570 static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file) 1571 { 1572 return single_open(file, acpi_video_bus_DOS_seq_show, PDE(inode)->data); 1573 + } 1574 + 1575 + static int 1576 + acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) 1577 + { 1578 + int status; 1579 + unsigned long long tmp; 1580 + union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 1581 + struct acpi_object_list args = { 1, &arg0 }; 1582 + 1583 + 1584 + arg0.integer.value = option; 1585 + 1586 + status = acpi_evaluate_integer(video->device->handle, "_SPD", 1587 + &args, &tmp); 1588 + if (ACPI_SUCCESS(status)) 1589 + status = tmp ? (-EINVAL) : (AE_OK); 1590 + 1591 + return status; 1592 } 1593 1594 static ssize_t ··· 1722 1723 return 0; 1724 } 1725 + #else 1726 + static inline int acpi_video_device_add_fs(struct acpi_device *device) 1727 + { 1728 + return 0; 1729 + } 1730 + static inline int acpi_video_device_remove_fs(struct acpi_device *device) 1731 + { 1732 + return 0; 1733 + } 1734 + static inline int acpi_video_bus_add_fs(struct acpi_device *device) 1735 + { 1736 + return 0; 1737 + } 1738 + static inline int acpi_video_bus_remove_fs(struct acpi_device *device) 1739 + { 1740 + return 0; 1741 + } 1742 + #endif /* CONFIG_ACPI_PROCFS */ 1743 1744 /* -------------------------------------------------------------------------- 1745 Driver Interface ··· 2557 return 0; 2558 } 2559 2560 + #ifdef CONFIG_ACPI_PROCFS 2561 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); 2562 if (!acpi_video_dir) 2563 return -ENODEV; 2564 + #endif 2565 2566 result = acpi_bus_register_driver(&acpi_video_bus); 2567 if (result < 0) { ··· 2588 } 2589 acpi_bus_unregister_driver(&acpi_video_bus); 2590 2591 + #ifdef CONFIG_ACPI_PROCFS 2592 remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); 2593 + #endif 2594 2595 register_count = 0; 2596