aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Kconfig14
-rw-r--r--drivers/acpi/ac.c2
-rw-r--r--drivers/acpi/asus_acpi.c2
-rw-r--r--drivers/acpi/battery.c2
-rw-r--r--drivers/acpi/bus.c6
-rw-r--r--drivers/acpi/button.c2
-rw-r--r--drivers/acpi/event.c6
-rw-r--r--drivers/acpi/processor_core.c6
-rw-r--r--drivers/acpi/sbs.c2
-rw-r--r--drivers/acpi/thermal.c8
-rw-r--r--drivers/acpi/video.c10
11 files changed, 41 insertions, 19 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index f1372de4ce79..574259476fbf 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -68,6 +68,20 @@ config ACPI_PROCFS
68 68
69 Say N to delete /proc/acpi/ files that have moved to /sys/ 69 Say N to delete /proc/acpi/ files that have moved to /sys/
70 70
71config ACPI_PROC_EVENT
72 bool "Deprecated /proc/acpi/event support"
73 depends on PROC_FS
74 ---help---
75 A user-space daemon, acpi, typically read /proc/acpi/event
76 and handled all ACPI sub-system generated events.
77
78 These events are now delivered to user-space via
79 either the input layer, or as netlink events.
80
81 This build option enables the old code for for legacy
82 user-space implementation. After some time, this will
83 be moved under CONFIG_ACPI_PROCFS, and then deleted.
84
71config ACPI_AC 85config ACPI_AC
72 tristate "AC Adapter" 86 tristate "AC Adapter"
73 depends on X86 87 depends on X86
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index b53c2cfcafd3..26d70702b313 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -204,7 +204,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
204 case ACPI_NOTIFY_BUS_CHECK: 204 case ACPI_NOTIFY_BUS_CHECK:
205 case ACPI_NOTIFY_DEVICE_CHECK: 205 case ACPI_NOTIFY_DEVICE_CHECK:
206 acpi_ac_get_state(ac); 206 acpi_ac_get_state(ac);
207 acpi_bus_generate_event(device, event, (u32) ac->state); 207 acpi_bus_generate_proc_event(device, event, (u32) ac->state);
208 acpi_bus_generate_netlink_event(device->pnp.device_class, 208 acpi_bus_generate_netlink_event(device->pnp.device_class,
209 device->dev.bus_id, event, 209 device->dev.bus_id, event,
210 (u32) ac->state); 210 (u32) ac->state);
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index 86fd142f4bf3..d915fec9bf63 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1069,7 +1069,7 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
1069 hotk->brightness = (event & ~((u32) BR_DOWN)); 1069 hotk->brightness = (event & ~((u32) BR_DOWN));
1070 } 1070 }
1071 1071
1072 acpi_bus_generate_event(hotk->device, event, 1072 acpi_bus_generate_proc_event(hotk->device, event,
1073 hotk->event_count[event % 128]++); 1073 hotk->event_count[event % 128]++);
1074 1074
1075 return; 1075 return;
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 9f0bf90afdab..91dc4b316a08 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -867,7 +867,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
867 case ACPI_NOTIFY_DEVICE_CHECK: 867 case ACPI_NOTIFY_DEVICE_CHECK:
868 device = battery->device; 868 device = battery->device;
869 acpi_battery_notify_update(battery); 869 acpi_battery_notify_update(battery);
870 acpi_bus_generate_event(device, event, 870 acpi_bus_generate_proc_event(device, event,
871 acpi_battery_present(battery)); 871 acpi_battery_present(battery));
872 acpi_bus_generate_netlink_event(device->pnp.device_class, 872 acpi_bus_generate_netlink_event(device->pnp.device_class,
873 device->dev.bus_id, event, 873 device->dev.bus_id, event,
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index e5084ececb6f..9ba778a2b484 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -276,6 +276,7 @@ EXPORT_SYMBOL(acpi_bus_set_power);
276 Event Management 276 Event Management
277 -------------------------------------------------------------------------- */ 277 -------------------------------------------------------------------------- */
278 278
279#ifdef CONFIG_ACPI_PROC_EVENT
279static DEFINE_SPINLOCK(acpi_bus_event_lock); 280static DEFINE_SPINLOCK(acpi_bus_event_lock);
280 281
281LIST_HEAD(acpi_bus_event_list); 282LIST_HEAD(acpi_bus_event_list);
@@ -283,7 +284,7 @@ DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
283 284
284extern int event_is_open; 285extern int event_is_open;
285 286
286int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data) 287int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
287{ 288{
288 struct acpi_bus_event *event = NULL; 289 struct acpi_bus_event *event = NULL;
289 unsigned long flags = 0; 290 unsigned long flags = 0;
@@ -314,7 +315,7 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
314 return 0; 315 return 0;
315} 316}
316 317
317EXPORT_SYMBOL(acpi_bus_generate_event); 318EXPORT_SYMBOL(acpi_bus_generate_proc_event);
318 319
319int acpi_bus_receive_event(struct acpi_bus_event *event) 320int acpi_bus_receive_event(struct acpi_bus_event *event)
320{ 321{
@@ -360,6 +361,7 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
360} 361}
361 362
362EXPORT_SYMBOL(acpi_bus_receive_event); 363EXPORT_SYMBOL(acpi_bus_receive_event);
364#endif /* CONFIG_ACPI_PROC_EVENT */
363 365
364/* -------------------------------------------------------------------------- 366/* --------------------------------------------------------------------------
365 Notification Handling 367 Notification Handling
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 540581338ef5..2e79a3395ecf 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -284,7 +284,7 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
284 } 284 }
285 input_sync(input); 285 input_sync(input);
286 286
287 acpi_bus_generate_event(button->device, event, 287 acpi_bus_generate_proc_event(button->device, event,
288 ++button->pushed); 288 ++button->pushed);
289 break; 289 break;
290 default: 290 default:
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index b7b143288c22..cf6d5161cf31 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -17,6 +17,7 @@
17#define _COMPONENT ACPI_SYSTEM_COMPONENT 17#define _COMPONENT ACPI_SYSTEM_COMPONENT
18ACPI_MODULE_NAME("event"); 18ACPI_MODULE_NAME("event");
19 19
20#ifdef CONFIG_ACPI_PROC_EVENT
20/* Global vars for handling event proc entry */ 21/* Global vars for handling event proc entry */
21static DEFINE_SPINLOCK(acpi_system_event_lock); 22static DEFINE_SPINLOCK(acpi_system_event_lock);
22int event_is_open = 0; 23int event_is_open = 0;
@@ -106,6 +107,7 @@ static const struct file_operations acpi_system_event_ops = {
106 .release = acpi_system_close_event, 107 .release = acpi_system_close_event,
107 .poll = acpi_system_poll_event, 108 .poll = acpi_system_poll_event,
108}; 109};
110#endif /* CONFIG_ACPI_PROC_EVENT */
109 111
110#ifdef CONFIG_NET 112#ifdef CONFIG_NET
111static unsigned int acpi_event_seqnum; 113static unsigned int acpi_event_seqnum;
@@ -247,7 +249,9 @@ static int acpi_event_genetlink_init(void)
247 249
248static int __init acpi_event_init(void) 250static int __init acpi_event_init(void)
249{ 251{
252#ifdef CONFIG_ACPI_PROC_EVENT
250 struct proc_dir_entry *entry; 253 struct proc_dir_entry *entry;
254#endif
251 int error = 0; 255 int error = 0;
252 256
253 if (acpi_disabled) 257 if (acpi_disabled)
@@ -259,12 +263,14 @@ static int __init acpi_event_init(void)
259 printk(KERN_WARNING PREFIX 263 printk(KERN_WARNING PREFIX
260 "Failed to create genetlink family for ACPI event\n"); 264 "Failed to create genetlink family for ACPI event\n");
261 265
266#ifdef CONFIG_ACPI_PROC_EVENT
262 /* 'event' [R] */ 267 /* 'event' [R] */
263 entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); 268 entry = create_proc_entry("event", S_IRUSR, acpi_root_dir);
264 if (entry) 269 if (entry)
265 entry->proc_fops = &acpi_system_event_ops; 270 entry->proc_fops = &acpi_system_event_ops;
266 else 271 else
267 return -ENODEV; 272 return -ENODEV;
273#endif
268 274
269 return 0; 275 return 0;
270} 276}
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index dbc2e5d9d6a7..e944aaee4e06 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -698,7 +698,7 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
698 switch (event) { 698 switch (event) {
699 case ACPI_PROCESSOR_NOTIFY_PERFORMANCE: 699 case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
700 acpi_processor_ppc_has_changed(pr); 700 acpi_processor_ppc_has_changed(pr);
701 acpi_bus_generate_event(device, event, 701 acpi_bus_generate_proc_event(device, event,
702 pr->performance_platform_limit); 702 pr->performance_platform_limit);
703 acpi_bus_generate_netlink_event(device->pnp.device_class, 703 acpi_bus_generate_netlink_event(device->pnp.device_class,
704 device->dev.bus_id, event, 704 device->dev.bus_id, event,
@@ -706,13 +706,13 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
706 break; 706 break;
707 case ACPI_PROCESSOR_NOTIFY_POWER: 707 case ACPI_PROCESSOR_NOTIFY_POWER:
708 acpi_processor_cst_has_changed(pr); 708 acpi_processor_cst_has_changed(pr);
709 acpi_bus_generate_event(device, event, 0); 709 acpi_bus_generate_proc_event(device, event, 0);
710 acpi_bus_generate_netlink_event(device->pnp.device_class, 710 acpi_bus_generate_netlink_event(device->pnp.device_class,
711 device->dev.bus_id, event, 0); 711 device->dev.bus_id, event, 0);
712 break; 712 break;
713 case ACPI_PROCESSOR_NOTIFY_THROTTLING: 713 case ACPI_PROCESSOR_NOTIFY_THROTTLING:
714 acpi_processor_tstate_has_changed(pr); 714 acpi_processor_tstate_has_changed(pr);
715 acpi_bus_generate_event(device, event, 0); 715 acpi_bus_generate_proc_event(device, event, 0);
716 acpi_bus_generate_netlink_event(device->pnp.device_class, 716 acpi_bus_generate_netlink_event(device->pnp.device_class,
717 device->dev.bus_id, event, 0); 717 device->dev.bus_id, event, 0);
718 default: 718 default:
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 2d67e92c8ff7..a578986e3214 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -440,7 +440,7 @@ static int acpi_sbs_generate_event(struct acpi_device *device,
440 strcpy(acpi_device_bid(device), bid); 440 strcpy(acpi_device_bid(device), bid);
441 strcpy(acpi_device_class(device), class); 441 strcpy(acpi_device_class(device), class);
442 442
443 result = acpi_bus_generate_event(device, event, state); 443 result = acpi_bus_generate_proc_event(device, event, state);
444 444
445 strcpy(acpi_device_bid(device), bid_saved); 445 strcpy(acpi_device_bid(device), bid_saved);
446 strcpy(acpi_device_class(device), class_saved); 446 strcpy(acpi_device_class(device), class_saved);
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 291758c9a4d6..2c9cfe297f73 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -485,7 +485,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
485 printk(KERN_EMERG 485 printk(KERN_EMERG
486 "Critical temperature reached (%ld C), shutting down.\n", 486 "Critical temperature reached (%ld C), shutting down.\n",
487 KELVIN_TO_CELSIUS(tz->temperature)); 487 KELVIN_TO_CELSIUS(tz->temperature));
488 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 488 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
489 tz->trips.critical.flags.enabled); 489 tz->trips.critical.flags.enabled);
490 acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 490 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
491 tz->device->dev.bus_id, 491 tz->device->dev.bus_id,
@@ -508,7 +508,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
508 } else if (tz->trips.hot.flags.enabled) 508 } else if (tz->trips.hot.flags.enabled)
509 tz->trips.hot.flags.enabled = 0; 509 tz->trips.hot.flags.enabled = 0;
510 510
511 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, 511 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
512 tz->trips.hot.flags.enabled); 512 tz->trips.hot.flags.enabled);
513 acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 513 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
514 tz->device->dev.bus_id, 514 tz->device->dev.bus_id,
@@ -1157,14 +1157,14 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
1157 case ACPI_THERMAL_NOTIFY_THRESHOLDS: 1157 case ACPI_THERMAL_NOTIFY_THRESHOLDS:
1158 acpi_thermal_get_trip_points(tz); 1158 acpi_thermal_get_trip_points(tz);
1159 acpi_thermal_check(tz); 1159 acpi_thermal_check(tz);
1160 acpi_bus_generate_event(device, event, 0); 1160 acpi_bus_generate_proc_event(device, event, 0);
1161 acpi_bus_generate_netlink_event(device->pnp.device_class, 1161 acpi_bus_generate_netlink_event(device->pnp.device_class,
1162 device->dev.bus_id, event, 0); 1162 device->dev.bus_id, event, 0);
1163 break; 1163 break;
1164 case ACPI_THERMAL_NOTIFY_DEVICES: 1164 case ACPI_THERMAL_NOTIFY_DEVICES:
1165 if (tz->flags.devices) 1165 if (tz->flags.devices)
1166 acpi_thermal_get_devices(tz); 1166 acpi_thermal_get_devices(tz);
1167 acpi_bus_generate_event(device, event, 0); 1167 acpi_bus_generate_proc_event(device, event, 0);
1168 acpi_bus_generate_netlink_event(device->pnp.device_class, 1168 acpi_bus_generate_netlink_event(device->pnp.device_class,
1169 device->dev.bus_id, event, 0); 1169 device->dev.bus_id, event, 0);
1170 break; 1170 break;
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index d98701941981..9a5cfcfd8da5 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1775,7 +1775,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
1775 switch (event) { 1775 switch (event) {
1776 case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, 1776 case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch,
1777 * most likely via hotkey. */ 1777 * most likely via hotkey. */
1778 acpi_bus_generate_event(device, event, 0); 1778 acpi_bus_generate_proc_event(device, event, 0);
1779 break; 1779 break;
1780 1780
1781 case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video 1781 case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video
@@ -1783,14 +1783,14 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
1783 acpi_video_device_enumerate(video); 1783 acpi_video_device_enumerate(video);
1784 acpi_video_device_rebind(video); 1784 acpi_video_device_rebind(video);
1785 acpi_video_switch_output(video, event); 1785 acpi_video_switch_output(video, event);
1786 acpi_bus_generate_event(device, event, 0); 1786 acpi_bus_generate_proc_event(device, event, 0);
1787 break; 1787 break;
1788 1788
1789 case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */ 1789 case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */
1790 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */ 1790 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */
1791 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */ 1791 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */
1792 acpi_video_switch_output(video, event); 1792 acpi_video_switch_output(video, event);
1793 acpi_bus_generate_event(device, event, 0); 1793 acpi_bus_generate_proc_event(device, event, 0);
1794 break; 1794 break;
1795 1795
1796 default: 1796 default:
@@ -1815,7 +1815,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
1815 switch (event) { 1815 switch (event) {
1816 case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ 1816 case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */
1817 case ACPI_VIDEO_NOTIFY_PROBE: /* change in status (output device status) */ 1817 case ACPI_VIDEO_NOTIFY_PROBE: /* change in status (output device status) */
1818 acpi_bus_generate_event(device, event, 0); 1818 acpi_bus_generate_proc_event(device, event, 0);
1819 break; 1819 break;
1820 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ 1820 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */
1821 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */ 1821 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */
@@ -1823,7 +1823,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
1823 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */ 1823 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */
1824 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */ 1824 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */
1825 acpi_video_switch_brightness(video_device, event); 1825 acpi_video_switch_brightness(video_device, event);
1826 acpi_bus_generate_event(device, event, 0); 1826 acpi_bus_generate_proc_event(device, event, 0);
1827 break; 1827 break;
1828 default: 1828 default:
1829 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1829 ACPI_DEBUG_PRINT((ACPI_DB_INFO,