Skip to content

Commit 1696d9d

Browse files
watologo1rafaeljw
authored andcommitted
ACPI: Remove the old /proc/acpi/event interface
It is quite some time that this one has been deprecated. Get rid of it. Should some really important user be overseen, it may be reverted and the userspace program worked on first, but it is time to do something to get rid of this old stuff... Signed-off-by: Thomas Renninger <[email protected]> Acked-by: Matthew Garrett <[email protected]> Acked-by: Henrique de Moraes Holschuh <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ad81f05 commit 1696d9d

22 files changed

+10
-305
lines changed

Documentation/laptops/asus-laptop.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ http://acpi4asus.sf.net/
88

99
This driver provides support for extra features of ACPI-compatible ASUS laptops.
1010
It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or
11-
VICTOR XP7210 for example). It makes all the extra buttons generate standard
12-
ACPI events that go through /proc/acpi/events and input events (like keyboards).
11+
VICTOR XP7210 for example). It makes all the extra buttons generate input
12+
events (like keyboards).
1313
On some models adds support for changing the display brightness and output,
1414
switching the LCD backlight on and off, and most importantly, allows you to
1515
blink those fancy LEDs intended for reporting mail and wireless status.
@@ -55,8 +55,8 @@ Usage
5555
DSDT) to me.
5656

5757
That's all, now, all the events generated by the hotkeys of your laptop
58-
should be reported in your /proc/acpi/event entry. You can check with
59-
"acpi_listen".
58+
should be reported via netlink events. You can check with
59+
"acpi_genl monitor" (part of the acpica project).
6060

6161
Hotkeys are also reported as input keys (like keyboards) you can check
6262
which key are supported using "xev" under X11.

Documentation/laptops/sony-laptop.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Fn keys (hotkeys):
1212
------------------
1313
Some models report hotkeys through the SNC or SPIC devices, such events are
1414
reported both through the ACPI subsystem as acpi events and through the INPUT
15-
subsystem. See the logs of acpid or /proc/acpi/event and
16-
/proc/bus/input/devices to find out what those events are and which input
17-
devices are created by the driver. Additionally, loading the driver with the
18-
debug option will report all events in the kernel log.
15+
subsystem. See the logs of /proc/bus/input/devices to find out what those
16+
events are and which input devices are created by the driver.
17+
Additionally, loading the driver with the debug option will report all events
18+
in the kernel log.
1919

2020
The "scancodes" passed to the input system (that can be remapped with udev)
2121
are indexes to the table "sony_laptop_input_keycode_map" in the sony-laptop.c

drivers/acpi/Kconfig

-18
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,6 @@ config ACPI_EC_DEBUGFS
9191
Thus this option is a debug option that helps to write ACPI drivers
9292
and can be used to identify ACPI code or EC firmware bugs.
9393

94-
config ACPI_PROC_EVENT
95-
bool "Deprecated /proc/acpi/event support"
96-
depends on PROC_FS
97-
default y
98-
help
99-
A user-space daemon, acpid, typically reads /proc/acpi/event
100-
and handles all ACPI-generated events.
101-
102-
These events are now delivered to user-space either
103-
via the input layer or as netlink events.
104-
105-
This build option enables the old code for legacy
106-
user-space implementation. After some time, this will
107-
be moved under CONFIG_ACPI_PROCFS, and then deleted.
108-
109-
Say Y here to retain the old behaviour. Say N if your
110-
user-space is newer than kernel 2.6.23 (September 2007).
111-
11294
config ACPI_AC
11395
tristate "AC Adapter"
11496
depends on X86

drivers/acpi/ac.c

-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
267267
msleep(ac_sleep_before_get_state_ms);
268268

269269
acpi_ac_get_state(ac);
270-
acpi_bus_generate_proc_event(device, event, (u32) ac->state);
271270
acpi_bus_generate_netlink_event(device->pnp.device_class,
272271
dev_name(&device->dev), event,
273272
(u32) ac->state);

drivers/acpi/acpi_pad.c

