Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1204248pxb; Sat, 9 Jan 2021 11:04:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJweP+a5tchADOQNwD91TlmqVhgsj+wF1NphKtiqC4JhvUt33bIG1aV4k2Sey2ipvYsEJe4d X-Received: by 2002:aa7:c849:: with SMTP id g9mr9120985edt.48.1610219074399; Sat, 09 Jan 2021 11:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610219074; cv=none; d=google.com; s=arc-20160816; b=kpwUEB0BlN8V7AK9Sxgl8MnqaIiICzOXrHanQGCpYtyWafrdHZWARkv5iussaZEHlM kU10WhLm5LaxVfXP6Tb67DKn2aaCCUFg1NnTZRVwHalwMX/3G8bjxndAF5LQL28PpMjh P3ixDJ9n1IR/ojgDnycRoIhXLEWX+tY6RjmGTlQucGmwhSjenNzg9ijhF8Mv514RhCuy II6FLVLPg3U8B4CU6ppzVFIyBmhFQ095JS5DxphdJh6/5aRZsifLipXVQh4ENEhxAa1s omDQT1TugIbuQ663FG4DvsxZ/3Qly/AAObj9wSDh4AXhmLgBojh0YG91qeZSj2wRIM+a N1LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=DSSyF2cX9bW8Fjy9UT2nk0pYy094g9942LN9CRNdIig=; b=cPzDyFs223S7dFCDocOxHvibdxj7OQvlcnoT2r4OiRmMxggxc6iYXwktXzKYeBAN2O Ic6uqvGHLja8X9wHFPDWjg8Kwn4bByRaeO86xVZrH5tZsALcyFwwAEB4E/1OXdaBrghK N5yjJG+lzRJ2JJyBzCxhWgyG1Akz2ifBgQkguGJomXUH9OMwuFuQchl9OHpiPbGy7d1F YZJHNOwpejnl2Pp+UObXqMXCSkSkXhdt3bwMm/+yAYuP5XIPRxApQ2la0oB6oZJPPBJa Z0PIaVz2SNub/iMHzsbrpwBYRJrJp4OtchCn8VhQm5nLHksznhIbRe8rZrteaAf8kYC1 M7rA== ARC-Authentication-Results: i=1; mx.google.com; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md13si4840461ejb.324.2021.01.09.11.04.10; Sat, 09 Jan 2021 11:04:34 -0800 (PST) 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; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726324AbhAITCV (ORCPT + 99 others); Sat, 9 Jan 2021 14:02:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:47540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbhAITCV (ORCPT ); Sat, 9 Jan 2021 14:02:21 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B6C602399A; Sat, 9 Jan 2021 19:01:37 +0000 (UTC) Date: Sat, 9 Jan 2021 19:01:33 +0000 From: Jonathan Cameron To: Jyoti Bhayana Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Lukas Bulwahn , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, cristian.marussi@arm.com, sudeep.holla@arm.com, egranata@google.com, mikhail.golubev@opensynergy.com, Igor.Skalkin@opensynergy.com, Peter.hilber@opensynergy.com, ankitarora@google.com Subject: Re: Reply to [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors Message-ID: <20210109190133.61051fab@archlinux> In-Reply-To: <20210106212353.951807-1-jbhayana@google.com> References: <20210106161233.GA44413@e120937-lin> <20210106212353.951807-1-jbhayana@google.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Jan 2021 21:23:53 +0000 Jyoti Bhayana wrote: > Hi Jonathan, > > Instead of adding IIO_VAL_INT_H32_L32, I am thinking of adding IIO_VAL_FRACTIONAL_LONG > or IIO_VAL_FRACTIONAL_64 as the scale/exponent used for min/max range can be different > than the one used in resolution according to specification. That's somewhat 'odd'. Given min/max are inherently values the sensor is supposed to be able to return why give them different resolutions? Can you point me at a specific section of the spec? The axis_min_range_low etc fields don't seem to have units specified but I assumed they were in sensor units and so same scale factors? > > I am planning to use read_avail for IIO_CHAN_INFO_PROCESSED using IIO_AVAIL_RANGE > and this new IIO_VAL_FRACTIONAL_64 for min range,max range and resolution. > Instead of two values used in IIO_VAL_FRACTIONAL, IIO_VAL_FRACTIONAL_64 will use 4 values > val_high,val_low,and val2_high and val2_low. I'm not keen on the changing that internal kernel interface unless we absolutely have to. read_avail() is called from consumer drivers and they won't know anything about this new variant. > > Let me know if that is an acceptable solution. Hmm. It isn't a standard use of the ABI given the value in the buffer is (I assume) raw (needs scale applied). However, it isn't excluded by the ABI docs. Whether a standard userspace is going to expect it is not clear to me. I don't want to end up in a position where we end up with available being generally added for processed when what most people care about is what the value range they might get from a polled read is (rather than via a buffer). So I'm not that keen on this solution but if we can find a way to avoid it. Jonathan > > > Thanks, > Jyoti >