Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1680672pxb; Mon, 8 Mar 2021 03:55:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9+ckLlEA0fC1f3Z94JGx/iIw9Rvcc5IHE3h6fqvfHpnTYt9hKou4W7YTWmIDhwqUbPDoo X-Received: by 2002:a17:906:5d06:: with SMTP id g6mr14777784ejt.216.1615204523468; Mon, 08 Mar 2021 03:55:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615204523; cv=none; d=google.com; s=arc-20160816; b=KwRqgedST4zJlM0mLPB04efXZo6El6k6jK0w9BOooHeRm4/VP63fIGn0h+VBaeusaK UUeiW1DifPLGpyWXqkBwAbQdoXW8gfLnyCC3BDhRQEp7pVUXmdalnZhbOTuwHkLUK4tF LObeR9Wzw0yO5SyAVmZveONPCb3CN/96+E6gVmOnxrxdNFxFFE4iNXZd7soYmiIiigMW FLrpvUJ/PKci83eCsZtnN3zGeLIquI8k/dmgI1de4UYbN59+p2w09dZGxJgR4pP1L+QZ sNdJlPCzAj9wJw7Nse2ytr7HL+jH+Nsi5T2jf+B6ys2+8xXUpuSlKZV5mnHxR7QO2u66 2gnQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=jpso2EuvNawlA7HbE3UCwH2+J4q1L1MDZLq73QgPNbM=; b=rEBoXgDrAKGKCvIENdBHkJckdd8Ro2gWa0Lk9VmAeH39ORvYhnC3b5jPF9Xf3Rv7nR tpUa2Vusw1il0uENBQv3DrKkNlOyCvHQhiQHeRGNen7Nu36iFMVG1vsw+5fbypSw7eO+ PheyyrIYbxPHgyEZuKXZsvgDeUodlvJMeURT8ze025IZRWO7RA2/pwtNUj7GDrY8V7RA ae07e3yFfnEpBqM3j5mBODDskXtoy6lyhvM5Bi+9d8dhptRKF+PiySckgzmyyDp3v8yo 2djqfDhDZWkUZN/l9SkckTkKGJ9H3QSNn4mMvVJS0zPPWtiv/U+GAIU8f+1/oqSvV1AD H0Hw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz18si6164629ejc.575.2021.03.08.03.55.01; Mon, 08 Mar 2021 03:55:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231162AbhCHLxa convert rfc822-to-8bit (ORCPT + 99 others); Mon, 8 Mar 2021 06:53:30 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2653 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbhCHLxS (ORCPT ); Mon, 8 Mar 2021 06:53:18 -0500 Received: from fraeml737-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DvGny6TXWz67wrR; Mon, 8 Mar 2021 19:48:54 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml737-chm.china.huawei.com (10.206.15.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 8 Mar 2021 12:53:15 +0100 Received: from localhost (10.47.81.42) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 8 Mar 2021 11:53:15 +0000 Date: Mon, 8 Mar 2021 11:52:03 +0000 From: Jonathan Cameron To: "Sa, Nuno" , Jonathan Cameron CC: "Hennerich, Michael" , "zzzzArdelean, zzzzAlexandru" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" , "lars@metafoo.de" , "Bogdan, Dragos" Subject: Re: [PATCH v3 0/6] iio: Add output buffer support Message-ID: <20210308115203.00006230@Huawei.com> In-Reply-To: References: <20210219124012.92897-1-alexandru.ardelean@analog.com> <20210221120106.00ae1078@archlinux> <20210306173449.06f2f32b@archlinux> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.47.81.42] X-ClientProxiedBy: lhreml720-chm.china.huawei.com (10.201.108.71) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Mar 2021 10:07:05 +0000 "Sa, Nuno" wrote: > > -----Original Message----- > > From: Jonathan Cameron > > Sent: Saturday, March 6, 2021 6:35 PM > > To: Hennerich, Michael > > Cc: zzzzArdelean, zzzzAlexandru ; > > linux-kernel@vger.kernel.org; linux-iio@vger.kernel.org; > > lars@metafoo.de; Sa, Nuno ; Bogdan, Dragos > > > > Subject: Re: [PATCH v3 0/6] iio: Add output buffer support > > > > On Fri, 5 Mar 2021 08:57:08 +0000 > > "Hennerich, Michael" wrote: > > > > > Hi Jonathan and others, > > > > > > With output/dac buffer support the semantics of the scan_element > > type may change. > > > > > > Today the Format is [be|le]:[s|u]bits/storagebitsXrepeat[>>shift]. > > > > > > While shift (if specified) is the shift that needs to be applied prior to > > masking out unused bits. > > > > > > So far so good and it sounds universal. > > > > > > However, we use the right shift (operator) for that, which makes > > sense for capture devices. > > > For output devices the more logical operator would be the left shift. > > > > > > I'm not proposing a new Format here. I just want to get some > > agreement that for an output device > > > > > > le:s12/16>>4 > > > > > > is understood as a left shift of 4, since the unused bits are then on > > the LSB. > > > > Good question. Guess I wasn't thinking ahead when I came up with > > that :) > > > > I'm not sure I'd mind if we did decide to define a new format for > > output > > buffers. Feels like it should be easy to do. > > > > What do others think? > > > > I guess the most straight forward thing would be just to add a 'shift_l' variable > to 'struct scan_type'' and make sure either 'shift_l' or 'shift' is defined and then > properly export either ">>" or "<<" to userspace? Given we already know it's an output channel, can we not just use that to make the decision? Jonathan > > - Nuno S? >