silent_mode.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef PM_SILENT_MODE_H
  6. #define PM_SILENT_MODE_H
  7. #include <linux/atomic.h>
  8. #include <linux/errno.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/module.h>
  11. #include <linux/notifier.h>
  12. /* Silent Modes */
  13. enum silent_boot_mode {
  14. MODE_NON_SILENT = 1,
  15. MODE_SILENT,
  16. };
  17. enum silent_boot_mode_gpio {
  18. MODE_GPIO_LOW = 0,
  19. MODE_GPIO_HIGH,
  20. };
  21. /* External Modes */
  22. enum silent_mode_cpms_mode {
  23. USERSPACE_CONTROL_DISABLED = 0,
  24. USERSPACE_CONTROL_ENABLED,
  25. };
  26. /*
  27. * External functions to get and set the silent mode state
  28. * Cannot be accessed from User space
  29. */
  30. extern int pm_silentmode_hw_state_get(void);
  31. extern int pm_silentmode_update(int val, struct kobject *kobj, bool us);
  32. extern int pm_silentmode_status(void);
  33. extern int register_pm_silentmode_notifier(struct notifier_block *nb);
  34. extern int unregister_pm_silentmode_notifier(struct notifier_block *nb);
  35. extern int pm_silentmode_get_mode(void);
  36. #endif /*PM_SILENT_MODE*/