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

C├ędric Le Goater clg at kaod.org
Mon Jun 19 22:54:22 AEST 2017


On 06/19/2017 02:06 PM, Shilpasri G Bhat wrote:
> 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");

I think this is not the correct method. We should be using the
'sensor-type' property. Please see my response on the ibmpowernv 
patch.

C.


> +			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);
>  		}
> 



More information about the Skiboot mailing list