]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/pwr_mgt/IOPM.h
xnu-4570.51.1.tar.gz
[apple/xnu.git] / iokit / IOKit / pwr_mgt / IOPM.h
index cdaf4655f300e08cf57c7d5a7c6a1b24e55493fc..c8393354369ee03fd35e6f1e620c6b129c6b371f 100644 (file)
@@ -95,8 +95,7 @@ enum {
     An indication that the power flags represent the state of the root power
     domain. This bit must not be set in the IOPMPowerState structure.
     Power Management may pass this bit to initialPowerStateForDomainState()
-    or powerStateForDomainState() to map from a global system state to the
-    desired device state.
+    to map from a global system state to the desired device state.
 */
 typedef unsigned long IOPMPowerFlags;
 enum {
@@ -613,6 +612,39 @@ enum {
 #define kIOPMPSAdapterDetailsAmperageKey           "Amperage"
 #define kIOPMPSAdapterDetailsDescriptionKey        "Description"
 #define kIOPMPSAdapterDetailsPMUConfigurationKey    "PMUConfiguration"
+#define kIOPMPSAdapterDetailsVoltage            "AdapterVoltage"
+#define kIOPMPSAdapterDetailsSourceIDKey                   "SourceID"
+#define kIOPMPSAdapterDetailsErrorFlagsKey                 "ErrorFlags"
+#define kIOPMPSAdapterDetailsSharedSourceKey           "SharedSource"
+#define kIOPMPSAdapterDetailsCloakedKey                    "CloakedSource"
+
+// values for kIOPSPowerAdapterFamilyKey
+enum {
+    kIOPSFamilyCodeDisconnected     = 0,
+    kIOPSFamilyCodeUnsupported      = kIOReturnUnsupported,
+    kIOPSFamilyCodeFirewire     = iokit_family_err(sub_iokit_firewire, 0),
+    kIOPSFamilyCodeUSBHost      = iokit_family_err(sub_iokit_usb, 0),
+    kIOPSFamilyCodeUSBHostSuspended   = iokit_family_err(sub_iokit_usb, 1),
+    kIOPSFamilyCodeUSBDevice      = iokit_family_err(sub_iokit_usb, 2),
+    kIOPSFamilyCodeUSBAdapter     = iokit_family_err(sub_iokit_usb, 3),
+    kIOPSFamilyCodeUSBChargingPortDedicated = iokit_family_err(sub_iokit_usb, 4),
+    kIOPSFamilyCodeUSBChargingPortDownstream  = iokit_family_err(sub_iokit_usb, 5),
+    kIOPSFamilyCodeUSBChargingPort    = iokit_family_err(sub_iokit_usb, 6),
+    kIOPSFamilyCodeUSBUnknown     = iokit_family_err(sub_iokit_usb, 7),
+    kIOPSFamilyCodeAC       = iokit_family_err(sub_iokit_pmu, 0),
+    kIOPSFamilyCodeExternal     = iokit_family_err(sub_iokit_pmu, 1),
+    kIOPSFamilyCodeExternal2     = iokit_family_err(sub_iokit_pmu, 2),
+    kIOPSFamilyCodeExternal3     = iokit_family_err(sub_iokit_pmu, 3),
+    kIOPSFamilyCodeExternal4     = iokit_family_err(sub_iokit_pmu, 4),
+};
+
+// values for kIOPMPSAdapterDetailsErrorFlagsKey
+enum {
+    kIOPSAdapterErrorFlagNoErrors                     = 0,
+    kIOPSAdapterErrorFlagInsufficientAvailablePower   = (1 << 1),
+    kIOPSAdapterErrorFlagForeignObjectDetected        = (1 << 2),
+    kIOPSAdapterErrorFlagDeviceNeedsToBeRepositioned  = (1 << 3),
+};
 
 // Battery's time remaining estimate is invalid this long (seconds) after a wake
 #define kIOPMPSInvalidWakeSecondsKey           "BatteryInvalidWakeSeconds"
@@ -684,18 +716,27 @@ enum {
 #define kIOPMThermalLevelWarningKey                     "Thermal_Level_Warning"
 
 /* Thermal Warning Level values
- *      kIOPMThermalWarningLevelNormal - under normal operating conditions
- *      kIOPMThermalWarningLevelDanger - thermal pressure may cause system slowdown
- *      kIOPMThermalWarningLevelCrisis - thermal conditions may cause imminent shutdown
+ *      kIOPMThermalLevelNormal   - under normal operating conditions
+ *      kIOPMThermalLevelDanger   - thermal pressure may cause system slowdown
+ *      kIOPMThermalLevelCritical - thermal conditions may cause imminent shutdown
  *
  * The platform may define additional thermal levels if necessary.
+ * Platform specific values are defined from 100 and above
  */
 enum {
-  kIOPMThermalWarningLevelNormal    = 0,
-  kIOPMThermalWarningLevelDanger    = 5,
-  kIOPMThermalWarningLevelCrisis    = 10
+  kIOPMThermalLevelNormal    = 0,
+  kIOPMThermalLevelDanger    = 5,
+  kIOPMThermalLevelCritical  = 10,
+
+  kIOPMThermalLevelWarning = 100,
+  kIOPMThermalLevelTrap    = 110,
+
+  kIOPMThermalLevelUnknown = 255,
 };
 
+#define kIOPMThermalWarningLevelNormal kIOPMThermalLevelNormal
+#define kIOPMThermalWarningLevelDanger kIOPMThermalLevelWarning
+#define kIOPMThermalWarningLevelCrisis kIOPMThermalLevelCritical
 
 // PM Settings Controller setting types
 // Settings types used primarily with: