Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1036143ybt; Sun, 14 Jun 2020 08:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpGtjARqWkcDM77Jf9DDon7q1h532HLcGNinelXwfHujWDn8o+AOFL15urE868WpYFqAJ8 X-Received: by 2002:a17:906:4e0a:: with SMTP id z10mr15626092eju.57.1592147635534; Sun, 14 Jun 2020 08:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592147635; cv=none; d=google.com; s=arc-20160816; b=S6YhklH0mnl/dLwXgh2cFpF3gSKdCTErFBH8EYnAGvgqQjIbxJDG92XyGbv/DF9ZCa ZSBuQGiHOzsGV5ni9fnkeq28PcD9YvJ94wc8eBqBYnkRglQY8cbpN0o+xh2H5rbPSGp4 dquVbGVdJOpbhQRNOoUOFnTvu9sPCGZNAFBcS6abcDObaToYG9N4QwCUL1MQHSxdEiwb pVlwfyAKu0EjvFC0izK5XWtoUnEcZ7mmEBPm3c+XRqB68doPBxFsZ7hnFHVYTgyG2Pln cLQQ64gMPPciQdAIVpcSO5xN0AmmqPMaQvu53sFw54hbK3nTlb0RB3iAd/Q3kgmxiOug PTcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2DdAg+LgMBd0da3+ETcMF3kF+GgHUd3v2IJF8Z+RehE=; b=MMIEsAf9K7rd3C7RdG5+bcIM3p3CkfdHfqUu8GiLLaAIADzCg0P8oYE6tpqbrlKIeB L8vnHfpR8isZlel6VTR1CtTLsw6bZd+8W2Rl6sXBJHYHKlfKNZbJyQFKyPXK4tGYcQNz EShyAYANniAC1Gdof+9tVeAUxlEAapIvWt2SKYxyfidOxnGKHAC8g5AGAub3qehqcU71 1QGwZCZ4n//kHRSAsunhTUQEbF+7N1uT8DqLONJyY5QdFywSvMVo766X85ip/jKgVcGd GZtn9vS6V44fWU9N2fTZR+CmVG2Ac41OSr77LTcgPJwZ2ZMxZCURP5QlOyiclkpaW18G 6p+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metafoo.de header.s=default2002 header.b="WojMRQ/H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si7423738ejx.184.2020.06.14.08.13.32; Sun, 14 Jun 2020 08:13:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@metafoo.de header.s=default2002 header.b="WojMRQ/H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726993AbgFNPLI (ORCPT + 99 others); Sun, 14 Jun 2020 11:11:08 -0400 Received: from www381.your-server.de ([78.46.137.84]:41598 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbgFNPLH (ORCPT ); Sun, 14 Jun 2020 11:11:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2DdAg+LgMBd0da3+ETcMF3kF+GgHUd3v2IJF8Z+RehE=; b=WojMRQ/HGD48weFeNClYtL1TYx xS7hBXCEQWorRipPomN2p6KcuCRsXJi8Nc4JnoVU3NpqP6SWN3W6hwVGzs2QgjS+6VV2UjBqrun0r mMulN2/Dl7lQys1FILORLf56YqqP9ZouTuhfgy7OxcGAOWesdzU52giqo1FVH0VIX5q2INuX3Nezs NsF4vbU6C35QYjh1E7yaU/cPTCixz7uenHN0GtHnZ1dO6kp3OjUNoLHQl3ezS8gBxKHJE1NcIflQo 0cfhIIAS68MGNx28cMfUuqFwDyXPr5Uixl++4jVmV3XmFvAT/j/8H7ok4K+14RgMnGZDNCZ1otBE6 JF/osOWg==; Received: from sslproxy01.your-server.de ([78.46.139.224]) by www381.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1jkUHd-0002I6-7W; Sun, 14 Jun 2020 17:10:53 +0200 Received: from [82.135.70.239] (helo=[192.168.178.20]) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkUHc-000Rve-TY; Sun, 14 Jun 2020 17:10:52 +0200 Subject: Re: [PATCH v3 06/13] iio: imu: inv_icm42600: add temperature sensor support To: Jean-Baptiste Maneyrol , jic23@kernel.org, robh+dt@kernel.org, robh@kernel.org, mchehab+huawei@kernel.org, davem@davemloft.net, gregkh@linuxfoundation.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200608204250.3291-1-jmaneyrol@invensense.com> <20200608204250.3291-7-jmaneyrol@invensense.com> From: Lars-Peter Clausen Message-ID: Date: Sun, 14 Jun 2020 17:10:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200608204250.3291-7-jmaneyrol@invensense.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.102.3/25843/Sun Jun 14 14:53:02 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/8/20 10:42 PM, Jean-Baptiste Maneyrol wrote: > + case IIO_CHAN_INFO_PROCESSED: > + ret = iio_device_claim_direct_mode(indio_dev); > + if (ret) > + return ret; > + ret = inv_icm42600_temp_read(st, &temp); > + iio_device_release_direct_mode(indio_dev); > + if (ret) > + return ret; > + *val = temp; > + return IIO_VAL_INT; > + case IIO_CHAN_INFO_SCALE: > + *val = 483; > + *val2 = 91787; > + return IIO_VAL_INT_PLUS_MICRO; > + case IIO_CHAN_INFO_OFFSET: > + *val = 25000; > + return IIO_VAL_INT; If the data is returned processed there is no need to specify scale and offset. But since the transformation to turn the data into standard units is a simple linear transform the preferred way to handle this is to return RAW data and specify scale and offset.