Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp292812rwr; Thu, 4 May 2023 03:12:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7SzGMI7xiuveuJctZnWnmZqE9vyjpRRsZD7quCvMeIRQ+qHBCtzHkPNOfUVlcRcgrIWsgX X-Received: by 2002:a05:6a20:8e0e:b0:f2:5c65:b767 with SMTP id y14-20020a056a208e0e00b000f25c65b767mr2161384pzj.42.1683195164075; Thu, 04 May 2023 03:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683195164; cv=none; d=google.com; s=arc-20160816; b=AGdhmjFlaf599+ZXwBbPyg12/2UC3Q5npDOE0PVdZi15/50Cz/RCUXo/9sgcxJwEDq 0KSGhLg5WQ5UyzG/OcltkYdwsflaIf67Fde4i04NjrggrH6qwLuhVHMFsuFeGkF+Gw3j foqd+t2xNMVANGUHSU8nMqBm/VbDMHpxvaxi5HAIMy2Dx5+FFH+klzohsTu5wLgL4HxI D5Ntpwhx9pBHR0rSDkHSgrpuTHNt3u5McIXltfPu62LwVyrLFZe3Ug5gzFhDkqDdnhg+ bsCeB16QwukgIBO8b62EtUzNYamPmg+3CTA37uErF128ndN5KagLCjTJWyWl8c38ds16 OOaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kZAmyScVrPkNsLXEK4fdZlXng8x+vclTeru2m98xpxE=; b=YGZ8Q0oBfjehyWMiDRwoiWm6+We8puEoCsnRJAZZ2THMV3hi33stN0ednjc7RE/X/G NoKOaUJI9jPi1VLVm7z9gub5p3US/6+u9GZ3Ugvp06Yulhm0fSxzSmKmUOqYKBAVmvcY Pg/PTqZ8GUqIPPJNGxyhfRoGu/eearHHwgT++bFNUioKvbAjgZBF+GpIQgjd8OkVqxAG he/Oz99Z/4wqb9egS3ahm0a2PTArHpOluODtYaIfp/X3eFZ95pwiI51TUgPL1qup8fqW 0Vod7djCEWmkH4VoY/odOsD80qQexWCkw+rPUSsROYjL5bOKRv/MR6R6+0KjuUkBdNmx jMNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=CBQ5pnH4; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a15-20020a631a0f000000b0051892919b7csi34038429pga.420.2023.05.04.03.12.32; Thu, 04 May 2023 03:12:44 -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=@rasmusvillemoes.dk header.s=google header.b=CBQ5pnH4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229745AbjEDKJA (ORCPT + 99 others); Thu, 4 May 2023 06:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjEDKI6 (ORCPT ); Thu, 4 May 2023 06:08:58 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B567349E7 for ; Thu, 4 May 2023 03:08:56 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4efe9a98736so324127e87.1 for ; Thu, 04 May 2023 03:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1683194935; x=1685786935; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=kZAmyScVrPkNsLXEK4fdZlXng8x+vclTeru2m98xpxE=; b=CBQ5pnH42Ohd94dxCUEAgcTs58Bjj2cHsGwgZqaQRB1t868kD083pQ/dkTMp0CVbCI wU+okdwCaH+BD1/AFcfRb+tunxG5rFb55SPdH4m8Ztc4m2Im2woixI7M8KuXHnyGNWZ3 8Oun4DSjxuKQShBi6RfHenX1YpAUJNYU+D880= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683194935; x=1685786935; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kZAmyScVrPkNsLXEK4fdZlXng8x+vclTeru2m98xpxE=; b=Qzvl1mWdyzGkGjlcT/ckCYgzjSPEof6xNHRoa4X7gw4n60mcTZoIQ+6dms0UVLuQhn fvqD8WyvbasGfBbwCG/Mk4bC12/JyWplS+RrUIyN4EBzW9uWw1f007I6D5wen31eGaCu g4y0p4btcfElYAIEaK72Buf3yNm4hyX0/bkbZKxMXAIs1+XybVj5pyLYiKEeJeoldmGu 0CEX9G12Q5CsMGw52EK57qPNUxT6zj/JBOsLCuzBhn3R+ze4rWFpcBceJgBwWMAyzLN6 kNWh2tCvGqjVqT901ZCAcS+zMP/2dbJeiNua0gjGaxDW92U1dyRY5G8SGZ7iAE1Rweka tKgw== X-Gm-Message-State: AC+VfDzFoIZoiI/Y0jGz2SRnh0caQm52Yo3pSDzi2IojrhMg3lCKLxE4 RhN05wj2FV9ErsEEXKHqfBcT/g== X-Received: by 2002:a19:f012:0:b0:4ee:d766:5bf7 with SMTP id p18-20020a19f012000000b004eed7665bf7mr1522854lfc.13.1683194934919; Thu, 04 May 2023 03:08:54 -0700 (PDT) Received: from [172.16.11.116] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id k26-20020ac2457a000000b004f11eb32f20sm2214028lfm.13.2023.05.04.03.08.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 May 2023 03:08:54 -0700 (PDT) Message-ID: <6fcf4997-9d88-7e86-70f7-52f9d296bc6e@rasmusvillemoes.dk> Date: Thu, 4 May 2023 12:08:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] iio: addac: ad74413: don't set DIN_SINK for functions other than digital input Content-Language: en-US, da To: =?UTF-8?Q?Nuno_S=c3=a1?= , Lars-Peter Clausen , Michael Hennerich , Cosmin Tanislav , Jonathan Cameron Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230503105042.453755-1-linux@rasmusvillemoes.dk> <27fe41e402ea0d6ef42aa0ac80aa3d1488862cd8.camel@gmail.com> From: Rasmus Villemoes In-Reply-To: <27fe41e402ea0d6ef42aa0ac80aa3d1488862cd8.camel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 04/05/2023 09.28, Nuno Sá wrote: > Hi Rasmus, > > So, I'm not really that familiar with this part and, at this stage, I'm being > lazy to check the datasheet. Well, the data sheet is not particularly helpful here, which is why I ended up with this mess. > My concern is about breaking some other users... I highly doubt there are users yet (other than my customer); this binding+driver implementation only just landed. > So, does it make any sense for having drive-strength-microamp in a non digital > input at all? That's the problem with the data sheet, it doesn't really say that the DIN_SINK register has any effect whatsoever when the channel function is set to something other than digital input (either flavor). Perhaps it does hint that setting it to something non-zero is probably not a good idea, because DIN_SINK is automatically set to 0 whenever the channel function is set/changed, so one needs a good reason to change DIN_SINK afterwards. We just experimentally found out that when we added the DIN_SINK to fix the digital input functions, when we got around to testing the resistance measurement function that ended up broken due to the non-zero DIN_SINK. > Can anyone have a working device by specifying that dt parameter > on a non digital channel (or expect something from having that parameter set)? > Or the only effect is to actually have some functions misbehaving? The data sheet doesn't say that the DIN_SINK should have any effect for other functions, so I'm pretty sure it's only the latter: some functions misbehave. > On the driver side, if it's never right to have > these settings together, then the patch is valid since if someone has this, his > configuration is broken anyways (maybe that's also a valid point for the > bindings)... Yes, I do believe that it's a broken description (whether or not the bindings specify that), and drivers don't need to go out of their way to validate or fixup such brokenness. But in this particular case, there's really no extra burden on the driver to not put garbage in DIN_SINK when a not-digital-input function has been chosen (the patch is a two-liner with 'git show -w'). Rasmus