[Previous] [Contents] [Next]

pmd_mode_attr_t

Describe the attributes and capabilities for a device power mode

Synopsis:

typedef struct pmd_mode_attr  pmd_mode_attr_t;

struct pmd_mode_attr {
   pm_power_mode_t  mode;
   unsigned flags;
   union
   {
     _Uint32t flags;
     void B  *ptr;
    }
   drvprivate;
   _Uint32t  rsv1;
}

Description:

The pmd_mode_attr_t structure describes the capabilities for a device power mode. It contains the following:

mode
The power mode.
flags
Describe the driver capabilities for that mode:
PMD_MODE_ATTR_NORAM
Support the PM_MODE_NORAM flag and can be used for system power modes where system RAM is disabled.
PMD_MODE_ATTR_HWVOL
Support the PM_MODE_HWVOL flag and can be used for system power modes where peripheral device registers are lost.
PMD_MODE_ATTR_WAKEUP
Support system wakeup functionality and can be used to configure the device to act as a wakeup source for low power system standby modes.
drvprivate
Contain driver specific information related to the mode. This can be used internally within the driver, for example to indicate which hardware components are functional in that mode. The contents of drvprivate have no defined meaning outside the driver that defines it, although they are returned to external programs using iopower_getattr() or pm_getattr(), allowing them to examine these attributes if they have driver specific knowledge.

A device driver defines its supported modes using pmd_attr_setmodes(). In order to support system standby modes that allow system RAM to be disabled the driver must define at least one PM_MODE_STANDBY mode that specifies the PMD_MODE_NORAM flag. If no modes specify this flag, returning from such a system standby state will cause all driver and device state to be lost.

The mode values should be defined as device specific power modes using the PM_DEVICE_MODE() macro.

Examples:

/*
 * Define 5 device modes that correspond to the 4 logical power modes.
 * The device supports two standby modes:
 * - both support PM_MODE_NORAM and PM_MODE_HWVOL
 * - one mode additionally implements system wakeup functionality
 */
pmd_mode_attr_t device_modes[] = {
   {
   PM_DEVICE_MODE(PM_MODE_ACTIVE, 0),
   0,
   },
   {
   PM_DEVICE_MODE(PM_MODE_IDLE, 0),
   0,
   },
   {
   PM_DEVICE_MODE(PM_MODE_STANDBY, 0),
   PMD_MODE_ATTR_NORAM|PMD_MODE_ATTR_HWVOL,
   },
   {
   PM_DEVICE_MODE(PM_MODE_STANDBY, 0),
   PMD_MODE_ATTR_NORAM|PMD_MODE_ATTR_HWVOL|PMD_MODE_ATTR_WAKEUP,
   },
   {
   PM_DEVICE_MODE(PM_MODE_OFF, 0),
   0,
   }
};

Classification:

See also:

pm_power_mode_t, iopower_getattr(), pm_getattr(), pmd_attr_setmodes()


[Previous] [Contents] [Next]