logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

regulator.h (2861B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Regulator uapi header
  4. *
  5. * Author: Naresh Solanki <Naresh.Solanki@9elements.com>
  6. */
  7. #ifndef _REGULATOR_H
  8. #define _REGULATOR_H
  9. #include <stdint.h>
  10. /*
  11. * Regulator notifier events.
  12. *
  13. * UNDER_VOLTAGE Regulator output is under voltage.
  14. * OVER_CURRENT Regulator output current is too high.
  15. * REGULATION_OUT Regulator output is out of regulation.
  16. * FAIL Regulator output has failed.
  17. * OVER_TEMP Regulator over temp.
  18. * FORCE_DISABLE Regulator forcibly shut down by software.
  19. * VOLTAGE_CHANGE Regulator voltage changed.
  20. * Data passed is old voltage cast to (void *).
  21. * DISABLE Regulator was disabled.
  22. * PRE_VOLTAGE_CHANGE Regulator is about to have voltage changed.
  23. * Data passed is "struct pre_voltage_change_data"
  24. * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason.
  25. * Data passed is old voltage cast to (void *).
  26. * PRE_DISABLE Regulator is about to be disabled
  27. * ABORT_DISABLE Regulator disable failed for some reason
  28. *
  29. * NOTE: These events can be OR'ed together when passed into handler.
  30. */
  31. #define REGULATOR_EVENT_UNDER_VOLTAGE 0x01
  32. #define REGULATOR_EVENT_OVER_CURRENT 0x02
  33. #define REGULATOR_EVENT_REGULATION_OUT 0x04
  34. #define REGULATOR_EVENT_FAIL 0x08
  35. #define REGULATOR_EVENT_OVER_TEMP 0x10
  36. #define REGULATOR_EVENT_FORCE_DISABLE 0x20
  37. #define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40
  38. #define REGULATOR_EVENT_DISABLE 0x80
  39. #define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100
  40. #define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200
  41. #define REGULATOR_EVENT_PRE_DISABLE 0x400
  42. #define REGULATOR_EVENT_ABORT_DISABLE 0x800
  43. #define REGULATOR_EVENT_ENABLE 0x1000
  44. /*
  45. * Following notifications should be emitted only if detected condition
  46. * is such that the HW is likely to still be working but consumers should
  47. * take a recovery action to prevent problems escalating into errors.
  48. */
  49. #define REGULATOR_EVENT_UNDER_VOLTAGE_WARN 0x2000
  50. #define REGULATOR_EVENT_OVER_CURRENT_WARN 0x4000
  51. #define REGULATOR_EVENT_OVER_VOLTAGE_WARN 0x8000
  52. #define REGULATOR_EVENT_OVER_TEMP_WARN 0x10000
  53. #define REGULATOR_EVENT_WARN_MASK 0x1E000
  54. struct reg_genl_event {
  55. char reg_name[32];
  56. uint64_t event;
  57. };
  58. /* attributes of reg_genl_family */
  59. enum {
  60. REG_GENL_ATTR_UNSPEC,
  61. REG_GENL_ATTR_EVENT, /* reg event info needed by user space */
  62. __REG_GENL_ATTR_MAX,
  63. };
  64. #define REG_GENL_ATTR_MAX (__REG_GENL_ATTR_MAX - 1)
  65. /* commands supported by the reg_genl_family */
  66. enum {
  67. REG_GENL_CMD_UNSPEC,
  68. REG_GENL_CMD_EVENT, /* kernel->user notifications for reg events */
  69. __REG_GENL_CMD_MAX,
  70. };
  71. #define REG_GENL_CMD_MAX (__REG_GENL_CMD_MAX - 1)
  72. #define REG_GENL_FAMILY_NAME "reg_event"
  73. #define REG_GENL_VERSION 0x01
  74. #define REG_GENL_MCAST_GROUP_NAME "reg_mc_group"
  75. #endif /* _REGULATOR_H */