[powerdebug 03/22] Rewrite the regulator code based on the tree