-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ static void acpi_pad_notify(acpi_handle handle, u32 event,
452452
switch (event) {
453453
case ACPI_PROCESSOR_AGGREGATOR_NOTIFY:
454454
acpi_pad_handle_notify(handle);
455-
acpi_bus_generate_proc_event(device, event, 0);
456455
acpi_bus_generate_netlink_event(device->pnp.device_class,
457456
dev_name(&device->dev), event, 0);
458457
break;

drivers/acpi/battery.c

-2
Original file line numberDiff line numberDiff line change
@@ -1034,8 +1034,6 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
10341034
if (event == ACPI_BATTERY_NOTIFY_INFO)
10351035
acpi_battery_refresh(battery);
10361036
acpi_battery_update(battery);
1037-
acpi_bus_generate_proc_event(device, event,
1038-
acpi_battery_present(battery));
10391037
acpi_bus_generate_netlink_event(device->pnp.device_class,
10401038
dev_name(&device->dev), event,
10411039
acpi_battery_present(battery));

drivers/acpi/bus.c

-98
Original file line numberDiff line numberDiff line change
@@ -345,104 +345,6 @@ static void acpi_bus_osc_support(void)
345345
/* do we need to check other returned cap? Sounds no */
346346
}
347347

348-
/* --------------------------------------------------------------------------
349-
Event Management
350-
-------------------------------------------------------------------------- */
351-
352-
#ifdef CONFIG_ACPI_PROC_EVENT
353-
static DEFINE_SPINLOCK(acpi_bus_event_lock);
354-
355-
LIST_HEAD(acpi_bus_event_list);
356-
DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
357-
358-
extern int event_is_open;
359-
360-
int acpi_bus_generate_proc_event4(const char *device_class, const char *bus_id, u8 type, int data)
361-
{
362-
struct acpi_bus_event *event;
363-
unsigned long flags;
364-
365-
/* drop event on the floor if no one's listening */
366-
if (!event_is_open)
367-
return 0;
368-
369-
event = kzalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
370-
if (!event)
371-
return -ENOMEM;
372-
373-
strcpy(event->device_class, device_class);
374-
strcpy(event->bus_id, bus_id);
375-
event->type = type;
376-
event->data = data;
377-
378-
spin_lock_irqsave(&acpi_bus_event_lock, flags);
379-
list_add_tail(&event->node, &acpi_bus_event_list);
380-
spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
381-
382-
wake_up_interruptible(&acpi_bus_event_queue);
383-
384-
return 0;
385-
386-
}
387-
388-
EXPORT_SYMBOL_GPL(acpi_bus_generate_proc_event4);
389-
390-
int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
391-
{
392-
if (!device)
393-
return -EINVAL;
394-
return acpi_bus_generate_proc_event4(device->pnp.device_class,
395-
device->pnp.bus_id, type, data);
396-
}
397-
398-
EXPORT_SYMBOL(acpi_bus_generate_proc_event);
399-
400-
int acpi_bus_receive_event(struct acpi_bus_event *event)
401-
{
402-
unsigned long flags;
403-
struct acpi_bus_event *entry = NULL;
404-
405-
DECLARE_WAITQUEUE(wait, current);
406-
407-
408-
if (!event)
409-
return -EINVAL;
410-
411-
if (list_empty(&acpi_bus_event_list)) {
412-
413-
set_current_state(TASK_INTERRUPTIBLE);
414-
add_wait_queue(&acpi_bus_event_queue, &wait);
415-
416-
if (list_empty(&acpi_bus_event_list))
417-
schedule();
418-
419-
remove_wait_queue(&acpi_bus_event_queue, &wait);
420-
set_current_state(TASK_RUNNING);
421-
422-
if (signal_pending(current))
423-
return -ERESTARTSYS;
424-
}
425-
426-
spin_lock_irqsave(&acpi_bus_event_lock, flags);
427-
if (!list_empty(&acpi_bus_event_list)) {
428-
entry = list_entry(acpi_bus_event_list.next,
429-
struct acpi_bus_event, node);
430-
list_del(&entry->node);
431-
}
432-
spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
433-
434-
if (!entry)
435-
return -ENODEV;
436-
437-
memcpy(event, entry, sizeof(struct acpi_bus_event));
438-
439-
kfree(entry);
440-
441-
return 0;
442-
}
443-
444-
#endif /* CONFIG_ACPI_PROC_EVENT */
445-
446348
/* --------------------------------------------------------------------------
447349
Notification Handling
448350
-------------------------------------------------------------------------- */

drivers/acpi/button.c

-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,6 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
303303

304304
pm_wakeup_event(&device->dev, 0);
305305
}
306-
307-
acpi_bus_generate_proc_event(device, event, ++button->pushed);
308306
break;
309307
default:
310308
ACPI_DEBUG_PRINT((ACPI_DB_INFO,

drivers/acpi/event.c

-106
Original file line numberDiff line numberDiff line change
@@ -21,100 +21,6 @@
2121
#define _COMPONENT ACPI_SYSTEM_COMPONENT
2222
ACPI_MODULE_NAME("event");
2323

24-
#ifdef CONFIG_ACPI_PROC_EVENT
25-
/* Global vars for handling event proc entry */
26-
static DEFINE_SPINLOCK(acpi_system_event_lock);
27-
int event_is_open = 0;
28-
extern struct list_head acpi_bus_event_list;
29-
extern wait_queue_head_t acpi_bus_event_queue;
30-
31-
static int acpi_system_open_event(struct inode *inode, struct file *file)
32-
{
33-
spin_lock_irq(&acpi_system_event_lock);
34-
35-
if (event_is_open)
36-
goto out_busy;
37-
38-
event_is_open = 1;
39-
40-
spin_unlock_irq(&acpi_system_event_lock);
41-
return 0;
42-
43-
out_busy:
44-
spin_unlock_irq(&acpi_system_event_lock);
45-
return -EBUSY;
46-
}
47-
48-
static ssize_t
49-
acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
50-
loff_t * ppos)
51-
{
52-
int result = 0;
53-
struct acpi_bus_event event;
54-
static char str[ACPI_MAX_STRING];
55-
static int chars_remaining = 0;
56-
static char *ptr;
57-
58-
if (!chars_remaining) {
59-
memset(&event, 0, sizeof(struct acpi_bus_event));
60-
61-
if ((file->f_flags & O_NONBLOCK)
62-
&& (list_empty(&acpi_bus_event_list)))
63-
return -EAGAIN;
64-
65-
result = acpi_bus_receive_event(&event);
66-
if (result)
67-
return result;
68-
69-
chars_remaining = sprintf(str, "%s %s %08x %08x\n",
70-
event.device_class ? event.
71-
device_class : "<unknown>",
72-
event.bus_id ? event.
73-
bus_id : "<unknown>", event.type,
74-
event.data);
75-
ptr = str;
76-
}
77-
78-
if (chars_remaining < count) {
79-
count = chars_remaining;
80-
}
81-
82-
if (copy_to_user(buffer, ptr, count))
83-
return -EFAULT;
84-
85-
*ppos += count;
86-
chars_remaining -= count;
87-
ptr += count;
88-
89-
return count;
90-
}
91-
92-
static int acpi_system_close_event(struct inode *inode, struct file *file)
93-
{
94-
spin_lock_irq(&acpi_system_event_lock);
95-
event_is_open = 0;
96-
spin_unlock_irq(&acpi_system_event_lock);
97-
return 0;
98-
}
99-
100-
static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait)
101-
{
102-
poll_wait(file, &acpi_bus_event_queue, wait);
103-
if (!list_empty(&acpi_bus_event_list))
104-
return POLLIN | POLLRDNORM;
105-
return 0;
106-
}
107-
108-
static const struct file_operations acpi_system_event_ops = {
109-
.owner = THIS_MODULE,
110-
.open = acpi_system_open_event,
111-
.read = acpi_system_read_event,
112-
.release = acpi_system_close_event,
113-
.poll = acpi_system_poll_event,
114-
.llseek = default_llseek,
115-
};
116-
#endif /* CONFIG_ACPI_PROC_EVENT */
117-
11824
/* ACPI notifier chain */
11925
static BLOCKING_NOTIFIER_HEAD(acpi_chain_head);
12026

