diff options
Diffstat (limited to 'include/power.h')
-rw-r--r-- | include/power.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/power.h b/include/power.h index cdfcbcd173..9e0c29bd1b 100644 --- a/include/power.h +++ b/include/power.h @@ -36,10 +36,26 @@ enum power_state { #endif }; +/* + * Power signal flags: + * + * +-----------------+------------------------------------+ + * | Bit # | Description | + * +------------------------------------------------------+ + * | 0 | Active level (low/high) | + * +------------------------------------------------------+ + * | 1 : 32 | Reserved | + * +-----------------+------------------------------------+ + */ + +#define POWER_SIGNAL_ACTIVE_STATE (1 << 0) +#define POWER_SIGNAL_ACTIVE_LOW (0 << 0) +#define POWER_SIGNAL_ACTIVE_HIGH (1 << 0) + /* Information on an power signal */ struct power_signal_info { enum gpio_signal gpio; /* GPIO for signal */ - int level; /* GPIO level which sets signal bit */ + uint32_t flags; /* See POWER_SIGNAL_* macros */ const char *name; /* Name of signal */ }; @@ -58,6 +74,15 @@ extern const struct power_signal_info power_signal_list[]; uint32_t power_get_signals(void); /** + * Check if provided power signal is currently asserted. + * + * @param s Power signal that needs to be checked. + * + * @return 1 if power signal is asserted, 0 otherwise. + */ +int power_signal_is_asserted(const struct power_signal_info *s); + +/** * Check for required inputs * * @param want Mask of signals which must be present (one or more |