Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3369301rdg; Tue, 17 Oct 2023 12:27:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGp7+njBGGIL71VuuVm0dldaEysl3qgMw+scZKnOfpAeaRpNmi475tjPl5DaK0PMQtx3dl+ X-Received: by 2002:a05:6a00:2486:b0:690:bdda:7c35 with SMTP id c6-20020a056a00248600b00690bdda7c35mr3129393pfv.1.1697570852687; Tue, 17 Oct 2023 12:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697570852; cv=none; d=google.com; s=arc-20160816; b=PjwC9xN06JbOyvxxV7HT6LGB8wjtPmzrod7D4rcdeKwGu8cjxHbDfM7SfUWTAbnBGY yEaUWUyOFTYt4cuAwBhgQMfGHszY3FBiIjV+mTFAJfczFE52av6e2LPNiVAz147E/Cxh Mbx1HzGJsQv9ZpOWRnwP8L5UgN3yJxVREGJ7Iolp4r0AlSWqfIhQvx3Yp/eYF6rkuA/0 H2FDYu11MEwD/mbMllxfAsaMW5ee2dJ+O3FOXLYIsnlgSxTCLv25qgtkTw+QS6tiNGki L8QjSitL0/52GMAs69iGC7n3/k3+4UAENESoaXl68c1KJS7+pSDHfMEUk8ipdJu/U8SF axOg== 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 :dkim-signature; bh=3uONuMJfjd41sFMq2Qg5ut/5SKsS6sqbeKViEASKzYI=; fh=XAAoHJNehCC3RLp/QhlsSnZednyb33G6awu4mKqgTpg=; b=0pQXudGbpOy+aap2KSJYgWIOUGN1Zvi/TGQtz57j2kS5sFBVi/tzWMGS29ud1waM5s rpO7FNE93GXmfiqo9kj8YZ/dnOuidW2xEb5LpfIEZpEZQt0YU5GSIJgxhb5v++CgVP4L Ub8UchyzwjfRvCdNLvyGHd2Wu0uo+r9x65w1853Bgn5DWFQu1+/ownEfe9K+hBVsE2Td tV7U/7M9BaEV5DyV3658k0QPs1qyk4YmF4DF0ILmir0Om72VZGa3Vru2ufcT2NUPsdRw b/uJ/ROwSZRT5DhbV8/MFlGFWtaTnLOFfOSvj10H9GVbL0H1NQkaC8fZRZYivSEfqf+Y a9Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ujGvTkWh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id f22-20020a637556000000b0057ab7f46381si449874pgn.76.2023.10.17.12.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:27:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ujGvTkWh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2E96580290A1; Tue, 17 Oct 2023 12:27:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344020AbjJQT1O (ORCPT + 99 others); Tue, 17 Oct 2023 15:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234988AbjJQT1N (ORCPT ); Tue, 17 Oct 2023 15:27:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85AC6F0; Tue, 17 Oct 2023 12:27:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59FD7C433C9; Tue, 17 Oct 2023 19:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697570832; bh=4FngpJTICQXkllJWNzVSnfiaHhpz1oCUaStsqDRzIi0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ujGvTkWhBLV1cd0RkE4gKTcfm274HI9jRL9ey8Ab6OZ2J8UC1rd31KXDsV5gvo+1Z vS8C+xZv9TtP0Caqj0MXjxYccgdSdBdEt1BTxCgwt7rRbLkaVJ8wbTZtTTdTS7/Gt4 qezCV6fFQUO24259O93LM2KD1l6Ri+JSuA/K3+P9gMjl+OPqzatv21zeLN+g/qolFf hvLw0l8Nt9Pc5Y9VC1s6a6n/weKs9HXOsmdWpY85PfPyCGrTyDP6llBMyx1RZDaDaU E8X7bGkauk30/CYn1DwgOT1ocZ2KBKHjygDvtbq1GyfmxPmhrxlOZcAb5o6wC6Wkg7 cjyiiL5QovqjQ== Date: Tue, 17 Oct 2023 20:27:29 +0100 From: Jonathan Cameron To: Peter Rosin Cc: Jonathan Cameron , Linus Walleij , Lars-Peter Clausen , Liam Beguin , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iio: afe: rescale: Accept only offset channels Message-ID: <20231017202729.30f2927f@jic23-huawei> In-Reply-To: <2a15c359-2a04-9a45-f30a-c7a0e4b67871@axentia.se> References: <20230902-iio-rescale-only-offset-v2-1-988b807754c8@linaro.org> <948548a0-d132-4f5c-819e-40bacb367be4@axentia.se> <20231017100539.000039b0@Huawei.com> <2a15c359-2a04-9a45-f30a-c7a0e4b67871@axentia.se> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 17 Oct 2023 12:27:30 -0700 (PDT) On Tue, 17 Oct 2023 16:00:22 +0200 Peter Rosin wrote: > Hi! > > 2023-10-17 at 11:05, Jonathan Cameron wrote: > > On Mon, 16 Oct 2023 12:05:32 +0200 > > Peter Rosin wrote: > >> 2023-10-16 at 10:39, Linus Walleij wrote: > > > > >>> Just raw (with neither offset or rescale) doesn't make sense, since > >> > >> And I don't see why not. That's the crux. > >> > >>> the AFE rescaler does just offsetting and rescaling, in that case the > >>> user should just use the raw channel. Also it would then take > >>> precedence over a processed channel (which applies rescale and > >>> offset internally) which doesn't make sense to me. > >> > >> Why isn't it perfectly fine for a device to provide only a raw > >> channel and then expect that to be interpreted as the real unit? > >> Why would it need a processed channel when no processing is > >> going on? E.g. a device reporting the temp in the expected unit > >> in one of its registers. Or whatever with such a friendly > >> register. > > > > In that case it should report a processed value to indicate that. > > It's admittedly a bit of a corner case given it's not processed by > > the kernel - there is an argument that this (more or less) only > > happens when someone has processed a raw ADC count but in theory > > that's not necessarily true. > > > > There are a few examples of drivers passing through the register value > > as processed in tree - normally when there > > is a microprocessor doing some fusion of signals or similar. > > > > Raw gets reported on it's own in a few other cases, such as when > > there are no known units - that happens for things like light intensity, > > proximity (which is often reflected light intensity). > > For those I'm not sure the rescaler is useful. > > Excellent, thanks for the clarification! > > Reviewed-by: Peter Rosin Thanks, Applied to the fixes-togreg branch of iio.git. I'll just let this sit in linux-next for a day or so before a pull request (I have a few other fixes queued). That will almost certainly get queued for the merge window given timing. Thanks, Jonathan > > Cheers, > Peter