From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1EC7C433E6 for ; Mon, 8 Mar 2021 11:54:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A2A365132 for ; Mon, 8 Mar 2021 11:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231601AbhCHLxa convert rfc822-to-8bit (ORCPT ); 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á >