Writing a DVFS Driver

The dvfsmgr-* drivers manage Dynamic Voltage Frequency Scaling (DVFS) for specific boards/SoCs. If you have a compatible board/SoC, and the dvfsmgr-* provided by QNX doesn't meet your needs, you can use the API declared in <hw/dvfs_api.h> to develop a custom driver and manage DVFS as appropriate. For instance:

Your DVFS driver must respond to the device control (devctl()) messages listed below and work with the hardware itself. Some commands may be valid only for a certain driver mode, as indicated.

DVFS_DEVCTL_SET_MIN
Set the minimum level of power (automatic mode).
DVFS_DEVCTL_UNSET_MIN
Unset the minimum power level (automatic mode).
DVFS_DEVCTL_SET_MODE
Set the driver mode.
DVFS_DEVCTL_SET_PWR_LVL
Set the driver's power level (manual or semi-automatic).
DVFS_DEVCTL_GETSTATUS
Get the driver's status.
DVFS_DEVCTL_RUN_MAX
Run at the maximum power level (manual or semi-automatic).
DVFS_DEVCTL_RUN_MIN
Run at the minimum power level (manual or semi-automatic).

Higher-level programs use these devctl() commands to communicate with the driver. There's also a dvfs_client utility that provides a command-line interface for controlling DVFS; it uses the same devctl() commands. For details about these commands, see <hw/dvfs_api.h>.

The dvfsmgr-* drivers that QNX provides use the APIs declared in <hw/dvfs_api.h>, and your custom driver can include customized version of them. You can also use them as a reference, in order to determine what the driver can do.