Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3583820rwd; Mon, 29 May 2023 13:07:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IsvBtPPR6VU5rvWzYHqQqMYaIBfzFkazRiMRM7iGM+u7Mclo+Fo4Z1zjMeSN8A8o3MnAn X-Received: by 2002:a05:6a20:e18b:b0:ff:a017:2b07 with SMTP id ks11-20020a056a20e18b00b000ffa0172b07mr76182pzb.20.1685390856294; Mon, 29 May 2023 13:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685390856; cv=none; d=google.com; s=arc-20160816; b=t4cA6T08k4bz4Vk9eZ/VCsclgsxlw3dAxWDNNHREaeNUFdOL9RLAxRC5Zo8n9TWJwc Bw0kwj0r9LNC/7vU3yqgCvmWid9PxTgAD3RT/yF/+Udc9obdPDbaRh3tQiNqkOYM5Yka 1WhLix8VvR0xOpHIdhQNJaTiNhqnO079n9tGBco8s/M/+mr8tF9TM/ngO17Bv0/c9ag5 VsM5ffgpMZnJMFj03IbNS4hxvhQaD+Z0TfpfpS9mLg04IhW5zrTFL2mg+kALaiuNaH0X dgAY11dJSsqq5rRpHeSTv6Qmnr/+mPt7ClzX5H6HHBuB0+7/8qnoHkPOUlspKbxnBUub QaTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZoZf/xczibXYDWG/6Mc7Wi2iq3Itvt6yL1vaRCC+K6M=; b=kzWU0rlzC2kvwnhUs3IWk6z3ERfE/YG9Q2Q3na0YePo4w21F9L0SUK6H+x+nKemo0E JPi15Xj15v806bLqN1Sidgb3sJFzicn43mbjNWCM1TTx41twCsDC7kvPtDvlycW+BPzE zNKTyhsdYBkcX7j9oSZds7IsHNxAYlsScbeCrEyHz/NVn1T5syI3x28aCcfZjnHQSstE dMJVpC2NQWM5NfJ2eBu2nTIvgJbLHeTNJ0nJ1CuCZgVcjuen0mu5ChHrq7bwraSyzgr5 I/x/XdRhq/xHRN/qwvG/HO8SSWnnb+AZf4djVkZbYMUUit1j/WGsuOaGeh5VtMfuAJ/N J7Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=axcRkrFk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l190-20020a6388c7000000b005132342a587si9873799pgd.610.2023.05.29.13.07.20; Mon, 29 May 2023 13:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=axcRkrFk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjE2UEd (ORCPT + 99 others); Mon, 29 May 2023 16:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjE2UEc (ORCPT ); Mon, 29 May 2023 16:04:32 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13FE8CF; Mon, 29 May 2023 13:04:31 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-96fe2a1db26so663764566b.0; Mon, 29 May 2023 13:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1685390669; x=1687982669; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZoZf/xczibXYDWG/6Mc7Wi2iq3Itvt6yL1vaRCC+K6M=; b=axcRkrFkcmKzt054fs7v1UwB2jVBAxH4IyCUC/7o6SFdnJxyzj/vr0+Kv/JJ3jUhWU 0w7Bol+SfZeFjGzVCN5RLNROdzpPH9bxkLEC3lSWwPDHWhGTsDDEdkFh/PbXbzhS3NWq bc+Mo50fliHAsdS1POTT1C0o/ecVuZ9Du47v1vaG1WJbXvKZuhK1x7//E+wTKkW1vqLw tPIjejJ4UwL6h9hhj0c2orH3jl4cLuYJSI0qnNEYfF2WuQXBQLrvdg2htLb7KB6It+8o Sm98KoIp6AGtOIi2rbn3M29x214f4iu/zgX+fgdeCG0ybSLEvBvcBdywGuxHn/kuvrIO whjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685390669; x=1687982669; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZoZf/xczibXYDWG/6Mc7Wi2iq3Itvt6yL1vaRCC+K6M=; b=IxDK2aTKFfJFIO9ads5GySXQGlSug8JOn6+pIOMNQMtgZLDAFBTNk4s1tisGLY4F4T ngF4eUCHiYVvZiRTv13JHnIN76WFsNZe5sQfvgLzLOK+80jLjHUk2d14J0EisNY3/3WI Avf0uUJvnsQGcuQQJ6933F0dJVuOjGPs5E59eNzdqVYJwHTFW6ulXKCNQj3kruw8gYtg pwgquZOOQU89yLtUm4IhIwRT7kNbStZHWEXKUcJ0NAm1cl3KNISFhQZz1Fnz6q6dAONc Pj1/D5JSathgGTETC6mX1kqtupxkZtFdtv6xCUoo06vG8eRjs4A7ECtxhGWpeRU/W2KJ IBJw== X-Gm-Message-State: AC+VfDyFNKr5uUSxvXP/T+CbXC9zEhRKrTj+v9c5TQpSuWFPsxDkNkR6 GRNcCiL+9uEumFsAJiEiPapF47GfKP83VT48/LE= X-Received: by 2002:a17:907:2daa:b0:96a:6723:da48 with SMTP id gt42-20020a1709072daa00b0096a6723da48mr209616ejc.75.1685390669261; Mon, 29 May 2023 13:04:29 -0700 (PDT) MIME-Version: 1.0 References: <20230527214854.126517-1-gnstark@sberdevices.ru> <20230528161117.197f7e61@jic23-huawei> <4d5a7691-68ac-6626-5502-383fad3a9436@sberdevices.ru> In-Reply-To: <4d5a7691-68ac-6626-5502-383fad3a9436@sberdevices.ru> From: Martin Blumenstingl Date: Mon, 29 May 2023 22:04:18 +0200 Message-ID: Subject: Re: [PATCH v2] meson saradc: add iio device attrib to switch channel 7 mux To: George Stark Cc: Jonathan Cameron , "lars@metafoo.de" , "neil.armstrong@linaro.org" , "khilman@baylibre.com" , "jbrunet@baylibre.com" , "andriy.shevchenko@linux.intel.com" , "nuno.sa@analog.com" , "linux-iio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-amlogic@lists.infradead.org" , kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi George, On Sun, May 28, 2023 at 11:52=E2=80=AFPM George Stark wrote: [...] > > Based on the limited description we have here, I'm not understanding wh= y > > you don't just express this as a set of channels. One channel per mux > > setting, with the in_voltageX_label providing the information on what t= he > > channel is connected to. > > > > This is an interesting facility, so good to enable for high precision c= alibration > > but we still want to map it to standards signals. Userspace doesn't > > care that these are all being measured via the same input 7 - which > > is itself probably an input to a MUX. > > > > Jonathan > > Hello Jonathan > > Thanks for the review. > > Your idea of exposing the mux setting as iio channels is very > interesting and at least worth trying. > The sysfs approach was chosen because of the code changes are simple and > neat (compare to channels approach). > Also calibration by using those mux inputs are already supported in the > driver (performed at probe stage) so I expect very special usecases for > those mux settings like debug or device production stage tests. In those > usescases hardware specific knowledge is required anyway. Another downside to the debugfs approach is user support: If someone reports odd values on ADC channel 7 then we need to make sure to double check if the mux has been altered from userspace (the calibration during initialization ensures to leave channel 7 in a consistent state, while a user may change the mux, forget about it and then complain that values are wrong). Best regards, Martin