@@ -280,9 +186,6 @@ static int acpi_event_genetlink_init(void)
280186

281187
static int __init acpi_event_init(void)
282188
{
283-
#ifdef CONFIG_ACPI_PROC_EVENT
284-
struct proc_dir_entry *entry;
285-
#endif
286189
int error = 0;
287190

288191
if (acpi_disabled)
@@ -293,15 +196,6 @@ static int __init acpi_event_init(void)
293196
if (error)
294197
printk(KERN_WARNING PREFIX
295198
"Failed to create genetlink family for ACPI event\n");
296-
297-
#ifdef CONFIG_ACPI_PROC_EVENT
298-
/* 'event' [R] */
299-
entry = proc_create("event", S_IRUSR, acpi_root_dir,
300-
&acpi_system_event_ops);
301-
if (!entry)
302-
return -ENODEV;
303-
#endif
304-
305199
return 0;
306200
}
307201

drivers/acpi/processor_driver.c

-4
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,17 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
9191
acpi_processor_ppc_has_changed(pr, 1);
9292
if (saved == pr->performance_platform_limit)
9393
break;
94-
acpi_bus_generate_proc_event(device, event,
95-
pr->performance_platform_limit);
9694
acpi_bus_generate_netlink_event(device->pnp.device_class,
9795
dev_name(&device->dev), event,
9896
pr->performance_platform_limit);
9997
break;
10098
case ACPI_PROCESSOR_NOTIFY_POWER:
10199
acpi_processor_cst_has_changed(pr);
102-
acpi_bus_generate_proc_event(device, event, 0);
103100
acpi_bus_generate_netlink_event(device->pnp.device_class,
104101
dev_name(&device->dev), event, 0);
105102
break;
106103
case ACPI_PROCESSOR_NOTIFY_THROTTLING:
107104
acpi_processor_tstate_has_changed(pr);
108-
acpi_bus_generate_proc_event(device, event, 0);
109105
acpi_bus_generate_netlink_event(device->pnp.device_class,
110106
dev_name(&device->dev), event, 0);
111107
break;

drivers/acpi/sbs.c

+2-13
Original file line numberDiff line numberDiff line change
@@ -873,14 +873,9 @@ static void acpi_sbs_callback(void *context)
873873
u8 saved_charger_state = sbs->charger_present;
874874
u8 saved_battery_state;
875875
acpi_ac_get_present(sbs);
876-
if (sbs->charger_present != saved_charger_state) {
877-
#ifdef CONFIG_ACPI_PROC_EVENT
878-
acpi_bus_generate_proc_event4(ACPI_AC_CLASS, ACPI_AC_DIR_NAME,
879-
ACPI_SBS_NOTIFY_STATUS,
880-
sbs->charger_present);
881-
#endif
876+
if (sbs->charger_present != saved_charger_state)
882877
kobject_uevent(&sbs->charger.dev->kobj, KOBJ_CHANGE);
883-
}
878+
884879
if (sbs->manager_present) {
885880
for (id = 0; id < MAX_SBS_BAT; ++id) {
886881
if (!(sbs->batteries_supported & (1 << id)))
@@ -890,12 +885,6 @@ static void acpi_sbs_callback(void *context)
890885
acpi_battery_read(bat);
891886
if (saved_battery_state == bat->present)
892887
continue;
893-
#ifdef CONFIG_ACPI_PROC_EVENT
894-
acpi_bus_generate_proc_event4(ACPI_BATTERY_CLASS,
895-
bat->name,
896-
ACPI_SBS_NOTIFY_STATUS,
897-
bat->present);
898-
#endif
899888
kobject_uevent(&bat->bat.dev->kobj, KOBJ_CHANGE);
900889
}
901890
}

0 commit comments

Comments
 (0)