![]() |
![]() |
![]() |
Describe the attributes and capabilities for a device power mode
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;
}
The pmd_mode_attr_t structure describes the capabilities for a device power mode. It contains the following:
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.
/*
* 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,
}
};
pm_power_mode_t, iopower_getattr(), pm_getattr(), pmd_attr_setmodes()
![]() |
![]() |
![]() |