[Skiboot] [PATCH V6 2/3] sensors: occ: Add DT compatible string for current(A) sensor

Shilpasri G Bhat shilpa.bhat at linux.vnet.ibm.com
Mon Jun 19 22:06:20 AEST 2017


Add a new DT compatible string "ibm,opal-sensor-current" for
current(A) sensors.

Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
---
 hw/occ-sensor.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
index 75f00d5..debfba5 100644
--- a/hw/occ-sensor.c
+++ b/hw/occ-sensor.c
@@ -586,8 +586,12 @@ void occ_sensors_init(void)
 			handler = sensor_handler(occ_num, i, SENSOR_MIN);
 			dt_add_property_cells(node, "sensor-data-min", handler);
 
-			dt_add_property_string(node, "compatible",
-					       "ibm,opal-sensor");
+			if (md[i].type == OCC_SENSOR_TYPE_CURRENT)
+				dt_add_property_string(node, "compatible",
+						"ibm,opal-sensor-current");
+			else
+				dt_add_property_string(node, "compatible",
+						       "ibm,opal-sensor");
 			dt_add_property_string(node, "occ_label", md[i].name);
 			add_sensor_label(node, &md[i], chip->id);
 		}
-- 
1.8.3.1



More information about the Skiboot mailing list