Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1481162pxb; Thu, 4 Mar 2021 12:27:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqBSp2Z9tYXsw/nzuCtjAd0SSHetrbwnEXFgPnT5ffs63Y/Q/4kMVmL8JYxPN76ICBv6ST X-Received: by 2002:a05:6402:c96:: with SMTP id cm22mr6444683edb.128.1614889630819; Thu, 04 Mar 2021 12:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614889630; cv=none; d=google.com; s=arc-20160816; b=OFzMsN8GV06rCj/0Y4KRaAwYLgA/GYMf00gbA22g3yCVCoW2pjIVK7JcnLuVNAtXx/ Rbq/8ipaMLkAu3fdtku+fD8LV7Yz2TtaPi21Z7vdWNtBaRGM26QkEIu+KKZvfAVc3Dyx LVPyc8hz6ZlMv220618g/QVaN6z8BkXC3HU4sPgtWkGTocuae7wibaBojtBwdRbxDZc/ WEkzKHA+u27uWfvSES9tpnRQkHJYMwdroxbMvQPAOvBv7YmHAEOye6gp4VprH0lxRtnH vu2PYSeHsAxEITX9QPzLX9sDkWwoO7bJXJtTEjJYxpT2zWiwSphbZsCiIrPz3KUXltsN 9zfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=f1o1gnNWlC/NUtDWxWJeDtEym9UtbhEVjLxvEBdBC2k=; b=D1iez9FKLUX++eeOtGYRyLF3Eenm1i4R4sBbX7OcuH2kVsOrj1XZ9gpBhQtQskNvb9 UE3rj3VH4ErYUHSKooisQOdPF+feimrLtdTIbsCag3PA4SC6mliW76ugsl2Df6zf89Ne mc84Jqvwd4gAZl2CtXW5ZdmCKAN5+u42SWqjykaVpgTTKN0VA5zdwc3UDT/Y/Mv5dSqz QjNE+yE4lqeUaEBQGa+oyK8vqvRYW/WyHJ7ADsSPAj95ZsggLSKBMsjY0lFVRHmKfnWn 9SZ91smNdO+gOdXVx8pdeHcbU0h0xJWo1xJhZAkOcwt2QDtacRYhBTsiO3Fcg9D+kBv9 JOyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=b6erdFrm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si141234ejy.571.2021.03.04.12.26.46; Thu, 04 Mar 2021 12:27:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=b6erdFrm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383735AbhCBVRk (ORCPT + 99 others); Tue, 2 Mar 2021 16:17:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1580756AbhCBSVK (ORCPT ); Tue, 2 Mar 2021 13:21:10 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88EB5C0617A7; Tue, 2 Mar 2021 10:19:23 -0800 (PST) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 0F0B22223E; Tue, 2 Mar 2021 19:16:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1614708977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f1o1gnNWlC/NUtDWxWJeDtEym9UtbhEVjLxvEBdBC2k=; b=b6erdFrmE04Jmxg6LNKxUmw4U3GdXeLpLqt0J0FwK4Qui+KQdy0FiuRTezzE76+7npughH Z2UIBUiRtY+tNDO2opH0zfTRLRCZLGsEuFcxco8cx9wRNRcadivkWpegmeX24S5JyQujIJ HNqomz7cXV1wEL0JxfJqSNZTDPKk1aI= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 02 Mar 2021 19:16:16 +0100 From: Michael Walle To: =?UTF-8?Q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpio: regmap: fix direction register check In-Reply-To: <20210302180621.12301-1-noltari@gmail.com> References: <20210302180621.12301-1-noltari@gmail.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-03-02 19:06, schrieb Álvaro Fernández Rojas: > If there's a direction register, we should also have dat or set > registers. > However, we only need one of them, not both. Can you give some more context or an example? If there is a direction register, we'd need to set and get the value, no? -michael > Fixes: ebe363197e52 ("gpio: add a reusable generic gpio_chip using > regmap") > Signed-off-by: Álvaro Fernández Rojas > --- > drivers/gpio/gpio-regmap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c > index 23b0a8572f53..5a9fca00b5e8 100644 > --- a/drivers/gpio/gpio-regmap.c > +++ b/drivers/gpio/gpio-regmap.c > @@ -194,7 +194,7 @@ struct gpio_regmap *gpio_regmap_register(const > struct gpio_regmap_config *config > > /* if we have a direction register we need both input and output */ > if ((config->reg_dir_out_base || config->reg_dir_in_base) && > - (!config->reg_dat_base || !config->reg_set_base)) > + (!config->reg_dat_base && !config->reg_set_base)) > return ERR_PTR(-EINVAL); > > /* we don't support having both registers simultaneously for now */