valve: add control interface
Add the valve control interface to open and close the valve to start and
stop the flow of coolant.
Change-Id: Id23ef26dbd6f982a7fa17c65e2ef5b9f6cbc9263
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/gen/xyz/openbmc_project/Control/Valve/meson.build b/gen/xyz/openbmc_project/Control/Valve/meson.build
new file mode 100644
index 0000000..604326e
--- /dev/null
+++ b/gen/xyz/openbmc_project/Control/Valve/meson.build
@@ -0,0 +1,40 @@
+# Generated file; do not modify.
+
+sdbusplus_current_path = 'xyz/openbmc_project/Control/Valve'
+
+generated_sources += custom_target(
+ 'xyz/openbmc_project/Control/Valve__cpp'.underscorify(),
+ input: [
+ '../../../../../yaml/xyz/openbmc_project/Control/Valve.interface.yaml',
+ ],
+ output: [
+ 'common.hpp',
+ 'server.hpp',
+ 'server.cpp',
+ 'aserver.hpp',
+ 'client.hpp',
+ ],
+ depend_files: sdbusplusplus_depfiles,
+ command: [
+ sdbuspp_gen_meson_prog,
+ '--command',
+ 'cpp',
+ '--output',
+ meson.current_build_dir(),
+ '--tool',
+ sdbusplusplus_prog,
+ '--directory',
+ meson.current_source_dir() / '../../../../../yaml',
+ 'xyz/openbmc_project/Control/Valve',
+ ],
+ install: should_generate_cpp,
+ install_dir: [
+ get_option('includedir') / sdbusplus_current_path,
+ get_option('includedir') / sdbusplus_current_path,
+ false,
+ get_option('includedir') / sdbusplus_current_path,
+ get_option('includedir') / sdbusplus_current_path,
+ ],
+ build_by_default: should_generate_cpp,
+)
+
diff --git a/gen/xyz/openbmc_project/Control/meson.build b/gen/xyz/openbmc_project/Control/meson.build
index c5ebdbf..d56d590 100644
--- a/gen/xyz/openbmc_project/Control/meson.build
+++ b/gen/xyz/openbmc_project/Control/meson.build
@@ -18,6 +18,7 @@
subdir('Service')
subdir('TPM')
subdir('ThermalMode')
+subdir('Valve')
subdir('VoltageRegulatorControl')
subdir('VoltageRegulatorMode')
@@ -333,6 +334,28 @@
)
generated_markdown += custom_target(
+ 'xyz/openbmc_project/Control/Valve__markdown'.underscorify(),
+ input: ['../../../../yaml/xyz/openbmc_project/Control/Valve.interface.yaml'],
+ output: ['Valve.md'],
+ depend_files: sdbusplusplus_depfiles,
+ command: [
+ sdbuspp_gen_meson_prog,
+ '--command',
+ 'markdown',
+ '--output',
+ meson.current_build_dir(),
+ '--tool',
+ sdbusplusplus_prog,
+ '--directory',
+ meson.current_source_dir() / '../../../../yaml',
+ 'xyz/openbmc_project/Control/Valve',
+ ],
+ install: should_generate_markdown,
+ install_dir: [inst_markdown_dir / sdbusplus_current_path],
+ build_by_default: should_generate_markdown,
+)
+
+generated_markdown += custom_target(
'xyz/openbmc_project/Control/VoltageRegulatorControl__markdown'.underscorify(),
input: [
'../../../../yaml/xyz/openbmc_project/Control/VoltageRegulatorControl.interface.yaml',
diff --git a/yaml/xyz/openbmc_project/Control/Valve.interface.yaml b/yaml/xyz/openbmc_project/Control/Valve.interface.yaml
new file mode 100644
index 0000000..5b7d3d8
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Control/Valve.interface.yaml
@@ -0,0 +1,37 @@
+description: >
+ Implement to provide a valve control interface to open/close a valve.
+
+ Any service implementing this interface must also implement
+ the xyz.openbmc_project.Sensors.Value interface to show valve's open status
+ in percentage units.
+
+properties:
+ - name: State
+ type: enum[self.State]
+ description: >
+ This indicates the property used to open or close the valve.
+
+enumerations:
+ - name: State
+ description: >
+ This indicates which status should be configured for the valve.
+ values:
+ - name: Open
+ description: >
+ This indicates the valve should be opened.
+ - name: Close
+ description: >
+ This indicates the valve should be closed.
+
+associations:
+ - name: controlling
+ description: >
+ A valve control interface can optionally implement the 'controlling'
+ association to provide link to the inventory item being controlled by
+ it.
+ reverse_name: controlled_by
+ required_endpoint_interfaces:
+ - xyz.openbmc_project.Inventory.Item.Valve
+
+paths:
+ - namespace: /xyz/openbmc_project/control/valve
diff --git a/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml
index 7ece5b6..274e079 100644
--- a/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml
+++ b/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml
@@ -120,6 +120,14 @@
reverse_name: connecting
required_endpoint_interfaces:
- xyz.openbmc_project.Inventory.Item.Cable
+ - name: controlled_by
+ description:
+ Object that implements Item can optionally implement the
+ 'controlled_by' association to provide a link to the control
+ interface.
+ reverse_name: controlling
+ required_endpoint_interfaces:
+ - xyz.openbmc_project.Control.Valve
paths:
- namespace: /xyz/openbmc_project/inventory