Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp802766rwb; Thu, 22 Sep 2022 06:39:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NzWvtEQFP4H2rDeQT8MO9No5i5rnJNAgYrtoKOBX2IePZQSzsnFpxWVZh01c+sSD2GBlg X-Received: by 2002:a17:903:32cb:b0:178:aa59:274d with SMTP id i11-20020a17090332cb00b00178aa59274dmr3385457plr.119.1663853939939; Thu, 22 Sep 2022 06:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663853939; cv=none; d=google.com; s=arc-20160816; b=pJWAz8Uk10LdSHvgWLhWasBXuQF0F5Wdg+ClxUCMR48GTS5Ah0Bp/7vzW5tFVg/2dQ 1cKcSmX+7iNK7UYJNk4yHgQoBpmLvMs9ppQJYZo4S3b8Rwup4BVVU8eR1EFeMvWwVWuP x0g4pN+EAiFLgDf9o8DYlqZK9/QzxWBmQQiN/Ma6eyFF7ylb7GWDVPefnJzUl0l1UwZD ueNGToNOnQz6iRKoPSk03W7gzXX3QOcj4rPpw1s++qzgjmPwdLN117R6FxsefNBmn2ys Zx48n5YJogni1UoEj1jJqXdL5YVVTf+7fmD1wPnRNWtEUDmHxrWnKp8EKuR9w0YNTSYT jJGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=aGYzBUmemuBTFGd1nE+tPUqrJOnzRXR6q6f0LkUIc8g=; b=eAC1G2uneEHkAk5NLaa9YnC1fj0z6kCH2Tx14/DUpEN2RpN4TThPexedOKaAzgZWLq h1fHfb3CsJWxhdHZjmg7CTech5PNxIMvB4iq2zsDpo5uzj3fgjgZu6kAXDb9OtwufZ1t W2HPT8Kvhi0l/5n4ueRiXvOZ8LljhDM42im1UYlh1X4EF8tUOkEstdoJdH9TvzLlxc5s R2tdbyEubrE/46c7bRbgUMGVp7xbzGqysNBtQPhoQ0UXjGM8a6/cZD+VG23vvNjuo7zK f6cwnsEXs/MrXZ2LaVTFt+WQT1xnXmJoLmvSd7UHG902COWdtyHTK3TxfXPPVbvI77Ue 4Ndg== ARC-Authentication-Results: i=1; mx.google.com; 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 q14-20020a056a00088e00b0052b206007bcsi6981372pfj.237.2022.09.22.06.38.48; Thu, 22 Sep 2022 06:38:59 -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; 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 S231522AbiIVNbS (ORCPT + 99 others); Thu, 22 Sep 2022 09:31:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiIVNbL (ORCPT ); Thu, 22 Sep 2022 09:31:11 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E365D4DDC for ; Thu, 22 Sep 2022 06:31:10 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1obMIE-0005Jr-0M; Thu, 22 Sep 2022 15:31:06 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1obMID-00072j-AZ; Thu, 22 Sep 2022 15:31:05 +0200 Date: Thu, 22 Sep 2022 15:31:05 +0200 From: Sascha Hauer To: Serge Semin Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Bartosz Golaszewski , kernel@pengutronix.de Subject: Re: [PATCH v3 1/2] gpio: Add gpio latch driver Message-ID: <20220922133105.GN986@pengutronix.de> References: <20220914071306.3254881-1-s.hauer@pengutronix.de> <20220914071306.3254881-2-s.hauer@pengutronix.de> <20220914140310.5ffrnsy63piegdyr@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220914140310.5ffrnsy63piegdyr@mobilestation> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 Wed, Sep 14, 2022 at 05:03:10PM +0300, Serge Semin wrote: > > + unsigned int offset, bool val) > > +{ > > + int latch = offset / priv->n_latched_gpios; > > + int i; > > + > > + assign_bit(offset, priv->shadow, val); > > + > > > + for (i = 0; i < priv->n_latched_gpios; i++) > > + set(priv->latched_gpios->desc[i], > > + test_bit(latch * priv->n_latched_gpios + i, priv->shadow)); > > -> duration? > > > + > > + set(priv->clk_gpios->desc[latch], 1); > > -> duration? > > > + set(priv->clk_gpios->desc[latch], 0); > > I am pretty much sure there must be some duration between the actions > above *. See for instance the tw and (tsu + th) timing requirements in > the next edge-triggered flip-flops: > https://www.ti.com/lit/ds/symlink/sn74lv74a.pdf?ts=1663163389954&ref_url=https%253A%252F%252Fwww.google.com%252F > > The durations are normally small (ns or a bit smaller) but still need > to be added anyway. > > Note since the durations are device-specific an additional DT-property array > with durations should be added too. Do you think a fixed udelay(1) would be enough for now? Bigger delays shouldn't be needed and smaller delays expand to udelay(1) anyway on architectures not providing an architecture specific ndelay(). Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |