adsp_sleepmon.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef __QCOM_ADSPSLEEPMON_H__
  6. #define __QCOM_ADSPSLEEPMON_H__
  7. #include <linux/types.h>
  8. /** Device name for ADSP Sleep monitor */
  9. #define ADSPSLEEPMON_DEVICE_NAME "/dev/msm_adsp_sleepmon"
  10. /** IOCTL for intimating audio activity */
  11. #define ADSPSLEEPMON_IOCTL_AUDIO_ACTIVITY _IOWR('R', 1, struct adspsleepmon_ioctl_audio)
  12. /** IOCTL to runtime disable or re-enable panic on ADSP activity anomaly detection */
  13. #define ADSPSLEEPMON_IOCTL_CONFIGURE_PANIC _IOWR('R', 2, struct adspsleepmon_ioctl_panic)
  14. /** Version used in Audio activity IOCTL */
  15. #define ADSPSLEEPMON_IOCTL_AUDIO_VER_1 1
  16. /** Version used in Panic config IOCTL */
  17. #define ADSPSLEEPMON_IOCTL_CONFIG_PANIC_VER_1 1
  18. /** Reserved fields in the Audio activity IOCTL structure */
  19. #define ADSPSLEEPMON_IOCTL_AUDIO_NUM_RES 3
  20. enum adspsleepmon_ioctl_audio_cmd {
  21. ADSPSLEEPMON_AUDIO_ACTIVITY_START = 1,
  22. /**< Activity start of a non-LPI use case */
  23. ADSPSLEEPMON_AUDIO_ACTIVITY_STOP,
  24. /**< Activity stop of a non-LPI use case */
  25. ADSPSLEEPMON_AUDIO_ACTIVITY_LPI_START,
  26. /**< Activity start of a LPI use case */
  27. ADSPSLEEPMON_AUDIO_ACTIVITY_LPI_STOP,
  28. /**< Activity stop of a LPI use case */
  29. ADSPSLEEPMON_AUDIO_ACTIVITY_RESET,
  30. /**< Notify no ongoing activity (reset activity trackers) */
  31. ADSPSLEEPMON_AUDIO_ACTIVITY_MAX,
  32. /**< Max check for Audio ioctl audio command*/
  33. };
  34. enum adspsleepmon_ioctl_panic_cmd {
  35. ADSPSLEEPMON_DISABLE_PANIC_LPM = 1,
  36. /**< Disable panic on detecting ADSP LPM anomaly */
  37. ADSPSLEEPMON_DISABLE_PANIC_LPI,
  38. /**< Disable panic on detecting ADSP LPI anomaly */
  39. ADSPSLEEPMON_RESET_PANIC_LPM,
  40. /**< Reset panic on detecting ADSP LPM anomaly to default */
  41. ADSPSLEEPMON_RESET_PANIC_LPI,
  42. /**< Reset panic on detecting ADSP LPI anomaly to default */
  43. ADSPSLEEPMON_RESET_PANIC_MAX,
  44. /**< Max check for Audio ioctl panic command*/
  45. };
  46. /** @struct adspsleepmon_ioctl_audio
  47. * Structure to be passed in Audio activity IOCTL
  48. */
  49. struct adspsleepmon_ioctl_audio {
  50. __u32 version;
  51. /**< Version of the interface */
  52. __u32 command;
  53. /**< One of the supported commands from adspsleepmon_ioctl_audio_cmd */
  54. __u32 reserved[ADSPSLEEPMON_IOCTL_AUDIO_NUM_RES];
  55. /**< Reserved fields for future expansion */
  56. };
  57. struct adspsleepmon_ioctl_panic {
  58. __u32 version;
  59. /**< version of the interface */
  60. __u32 command;
  61. /**< One of the supported commands from adspsleepmon_ioctl_panic_cmd */
  62. };
  63. #endif /* __QCOM_ADSPSLEEPMON_H__ */