Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1948650AbdDYPFq (ORCPT ); Tue, 25 Apr 2017 11:05:46 -0400 Received: from 20.mo6.mail-out.ovh.net ([178.32.124.17]:60574 "EHLO 20.mo6.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1948635AbdDYPFg (ORCPT ); Tue, 25 Apr 2017 11:05:36 -0400 X-Greylist: delayed 2187 seconds by postgrey-1.27 at vger.kernel.org; Tue, 25 Apr 2017 11:05:36 EDT Subject: Re: [PATCH] hwmon: (ibmpowernv) Add min/max attributes and current sensors To: Michael Ellerman , Shilpasri G Bhat , Jean Delvare , Guenter Roeck , Paul Mackerras References: <1492749112-32465-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <66e927c1-ceec-679d-8eaf-c6686b24b3a7@linux.vnet.ibm.com> <87a879ynrn.fsf@concordia.ellerman.id.au> Cc: linux-hwmon@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, svaidy@linux.vnet.ibm.com, ego@linux.vnet.ibm.com, akshay.adiga@linux.vnet.ibm.com, andrew@aj.id.au From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <79e166e2-ed4b-7386-c07f-b02d68f133b5@kaod.org> Date: Tue, 25 Apr 2017 16:28:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <87a879ynrn.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 6715711469823495083 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeliedrgedvgdejlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1346 Lines: 35 On 04/22/2017 08:11 AM, Michael Ellerman wrote: > Shilpasri G Bhat writes: >> On 04/21/2017 05:17 PM, Cédric Le Goater wrote: >>> On 04/21/2017 06:31 AM, Shilpasri G Bhat wrote: >>>> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c >>>> index 6d2e660..1f329fa8 100644 >>>> --- a/drivers/hwmon/ibmpowernv.c >>>> +++ b/drivers/hwmon/ibmpowernv.c >>>> @@ -65,7 +66,8 @@ enum sensors { >>>> {"fan", "ibm,opal-sensor-cooling-fan"}, >>>> {"temp", "ibm,opal-sensor-amb-temp"}, >>>> {"in", "ibm,opal-sensor-power-supply"}, >>>> - {"power", "ibm,opal-sensor-power"} >>>> + {"power", "ibm,opal-sensor-power"}, >>>> + {"curr"}, /* Follows newer device tree compatible ibm,opal-sensor */ >>> >>> why isn't there a compatible string ? >> >> Skiboot exports "ibm,opal-sensor" as compatible string for all the inband >> sensors. Now if I define that as the compatible string here, then all the >> sensors would get identified as "curr" type of sensor by the driver. > > So fix it in skiboot? After a memory refresh, this table is to maintain compatibility with the support of the FSP sensors in old firmware. These have peculiar device node names and properties. So What the code is doing looks correct. But, you should also modify the 'enum sensors' to include a CURRENT value. Thanks, C.