Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753270AbcCGUJn (ORCPT ); Mon, 7 Mar 2016 15:09:43 -0500 Received: from smtp-out-084.synserver.de ([212.40.185.84]:1202 "EHLO smtp-out-084.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752414AbcCGUJg (ORCPT ); Mon, 7 Mar 2016 15:09:36 -0500 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 18072 Subject: Re: [PATCH v2 1/2] iio: core: introduce IIO_CHAN_INFO_SIGNED To: Ludovic Desroches , jic23@kernel.org References: <1457360997-29179-1-git-send-email-ludovic.desroches@atmel.com> <1457360997-29179-2-git-send-email-ludovic.desroches@atmel.com> Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nicolas.ferre@atmel.com From: Lars-Peter Clausen Message-ID: <56DDDFFC.5010100@metafoo.de> Date: Mon, 7 Mar 2016 21:09:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <1457360997-29179-2-git-send-email-ludovic.desroches@atmel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 881 Lines: 17 On 03/07/2016 03:29 PM, Ludovic Desroches wrote: > The same channel can be used to perform a signed or an unsigned > conversion. Add a new infomask element to be able to select the type of > conversion wanted: a raw one or a signed raw one. If this is the difference between offset binary and two's complement then it makes no sense to expose this at this level. Both are the same number just in a different representation and converting between them is cheap. A few magnitudes cheaper than reading the result over sysfs. So, if your device supports both, just pick one. For the buffered interface it may make sense to expose this, since the per sample overhead is a lot lower. But still doing the conversion should be cheap enough that it does not really matter. Before this is implemented I'd like to see hard performance numbers that this actually makes a difference. - Lars