From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755407Ab3F1PVQ (ORCPT ); Fri, 28 Jun 2013 11:21:16 -0400 Received: from mailhost.informatik.uni-hamburg.de ([134.100.9.70]:51836 "EHLO mailhost.informatik.uni-hamburg.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753889Ab3F1PVO (ORCPT ); Fri, 28 Jun 2013 11:21:14 -0400 Message-ID: <51CDAABB.4020505@metafoo.de> Date: Fri, 28 Jun 2013 17:24:43 +0200 From: Lars-Peter Clausen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Alexandre Belloni CC: Guenter Roeck , Maxime Ripard , Shawn Guo , Jean Delvare , jimwall@q.com, brian@crystalfontz.com, Grant Likely , Rob Herring , Rob Landley , Russell King , devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org Subject: Re: [PATCH 3/4] hwmon: Add a simple driver to read the MXS SoC temperature References: <1372236673-20725-1-git-send-email-alexandre.belloni@free-electrons.com> <1372236673-20725-4-git-send-email-alexandre.belloni@free-electrons.com> <20130626143927.GB31998@roeck-us.net> <20130627091732.GP5803@lukather> <20130627142758.GA5812@roeck-us.net> <51CC91E8.50605@free-electrons.com> <51CD9B19.90407@metafoo.de> <51CDA2BF.5050501@free-electrons.com> In-Reply-To: <51CDA2BF.5050501@free-electrons.com> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/28/2013 04:50 PM, Alexandre Belloni wrote: > On 28/06/2013 16:18, Lars-Peter Clausen wrote: >> On 06/27/2013 09:26 PM, Alexandre Belloni wrote: >>> >>> They are already registered as IIO_TEMP but only implement read_raw. Also, >>> >>> iio_hwmon_read_val() is using iio_read_channel_processed() and that will >>> basically only read one of the 2 channels. As I documented, you actually >>> need to read both channel 8 and channel 9 and then compute the value in >>> Kelvins. I'm not sure how you want me to do that in the current framework. >> What are these two channels actually measuring? Is the value of a single >> channel meaningful on it's own? If not it might make sense to update the IIO >> driver to just have one temperature channel. > > It's not actually meaningful on its own. So, what you would do is expose > one iio channel for two ADC channels and do the computation in read_raw > ? or read_processed ? Then using iio-hwon to export it. ? > > Regards, > Yes, return channel9 - channel8 as the raw value for the temperature channel and provide proper scale and offset values, so that iio_read_channel_processed() will return the correct value. - Lars From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Subject: Re: [PATCH 3/4] hwmon: Add a simple driver to read the MXS SoC temperature Date: Fri, 28 Jun 2013 17:24:43 +0200 Message-ID: <51CDAABB.4020505@metafoo.de> References: <1372236673-20725-1-git-send-email-alexandre.belloni@free-electrons.com> <1372236673-20725-4-git-send-email-alexandre.belloni@free-electrons.com> <20130626143927.GB31998@roeck-us.net> <20130627091732.GP5803@lukather> <20130627142758.GA5812@roeck-us.net> <51CC91E8.50605@free-electrons.com> <51CD9B19.90407@metafoo.de> <51CDA2BF.5050501@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51CDA2BF.5050501-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Alexandre Belloni Cc: Guenter Roeck , Maxime Ripard , Shawn Guo , Jean Delvare , jimwall@q.com, brian-ZKiFAVwZFM2FeswfMrDH8w@public.gmane.org, Grant Likely , Rob Herring , Rob Landley , Russell King , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On 06/28/2013 04:50 PM, Alexandre Belloni wrote: > On 28/06/2013 16:18, Lars-Peter Clausen wrote: >> On 06/27/2013 09:26 PM, Alexandre Belloni wrote: >>> >>> They are already registered as IIO_TEMP but only implement read_raw. Also, >>> >>> iio_hwmon_read_val() is using iio_read_channel_processed() and that will >>> basically only read one of the 2 channels. As I documented, you actually >>> need to read both channel 8 and channel 9 and then compute the value in >>> Kelvins. I'm not sure how you want me to do that in the current framework. >> What are these two channels actually measuring? Is the value of a single >> channel meaningful on it's own? If not it might make sense to update the IIO >> driver to just have one temperature channel. > > It's not actually meaningful on its own. So, what you would do is expose > one iio channel for two ADC channels and do the computation in read_raw > ? or read_processed ? Then using iio-hwon to export it. ? > > Regards, > Yes, return channel9 - channel8 as the raw value for the temperature channel and provide proper scale and offset values, so that iio_read_channel_processed() will return the correct value. - Lars From mboxrd@z Thu Jan 1 00:00:00 1970 From: lars@metafoo.de (Lars-Peter Clausen) Date: Fri, 28 Jun 2013 17:24:43 +0200 Subject: [PATCH 3/4] hwmon: Add a simple driver to read the MXS SoC temperature In-Reply-To: <51CDA2BF.5050501@free-electrons.com> References: <1372236673-20725-1-git-send-email-alexandre.belloni@free-electrons.com> <1372236673-20725-4-git-send-email-alexandre.belloni@free-electrons.com> <20130626143927.GB31998@roeck-us.net> <20130627091732.GP5803@lukather> <20130627142758.GA5812@roeck-us.net> <51CC91E8.50605@free-electrons.com> <51CD9B19.90407@metafoo.de> <51CDA2BF.5050501@free-electrons.com> Message-ID: <51CDAABB.4020505@metafoo.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 06/28/2013 04:50 PM, Alexandre Belloni wrote: > On 28/06/2013 16:18, Lars-Peter Clausen wrote: >> On 06/27/2013 09:26 PM, Alexandre Belloni wrote: >>> >>> They are already registered as IIO_TEMP but only implement read_raw. Also, >>> >>> iio_hwmon_read_val() is using iio_read_channel_processed() and that will >>> basically only read one of the 2 channels. As I documented, you actually >>> need to read both channel 8 and channel 9 and then compute the value in >>> Kelvins. I'm not sure how you want me to do that in the current framework. >> What are these two channels actually measuring? Is the value of a single >> channel meaningful on it's own? If not it might make sense to update the IIO >> driver to just have one temperature channel. > > It's not actually meaningful on its own. So, what you would do is expose > one iio channel for two ADC channels and do the computation in read_raw > ? or read_processed ? Then using iio-hwon to export it. ? > > Regards, > Yes, return channel9 - channel8 as the raw value for the temperature channel and provide proper scale and offset values, so that iio_read_channel_processed() will return the correct value. - Lars From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Date: Fri, 28 Jun 2013 15:24:43 +0000 Subject: Re: [lm-sensors] [PATCH 3/4] hwmon: Add a simple driver to read the MXS SoC temperature Message-Id: <51CDAABB.4020505@metafoo.de> List-Id: References: <1372236673-20725-1-git-send-email-alexandre.belloni@free-electrons.com> <1372236673-20725-4-git-send-email-alexandre.belloni@free-electrons.com> <20130626143927.GB31998@roeck-us.net> <20130627091732.GP5803@lukather> <20130627142758.GA5812@roeck-us.net> <51CC91E8.50605@free-electrons.com> <51CD9B19.90407@metafoo.de> <51CDA2BF.5050501@free-electrons.com> In-Reply-To: <51CDA2BF.5050501@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexandre Belloni Cc: Guenter Roeck , Maxime Ripard , Shawn Guo , Jean Delvare , jimwall@q.com, brian@crystalfontz.com, Grant Likely , Rob Herring , Rob Landley , Russell King , devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org On 06/28/2013 04:50 PM, Alexandre Belloni wrote: > On 28/06/2013 16:18, Lars-Peter Clausen wrote: >> On 06/27/2013 09:26 PM, Alexandre Belloni wrote: >>> >>> They are already registered as IIO_TEMP but only implement read_raw. Also, >>> >>> iio_hwmon_read_val() is using iio_read_channel_processed() and that will >>> basically only read one of the 2 channels. As I documented, you actually >>> need to read both channel 8 and channel 9 and then compute the value in >>> Kelvins. I'm not sure how you want me to do that in the current framework. >> What are these two channels actually measuring? Is the value of a single >> channel meaningful on it's own? If not it might make sense to update the IIO >> driver to just have one temperature channel. > > It's not actually meaningful on its own. So, what you would do is expose > one iio channel for two ADC channels and do the computation in read_raw > ? or read_processed ? Then using iio-hwon to export it. ? > > Regards, > Yes, return channel9 - channel8 as the raw value for the temperature channel and provide proper scale and offset values, so that iio_read_channel_processed() will return the correct value. - Lars _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors