/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Regulator uapi header * * Author: Naresh Solanki <[email protected]> */ #ifndef _UAPI_REGULATOR_H #define _UAPI_REGULATOR_H #ifdef __KERNEL__ #include <linux/types.h> #else #include <stdint.h> #endif /* * Regulator notifier events. * * UNDER_VOLTAGE Regulator output is under voltage. * OVER_CURRENT Regulator output current is too high. * REGULATION_OUT Regulator output is out of regulation. * FAIL Regulator output has failed. * OVER_TEMP Regulator over temp. * FORCE_DISABLE Regulator forcibly shut down by software. * VOLTAGE_CHANGE Regulator voltage changed. * Data passed is old voltage cast to (void *). * DISABLE Regulator was disabled. * PRE_VOLTAGE_CHANGE Regulator is about to have voltage changed. * Data passed is "struct pre_voltage_change_data" * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason. * Data passed is old voltage cast to (void *). * PRE_DISABLE Regulator is about to be disabled * ABORT_DISABLE Regulator disable failed for some reason * * NOTE: These events can be OR'ed together when passed into handler. */ #define REGULATOR_EVENT_UNDER_VOLTAGE … #define REGULATOR_EVENT_OVER_CURRENT … #define REGULATOR_EVENT_REGULATION_OUT … #define REGULATOR_EVENT_FAIL … #define REGULATOR_EVENT_OVER_TEMP … #define REGULATOR_EVENT_FORCE_DISABLE … #define REGULATOR_EVENT_VOLTAGE_CHANGE … #define REGULATOR_EVENT_DISABLE … #define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE … #define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE … #define REGULATOR_EVENT_PRE_DISABLE … #define REGULATOR_EVENT_ABORT_DISABLE … #define REGULATOR_EVENT_ENABLE … /* * Following notifications should be emitted only if detected condition * is such that the HW is likely to still be working but consumers should * take a recovery action to prevent problems escalating into errors. */ #define REGULATOR_EVENT_UNDER_VOLTAGE_WARN … #define REGULATOR_EVENT_OVER_CURRENT_WARN … #define REGULATOR_EVENT_OVER_VOLTAGE_WARN … #define REGULATOR_EVENT_OVER_TEMP_WARN … #define REGULATOR_EVENT_WARN_MASK … struct reg_genl_event { … }; /* attributes of reg_genl_family */ enum { … }; #define REG_GENL_ATTR_MAX … /* commands supported by the reg_genl_family */ enum { … }; #define REG_GENL_CMD_MAX … #define REG_GENL_FAMILY_NAME … #define REG_GENL_VERSION … #define REG_GENL_MCAST_GROUP_NAME … #endif /* _UAPI_REGULATOR_H */