Add Voltage Regulator Control interfaces

There are many cases where a BMC might need to control a Voltage
Regulator.  This commit adds 2 new interfaces for said control intended
to allow implementing this functionality.

VoltageRegulatorControl interface is intended to represent the "lowest"
level of a voltage regulator control interface, and allows setting a
voltage target for a given VR in Volts.  This is intended to be used by
platform specific logic internal to the BMC, that might have access to
chip/implementation specific manufacturing calibrations, and has the
ability to call out an exact voltage.  Setting the value property of
said interface is expected to do the VR specific actions, likely an
smbus/pmbus change operation, to set said voltage on the device.
Clients might also register for changes to the voltage, and make other
functional changes, such as an ADC sensor changing target and thresholds
based on the VR target.

VoltageRegulatorProfile interface is to provide a platform specific
"high level" interface, intended to satisfy users outside the BMC that
need the ability to set various "modes" a VR can obey.  It is
intentionally implemented as a platform specific interface, as there is
no such thing as a platform agnostic "voltage profile" and available
options and mode can vary significantly from system to system, chip to
chip, and vr to vr.  The likelihood that we could cover a superset of
cases seems unlikely, so it was intentionally discounted in this commit
as an option.  The concept for this is very similar to the
Control.ThermalMode interface, which also implements very
platform-specific behavior for thermal modes, which has nearly identical
constraints, hence it was a good model to follow for this interface.

Mailing list discussion on topic:
https://lore.kernel.org/openbmc/CAH2-KxCDtq4TDhcENWB65neeqq2QW2TDTV4e7mudaram5EcWGg@mail.gmail.com/

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I41445f8c273456ce505c02ef135c8c81a5ca6ece
diff --git a/xyz/openbmc_project/Control/VoltageRegulatorControl.interface.yaml b/xyz/openbmc_project/Control/VoltageRegulatorControl.interface.yaml
new file mode 100644
index 0000000..6c29218
--- /dev/null
+++ b/xyz/openbmc_project/Control/VoltageRegulatorControl.interface.yaml
@@ -0,0 +1,29 @@
+description: >
+    Implement to provide control of a voltage regulator.  Objects implementing
+    Control.VoltageRegulatorControl allow for fine grained control of a given
+    voltage regulator channel, and allows external entities to control Voltage
+    Regulator devices.
+
+properties:
+    - name: Voltage
+      type: double
+      description: >
+          The current voltage setting for the voltage regulator.
+    - name: MaxValue
+      type: double
+      flags:
+          - readonly
+      description: >
+          The Maximum supported voltage.
+    - name: MinValue
+      type: double
+      flags:
+          - readonly
+      description: >
+          The Minimum supported voltage.
+    - name: Resolution
+      type: double
+      flags:
+          - readonly
+      description: >
+          The minimum step size supported by this voltage interface.
\ No newline at end of file
diff --git a/xyz/openbmc_project/Control/VoltageRegulatorMode.interface.yaml b/xyz/openbmc_project/Control/VoltageRegulatorMode.interface.yaml
new file mode 100644
index 0000000..185b9d2
--- /dev/null
+++ b/xyz/openbmc_project/Control/VoltageRegulatorMode.interface.yaml
@@ -0,0 +1,32 @@
+description: >
+    Implement to provide control of voltage regulator devices from dbus
+    Control.VoltageRegulatorProfile.Supported is read only.  Implementation of
+    the Supported property populates the list of supported modes.  In the case
+    where the VR has a well defined default, implementations should place the
+    default in index 0.
+    Control.VoltageRegulatorProfile.Current is read/write and sets the
+    implementation specific mode for the voltage regulator to run in.  The
+    definitions of said enum are implementation defined, as systems likely will
+    have a multitude of possible states.  Some examples of naming might be
+    "HighPower" or "LowPower" in the case of bipolar power states, or might be
+    something more complex like, "Profile 1", "Profile 2", "Profile 3" if the VR
+    itself defines the interfaces.
+    Implementations may implement this alongside to a VoltageRegulatorControl
+    interface, and may react to the results of changes to the Control interface.
+
+properties:
+    - name: Supported
+      type: array[string]
+      flags:
+          - readonly
+      description: >
+          An implementation specific list of supported modes that the voltage
+          regulator control application can be configured to provide for a
+          platform.
+    - name: Selected
+      type: string
+      default: "Default"
+      description: >
+          The current mode the voltage regulator control application should
+          use.  This can be read to verify the current mode, or written to
+          change to a new mode.