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.

Set the minimum level of power (automatic mode).
Unset the minimum power level (automatic mode).
Set the driver mode.
Set the driver's power level (manual or semi-automatic).
Get the driver's status.
Run at the maximum power level (manual or semi-automatic).
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.