diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/acpi.h | 15 | ||||
| -rw-r--r-- | include/linux/device.h | 12 |
2 files changed, 18 insertions, 9 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index b0972c4ce81c..47369aadb1d1 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -44,6 +44,15 @@ | |||
| 44 | #include <acpi/acpi_numa.h> | 44 | #include <acpi/acpi_numa.h> |
| 45 | #include <asm/acpi.h> | 45 | #include <asm/acpi.h> |
| 46 | 46 | ||
| 47 | static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | ||
| 48 | { | ||
| 49 | return adev ? adev->handle : NULL; | ||
| 50 | } | ||
| 51 | |||
| 52 | #define ACPI_COMPANION(dev) ((dev)->acpi_node.companion) | ||
| 53 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) | ||
| 54 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) | ||
| 55 | |||
| 47 | enum acpi_irq_model_id { | 56 | enum acpi_irq_model_id { |
| 48 | ACPI_IRQ_MODEL_PIC = 0, | 57 | ACPI_IRQ_MODEL_PIC = 0, |
| 49 | ACPI_IRQ_MODEL_IOAPIC, | 58 | ACPI_IRQ_MODEL_IOAPIC, |
| @@ -401,6 +410,10 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 401 | 410 | ||
| 402 | #define acpi_disabled 1 | 411 | #define acpi_disabled 1 |
| 403 | 412 | ||
| 413 | #define ACPI_COMPANION(dev) (NULL) | ||
| 414 | #define ACPI_COMPANION_SET(dev, adev) do { } while (0) | ||
| 415 | #define ACPI_HANDLE(dev) (NULL) | ||
| 416 | |||
| 404 | static inline void acpi_early_init(void) { } | 417 | static inline void acpi_early_init(void) { } |
| 405 | 418 | ||
| 406 | static inline int early_acpi_boot_init(void) | 419 | static inline int early_acpi_boot_init(void) |
| @@ -469,6 +482,8 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 469 | 482 | ||
| 470 | #endif /* !CONFIG_ACPI */ | 483 | #endif /* !CONFIG_ACPI */ |
| 471 | 484 | ||
| 485 | #define DEVICE_ACPI_HANDLE(dev) ACPI_HANDLE(dev) | ||
| 486 | |||
| 472 | #ifdef CONFIG_ACPI | 487 | #ifdef CONFIG_ACPI |
| 473 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, | 488 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, |
| 474 | u32 pm1a_ctrl, u32 pm1b_ctrl)); | 489 | u32 pm1a_ctrl, u32 pm1b_ctrl)); |
diff --git a/include/linux/device.h b/include/linux/device.h index b025925df7f7..952b01033c32 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -644,9 +644,11 @@ struct device_dma_parameters { | |||
| 644 | unsigned long segment_boundary_mask; | 644 | unsigned long segment_boundary_mask; |
| 645 | }; | 645 | }; |
| 646 | 646 | ||
| 647 | struct acpi_device; | ||
| 648 | |||
| 647 | struct acpi_dev_node { | 649 | struct acpi_dev_node { |
| 648 | #ifdef CONFIG_ACPI | 650 | #ifdef CONFIG_ACPI |
| 649 | void *handle; | 651 | struct acpi_device *companion; |
| 650 | #endif | 652 | #endif |
| 651 | }; | 653 | }; |
| 652 | 654 | ||
| @@ -790,14 +792,6 @@ static inline struct device *kobj_to_dev(struct kobject *kobj) | |||
| 790 | return container_of(kobj, struct device, kobj); | 792 | return container_of(kobj, struct device, kobj); |
| 791 | } | 793 | } |
| 792 | 794 | ||
| 793 | #ifdef CONFIG_ACPI | ||
| 794 | #define ACPI_HANDLE(dev) ((dev)->acpi_node.handle) | ||
| 795 | #define ACPI_HANDLE_SET(dev, _handle_) (dev)->acpi_node.handle = (_handle_) | ||
| 796 | #else | ||
| 797 | #define ACPI_HANDLE(dev) (NULL) | ||
| 798 | #define ACPI_HANDLE_SET(dev, _handle_) do { } while (0) | ||
| 799 | #endif | ||
| 800 | |||
| 801 | /* Get the wakeup routines, which depend on struct device */ | 795 | /* Get the wakeup routines, which depend on struct device */ |
| 802 | #include <linux/pm_wakeup.h> | 796 | #include <linux/pm_wakeup.h> |
| 803 | 797 | ||
