Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3221519rwe; Mon, 29 Aug 2022 07:52:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR4XRmxdJsKX0O3N57wri+NlC6rvT01IUuSZDkjQ2osrvMamScBOO3RX9ICA0vst0RtIux8m X-Received: by 2002:a05:6402:14c6:b0:448:e27:5974 with SMTP id f6-20020a05640214c600b004480e275974mr10356043edx.53.1661784750973; Mon, 29 Aug 2022 07:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661784750; cv=none; d=google.com; s=arc-20160816; b=wsWikcENJJgfTTM2NnC7mYmM0+gJTFb1M2T4j7iQqROuSTFJfvhuyqfUXawZ6TdwIu XEqTZ36D3PkNOeLuW3cI6p7GB1qFnXA7JsUhXjZsNj2zDlVKdvQqLb8uKQzUyGvYVZIz vVySkiXh56H6Zh/x4kaPfobzBlFzlbuq6G1BA29fsrZDU0I6v67rzxmwg6r5uE6P7hbD nL4zBt8yNIPDvoelOJcirzwlZdxpKGt6nIDpROPpF0NB2h2+AzYUDttV43SpD0Do1eHk Co4XZhE3GpRynv92f67abHInoa8RbaTawcgGwNYi9wd0cKa1w6TxGHrI3MT8l/3JAtQ+ B8cg== 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=yvzBhVio+BKTjY35wyzJyEdEDMk/JWzafRam6JTX5TU=; b=Kaa6OCEZoRowHD0UB5ym3TzzlcK6KJOoEWVALF3jf5xYJ+YzBnZduHlqC532WR3tsR Hzz0HGK1MNcwBVDHSZDAq31kfYYsi4nq+jeeBsvXH43En4OBcneTD7S3zrjtgqL8sl7F aefQp8sL5VR5r0fj8PnS/X8VPGGVf7E1GD9MsrS6bBlEDF1jk2gomTWGbvueAT/eiKhG O2CNaTxzeCX49BlZ5Q2WVSpCqr0XhImX0cEOfH9NeDA28LXhDL1MA4uPN55WzoYjjXYm yE5PxgrnUTnCHIP29tJ3r/DMCGtFym4SZ4dMJqiHJP94lZle78pik7HeHqfKRe0CTnXu sIRg== 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 nc30-20020a1709071c1e00b00730a21eaa9dsi7214915ejc.760.2022.08.29.07.52.05; Mon, 29 Aug 2022 07:52:30 -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 S230109AbiH2OVn (ORCPT + 99 others); Mon, 29 Aug 2022 10:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbiH2OVl (ORCPT ); Mon, 29 Aug 2022 10:21:41 -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 5DD078769E for ; Mon, 29 Aug 2022 07:21:38 -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 1oSfdw-0008Vp-3l; Mon, 29 Aug 2022 16:21:36 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oSfdv-00060Y-Gz; Mon, 29 Aug 2022 16:21:35 +0200 Date: Mon, 29 Aug 2022 16:21:35 +0200 From: Sascha Hauer To: Marco Felsch Cc: linux-gpio@vger.kernel.org, Linus Walleij , linux-kernel@vger.kernel.org, kernel@pengutronix.de, Bartosz Golaszewski Subject: Re: [PATCH 1/2] gpio: Add gpio latch driver Message-ID: <20220829142135.GB24324@pengutronix.de> References: <20220825094132.1268174-1-s.hauer@pengutronix.de> <20220825094132.1268174-2-s.hauer@pengutronix.de> <20220826055306.tdsmdambl6fjoiop@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220826055306.tdsmdambl6fjoiop@pengutronix.de> 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,T_SCC_BODY_TEXT_LINE 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 Hi Marco, On Fri, Aug 26, 2022 at 07:53:07AM +0200, Marco Felsch wrote: > Hi Sascha, > > nice patche, please see inline. > > On 22-08-25, Sascha Hauer wrote: > > This driver implements a GPIO multiplexer based on latches connected to > > other GPIOs. A set of data GPIOs is connected to the data input of > > multiple latches. The clock input of each latch is driven by another > > set of GPIOs. With two 8-bit latches 10 GPIOs can be multiplexed into > > 16 GPIOs. GPOs might be a better term as in fact the multiplexed pins > > are output only. > > [snip] > > + > > +static void __gpio_latch_set(struct gpio_latch_priv *priv, unsigned int offset, int val) > > +{ > > + int latch = offset / priv->n_pins; > > + int i; > > + > > + if (val) > > + priv->shadow[latch] |= BIT(offset % priv->n_pins); > > + else > > + priv->shadow[latch] &= ~BIT(offset % priv->n_pins); > > + > > + for (i = 0; i < priv->n_pins; i++) > > + gpiod_set_value(priv->data_gpios->desc[i], priv->shadow[latch] & BIT(i)); > > + > > + gpiod_set_value(priv->clk_gpios->desc[latch], 1); > > + gpiod_set_value(priv->clk_gpios->desc[latch], 0); > > Your have two access function for _can_sleep and "can not sleep" but > here you don't resepect it. I thought the gpio framework would pick the right implementation automatically. Apparently it doesn't. Will fix in v2. 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 |