Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5226491rwb; Mon, 14 Nov 2022 00:57:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf6spH3hEwIYtYhoa+/HuJ8izBQF+BRs8OcLF1FvuSMmSy9qF/2twGVf9l+SQJWJRiATjIDD X-Received: by 2002:a05:6402:228f:b0:461:96fe:9fb4 with SMTP id cw15-20020a056402228f00b0046196fe9fb4mr10351085edb.373.1668416273703; Mon, 14 Nov 2022 00:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668416273; cv=none; d=google.com; s=arc-20160816; b=AVeqHtVcMqgBKkHLlaawL+C093e9axbhaG1b9duBVIO1RJkl45jAKtAj4WOaS8PPm5 f1xkA/juxFWXPVk/sC9HVbdo4ByuFu5nUOgJJP8GQHT+VhGaKdafOu7y7VXqzlE02ptG NagwLpjREh7yWOVFz4jmROUyXWYOE66Ad8UUt5/wUKq2H3vHliBMPud68zGHFsC29IuS gpp66PGgWlpJahxZehJbJkV8AmGyHtTaDZk5axr7V0JFizgDcWGnyMooQ782dWyZ6dJk vFwGpuzN+MmiXAZX26LCb1BdWxyJQ9HAHOX29gI4CwfKRiQiEjyKpMwm7fwWDdQlUJDk fB2A== 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=F65D6wP7x5X052MyNJlEyUIkEOJA9df83maNEAxoFlA=; b=a0lXtWwBsYi1kj3vsxrpAZB73oPJJkxsbfAQG7VnueyC9fbUfMRd6WjsCgzX8DXKHE B8YjFKc4LkyEdcOKP/iYArWD/2G36sKEMzJx2S/J3Q6/QIpto2eDnOrTOH6sC6F0JtMf 8QAMnmgEpLMW9MntxvQT2IZEyzqgBSZiP/9rzMKxe7qEiCzFWtatYGMzJCg9rYZqrhAx GU71a6AG3NFE7Dn1J+GmT7Do/6NMVDw8LzLzEFxpwOvDwsE+ygNVGCLuyGpzbw9akAp3 RTKkSaJnMFU23Q8EbVs6+Qg2SBAyYa32p8ilHbDIdi2ZB3krBSGE/87/ML7av6f4VxPA B46w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=SLmbNisf; 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 xj1-20020a170906db0100b007af039d0bcasi1810075ejb.429.2022.11.14.00.57.31; Mon, 14 Nov 2022 00:57:53 -0800 (PST) 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=SLmbNisf; 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 S236569AbiKNIiK (ORCPT + 88 others); Mon, 14 Nov 2022 03:38:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236567AbiKNIiE (ORCPT ); Mon, 14 Nov 2022 03:38:04 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD7A11C130 for ; Mon, 14 Nov 2022 00:38:02 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id s8so972489lfc.8 for ; Mon, 14 Nov 2022 00:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; 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=F65D6wP7x5X052MyNJlEyUIkEOJA9df83maNEAxoFlA=; b=SLmbNisfEZa220qEeUcjMkOX0OV5NIOEAYcv6i8c2pEfdzWPz1IYCjzmOV5S7AEv0z E3Zkiqc1yNufmA6OcAvnrrVehhgRO68E22W/FMgZytjQddxngoW8+mC9Dh14GuCm8eBh lX9RU8d3O5TmkRHRTg9NlYpD8dUi/EVl4ZyVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=F65D6wP7x5X052MyNJlEyUIkEOJA9df83maNEAxoFlA=; b=K/zuiQwsvTCrvb5mVhspNIvC1KSI/BRwfuSmM035ZpCtrFAxLolOoeKVouO4pgpcUJ g36oQ/wH7iijOPkMuQFc+VjEGP8oEDWQXnRgJPnRgFnkUyyu/nImoj1ZsfHM8vagSiYr Vw4JQNPqhkkSGezuQCWEuTq/xgpuvcHgCIhhQfpxmoYjFW5Zrhuj/fhJ3eLhFgG5bMWO smEFXczdc1NBo7mrbRcxTfsByIUlthU26023Icbb0sIBPI6eMXrsXrqecJygKxEvX8hq tzuiErHwSl8oxmbhnrceEFlQapRQSDpfLX4iStjXLiLKtpKzS463JvyqxepntEyGRMYf txUw== X-Gm-Message-State: ANoB5ploxep/9ioiAUiyKPmqlaVcT6M2rGJZA1Me/znC+Mq9L8KjpwL8 i0FVZetXZr5cHyeOii7RS60hQw== X-Received: by 2002:a05:6512:3f9:b0:4af:baf9:7d4 with SMTP id n25-20020a05651203f900b004afbaf907d4mr3584746lfq.460.1668415081088; Mon, 14 Nov 2022 00:38:01 -0800 (PST) Received: from [172.16.11.74] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id bu42-20020a05651216aa00b004aac3944314sm1732284lfb.249.2022.11.14.00.37.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Nov 2022 00:38:00 -0800 (PST) Message-ID: Date: Mon, 14 Nov 2022 09:37:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 5/5] iio: addac: ad74413r: add support for reset-gpio Content-Language: en-US, da To: Jonathan Cameron Cc: Cosmin Tanislav , Lars-Peter Clausen , Michael Hennerich , devicetree@vger.kernel.org, Rob Herring , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221111143921.742194-1-linux@rasmusvillemoes.dk> <20221111143921.742194-6-linux@rasmusvillemoes.dk> <20221112170705.7efe1673@jic23-huawei> From: Rasmus Villemoes In-Reply-To: <20221112170705.7efe1673@jic23-huawei> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 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 autolearn=unavailable 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 12/11/2022 18.07, Jonathan Cameron wrote: > On Fri, 11 Nov 2022 15:39:21 +0100 > Rasmus Villemoes wrote: > >> We have a board where the reset pin of the ad74412 is connected to a >> gpio, but also pulled low by default. Hence to get the chip out of >> reset, the driver needs to know about that gpio and set it high before >> attempting to communicate with it. > > I'm a little confused on polarity here. The pin is a !reset so > we need to drive it low briefly to trigger a reset. > I'm guessing for your board the pin is set to active low? (an example > in the dt would have made that clearer) Hence the pulse > in here to 1 is actually briefly driving it low before restoring to high? Yes. I actually thought that was pretty standard. I do indeed have something like reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; in my .dts, so setting the gpio value to 1 (logically asserting its function) will end up driving the signal low, and setting it to 0 (de-asserting reset) will set the signal high. I will add that line to the example in the binding. > For a pin documented as !reset that seems backwards Well, it depends on where the knowledge of the pin being active low belongs. In this case, the driver itself handles the gpio so it could be done both ways. But if, for example, the iio framework would handle an optional reset-gpio for each device, it couldn't possibly know whether to set it to 1 or 0 for a given device, it could only set it logic 1 to assert reset and then rely on DT gpio descriptor to include the active low/high info. Also, see the "The active low and open drain semantics" section in Documentation/driver-api/gpio/consumer.rst. Rasmus