~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/acpi/button.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <linux/proc_fs.h>
31
31
#include <linux/seq_file.h>
32
32
#include <linux/input.h>
 
33
#include <linux/slab.h>
33
34
#include <acpi/acpi_bus.h>
34
35
#include <acpi/acpi_drivers.h>
35
36
 
278
279
        input_report_switch(button->input, SW_LID, !state);
279
280
        input_sync(button->input);
280
281
 
 
282
        if (state)
 
283
                pm_wakeup_event(&device->dev, 0);
 
284
 
281
285
        ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device);
282
286
        if (ret == NOTIFY_DONE)
283
287
                ret = blocking_notifier_call_chain(&acpi_lid_notifier, state,
284
288
                                                   device);
 
289
        if (ret == NOTIFY_DONE || ret == NOTIFY_OK) {
 
290
                /*
 
291
                 * It is also regarded as success if the notifier_chain
 
292
                 * returns NOTIFY_OK or NOTIFY_DONE.
 
293
                 */
 
294
                ret = 0;
 
295
        }
285
296
        return ret;
286
297
}
287
298
 
306
317
                        input_sync(input);
307
318
                        input_report_key(input, keycode, 0);
308
319
                        input_sync(input);
 
320
 
 
321
                        pm_wakeup_event(&device->dev, 0);
309
322
                }
310
323
 
311
324
                acpi_bus_generate_proc_event(device, event, ++button->pushed);
330
343
{
331
344
        struct acpi_button *button;
332
345
        struct input_dev *input;
333
 
        char *hid, *name, *class;
 
346
        const char *hid = acpi_device_hid(device);
 
347
        char *name, *class;
334
348
        int error;
335
349
 
336
350
        button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL);
345
359
                goto err_free_button;
346
360
        }
347
361
 
348
 
        hid = acpi_device_hid(device);
349
362
        name = acpi_device_name(device);
350
363
        class = acpi_device_class(device);
351
364
 
415
428
 
416
429
        if (device->wakeup.flags.valid) {
417
430
                /* Button's GPE is run-wake GPE */
418
 
                acpi_set_gpe_type(device->wakeup.gpe_device,
419
 
                                  device->wakeup.gpe_number,
420
 
                                  ACPI_GPE_TYPE_WAKE_RUN);
421
431
                acpi_enable_gpe(device->wakeup.gpe_device,
422
432
                                device->wakeup.gpe_number);
423
 
                device->wakeup.state.enabled = 1;
 
433
                device->wakeup.run_wake_count++;
 
434
                device_set_wakeup_enable(&device->dev, true);
424
435
        }
425
436
 
426
437
        printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));
439
450
{
440
451
        struct acpi_button *button = acpi_driver_data(device);
441
452
 
 
453
        if (device->wakeup.flags.valid) {
 
454
                acpi_disable_gpe(device->wakeup.gpe_device,
 
455
                                device->wakeup.gpe_number);
 
456
                device->wakeup.run_wake_count--;
 
457
                device_set_wakeup_enable(&device->dev, false);
 
458
        }
 
459
 
442
460
        acpi_button_remove_fs(device);
443
461
        input_unregister_device(button->input);
444
462
        kfree(button);