162306a36Sopenharmony_ci========================== 262306a36Sopenharmony_ciRegulator API design notes 362306a36Sopenharmony_ci========================== 462306a36Sopenharmony_ci 562306a36Sopenharmony_ciThis document provides a brief, partially structured, overview of some 662306a36Sopenharmony_ciof the design considerations which impact the regulator API design. 762306a36Sopenharmony_ci 862306a36Sopenharmony_ciSafety 962306a36Sopenharmony_ci------ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci - Errors in regulator configuration can have very serious consequences 1262306a36Sopenharmony_ci for the system, potentially including lasting hardware damage. 1362306a36Sopenharmony_ci - It is not possible to automatically determine the power configuration 1462306a36Sopenharmony_ci of the system - software-equivalent variants of the same chip may 1562306a36Sopenharmony_ci have different power requirements, and not all components with power 1662306a36Sopenharmony_ci requirements are visible to software. 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci.. note:: 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci The API should make no changes to the hardware state unless it has 2162306a36Sopenharmony_ci specific knowledge that these changes are safe to perform on this 2262306a36Sopenharmony_ci particular system. 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ciConsumer use cases 2562306a36Sopenharmony_ci------------------ 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci - The overwhelming majority of devices in a system will have no 2862306a36Sopenharmony_ci requirement to do any runtime configuration of their power beyond 2962306a36Sopenharmony_ci being able to turn it on or off. 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci - Many of the power supplies in the system will be shared between many 3262306a36Sopenharmony_ci different consumers. 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci.. note:: 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci The consumer API should be structured so that these use cases are 3762306a36Sopenharmony_ci very easy to handle and so that consumers will work with shared 3862306a36Sopenharmony_ci supplies without any additional effort. 39