Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp4020872rdg; Wed, 18 Oct 2023 12:26:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHME08Rok2Q/I8eY8vtuZ7VMCgHeXELoF1f3Dw5hMEXr/LRCmeGuUpKasBLKFQOZJ+0mH/p X-Received: by 2002:a92:ca8b:0:b0:351:526a:499 with SMTP id t11-20020a92ca8b000000b00351526a0499mr300241ilo.20.1697657185572; Wed, 18 Oct 2023 12:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697657185; cv=none; d=google.com; s=arc-20160816; b=VQwn2ijsm5W+0DLF+xaXYJ/abXPgBTHoGFzZjTIB9Zk/UwsSBKeEg7+bmlT8p2Svz+ QHRcmEbBEW4Lq0QdkpvTpCjfYxi1nW6l/ZzakL1zVsJ3FaZQ0RcPlZXA1ySMRPExiAJp 0HfpcEiylaElxY3V6YrtDrLmWZATsTx0bhDy8UxqISeCrUbjczlJYXnKef+xJZwsXOgC WlLUVTJ69b029nvRM4ZXB3tMbZX4JEnDdOYYXvRD0YiOtdLlMbA/K/swfgsmDJ14ayTD fcmIA5Nlh94m/rD9OJRcSSq67aj6mymWryxhHMnL1wOnKeNPkDrQMi9XgI/Jlr/6FHX/ 2Rsw== 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=s2ngzGzPGSrCI+xnzIaAMR76vEScCOkHTwOdCoc95lc=; fh=MdsNSt7fQN2VoE98D8BAap2/28yev3E1Agni4bcfKPQ=; b=HP6yYX1kN0Ib1jFBwJjRWj2Wu52osBChWRaLjma0BUBSMvzshLEbvIwlTclGFv2u7o eIqxYXHCDBK225FvQMEjr5IPH5rTzbcXNEjMV5iTXAOUkyO7ClV6fG+g2VwRi4WRn2zB 4Gtb2bDHiClCkHdGXGe8+/13NhMkf+E9fKhLo43ii4jr5/K0TmYwmz/VXqAg6lSv7UOK ejuQN9R+XCtwbr7/PgkQ3B5c10PkzN7C7aUneqcrhvFSXfeSu7d3xRiWnebPafVFc2JW Fw0ct8Y3WjWvBSHik4CgySIuBWwJhfM3mZrra9wyaAlECHP6Xd6GoqTxoW4CxV8zukQL VRtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QCOCwf50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id cl8-20020a056a02098800b0057760853706si2991739pgb.578.2023.10.18.12.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 12:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QCOCwf50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 8557A80D6530; Wed, 18 Oct 2023 12:26:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230296AbjJRT0F (ORCPT + 99 others); Wed, 18 Oct 2023 15:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjJRT0E (ORCPT ); Wed, 18 Oct 2023 15:26:04 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDCA1114; Wed, 18 Oct 2023 12:26:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73075C433C7; Wed, 18 Oct 2023 19:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697657162; bh=KdcsujksQHyrzxhuXt0JsGbIZwYjzMf7Cl5PwnuaNfo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QCOCwf50YrIZn7X8ONxC2wDPaQeZrid9Q64Vtt/ze5RTK2wOgCFRIGkiaaY6A9hku 74BM9XqFpJe+GuPYX2peUYrB2zAv+hCbA6ehcAVR1Qw6AAvFEy3SRzr9ap3GvBIVgg F9kZpitxS3szsuI7bBWpUSk2k4Dudnf4WUIRvHBNpd8y8vsBJwy2ojZhYVQ/UAHHcE JYcncAAMq++oSMsfVX4SyHtGvEGD4G0z23qqu0X/i1G/VCivG+WGkh0ijdNkdoxgjl B7+TRt7W6Z8ewrW4Avof17k57353fWS76eMWJvSmiofzfYRiphlNiQJKKFBE0JEFi9 UWtqBIYcHIP+g== Date: Wed, 18 Oct 2023 20:26:22 +0100 From: Jonathan Cameron To: "Hennerich, Michael" Cc: David Lechner , "linux-iio@vger.kernel.org" , "Sa, Nuno" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] iio: resolver: ad2s1210: add reset gpio support Message-ID: <20231018202622.335331d3@jic23-huawei> In-Reply-To: References: <20231016154311.38547-1-dlechner@baylibre.com> 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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 18 Oct 2023 12:26:22 -0700 (PDT) On Tue, 17 Oct 2023 13:46:51 +0000 "Hennerich, Michael" wrote: > > -----Original Message----- > > From: David Lechner > > Sent: Montag, 16. Oktober 2023 17:43 > > To: linux-iio@vger.kernel.org > > Cc: David Lechner ; Jonathan Cameron > > ; Hennerich, Michael ; > > Sa, Nuno ; linux-kernel@vger.kernel.org > > Subject: [PATCH] iio: resolver: ad2s1210: add reset gpio support > > > > > > This adds support for the optional reset gpio to the ad2s1210 resolver driver. If > > the gpio is present in the device tree, it is toggled during driver probe before the > > reset of the device initialization. As per the devicetree bindings, it is expected for > > the gpio to configured as active low. > > > > Suggested-by: Michael Hennerich > > Signed-off-by: David Lechner > > --- > > Acked-by: Michael Hennerich Applied and pushed out as testing for 0-day to poke at it. Thanks, Jonathan > > > drivers/iio/resolver/ad2s1210.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/iio/resolver/ad2s1210.c b/drivers/iio/resolver/ad2s1210.c > > index 8646389ec88d..a414eef12e5e 100644 > > --- a/drivers/iio/resolver/ad2s1210.c > > +++ b/drivers/iio/resolver/ad2s1210.c > > @@ -1426,6 +1426,7 @@ static int ad2s1210_setup_gpios(struct > > ad2s1210_state *st) { > > struct device *dev = &st->sdev->dev; > > struct gpio_descs *resolution_gpios; > > + struct gpio_desc *reset_gpio; > > DECLARE_BITMAP(bitmap, 2); > > int ret; > > > > @@ -1481,6 +1482,17 @@ static int ad2s1210_setup_gpios(struct > > ad2s1210_state *st) > > "failed to set resolution gpios\n"); > > } > > > > + /* If the optional reset GPIO is present, toggle it to do a hard reset. */ > > + reset_gpio = devm_gpiod_get_optional(dev, "reset", > > GPIOD_OUT_HIGH); > > + if (IS_ERR(reset_gpio)) > > + return dev_err_probe(dev, PTR_ERR(reset_gpio), > > + "failed to request reset GPIO\n"); > > + > > + if (reset_gpio) { > > + udelay(10); > > + gpiod_set_value(reset_gpio, 0); > > + } > > + > > return 0; > > } > > > > -- > > 2.42.0 >