sensor-groups : occ: Add 'ops' DT property

Message ID 1502335024-29949-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Shilpasri G Bhat Aug. 10, 2017, 3:17 a.m.
Add new device-tree property 'ops' to define different operations
supported on each sensor-group.

Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
---
 doc/device-tree/ibm,opal/sensor-groups.rst | 19 ++++++++++++-------
 hw/occ-sensor.c                            |  2 +-
 hw/occ.c                                   |  1 +
 3 files changed, 14 insertions(+), 8 deletions(-)

Comments

Stewart Smith Aug. 15, 2017, 12:53 a.m. | #1
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
> Add new device-tree property 'ops' to define different operations
> supported on each sensor-group.
>
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>

Merged to master as of a298f3767469f28a0f005d8717cb866a50110bac

Patch

diff --git a/doc/device-tree/ibm,opal/sensor-groups.rst b/doc/device-tree/ibm,opal/sensor-groups.rst
index af21e7d..05528d4 100644
--- a/doc/device-tree/ibm,opal/sensor-groups.rst
+++ b/doc/device-tree/ibm,opal/sensor-groups.rst
@@ -7,7 +7,7 @@  Each child node here represents a sensor group.
 For example : ::
         occ-csm@1c00020/
 
-The compatible property is set to "ibm,opal-occ-sensor-group"
+The compatible property is set to "ibm,opal-sensor-group"
 
 Each child node has below properties:
 
@@ -23,18 +23,23 @@  Each child node has below properties:
 `sensors`
   Phandles of all sensors belonging to this sensor group
 
+`ops`
+  Array of opal call numbers to indicate the available sensor group
+  operations
+
 .. code-block:: dts
 
    ibm,opal {
      sensor-groups {
-        compatible = "ibm,opal-occ-sensor-group";
+        compatible = "ibm,opal-sensor-group";
 
         occ-csm@1c00020 {
-                name = "occ-csm"
-                type = "csm"
-                sensor-group-id = <0x01c00020>
-                ibm,chip-id = <0x00000008>
-                phandles = <
+                name = "occ-csm";
+                type = "csm";
+                sensor-group-id = <0x01c00020>;
+                ibm,chip-id = <0x00000008>;
+                ops = <0x9c>;
+                sensors = <0x00000175 0x00000176 0x00000177 0x00000178 0x00000179 0x0000017a 0x0000017b 0x0000017c>;
         };
      };
     };
diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
index 35fae8f..89f529f 100644
--- a/hw/occ-sensor.c
+++ b/hw/occ-sensor.c
@@ -567,7 +567,7 @@  void occ_sensors_init(void)
 		prerror("OCC: Failed to create sensor groups node\n");
 		return;
 	}
-	dt_add_property_string(sg, "compatible", "ibm,opal-occ-sensor-group");
+	dt_add_property_string(sg, "compatible", "ibm,opal-sensor-group");
 
 	for_each_chip(chip) {
 		struct occ_sensor_data_header *hb;
diff --git a/hw/occ.c b/hw/occ.c
index 03291ae..78c6a6a 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1533,6 +1533,7 @@  void occ_add_sensor_groups(struct dt_node *sg, u32 *phandles, int nr_phandles,
 		dt_add_property_string(node, "type", limits[j].str);
 		dt_add_property_cells(node, "ibm,chip-id", chipid);
 		dt_add_property(node, "sensors", phandles, nr_phandles);
+		dt_add_property_cells(node, "ops", OPAL_SENSOR_GROUP_CLEAR);
 	}
 }