button.h 621 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef ACPI_BUTTON_H
  3. #define ACPI_BUTTON_H
  4. #include <linux/notifier.h>
  5. #if IS_ENABLED(CONFIG_ACPI_BUTTON)
  6. extern int acpi_lid_notifier_register(struct notifier_block *nb);
  7. extern int acpi_lid_notifier_unregister(struct notifier_block *nb);
  8. extern int acpi_lid_open(void);
  9. #else
  10. static inline int acpi_lid_notifier_register(struct notifier_block *nb)
  11. {
  12. return 0;
  13. }
  14. static inline int acpi_lid_notifier_unregister(struct notifier_block *nb)
  15. {
  16. return 0;
  17. }
  18. static inline int acpi_lid_open(void)
  19. {
  20. return 1;
  21. }
  22. #endif /* IS_ENABLED(CONFIG_ACPI_BUTTON) */
  23. #endif /* ACPI_BUTTON_H */