From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 882A8C43603 for ; Tue, 2 Mar 2021 21:30:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4186864F2C for ; Tue, 2 Mar 2021 21:30:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383844AbhCBV2R (ORCPT ); Tue, 2 Mar 2021 16:28:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835141AbhCBSWm (ORCPT ); Tue, 2 Mar 2021 13:22:42 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37E74C061221; Tue, 2 Mar 2021 10:22:02 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id h98so20896623wrh.11; Tue, 02 Mar 2021 10:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=AQZcXfo9G8LYSteYT7WgoA4705B6+cwG5ceOPpfI2d4=; b=XIV83jFogb46lKfrgPuVxB/tFK0vWOCkKWI13X9lyiPtf8qEEBZWiTabOC9JOa3a7R qnBXcLYuM2xPstI1EcIVEvB6Fy6PiTw7alSXwFlPQdvIGLupwPXHwA5sUW1mpGGia3MH Se3qfIFC18lNh3Xk/UbrUnuEoc5R3iy07GGN7iSz4ue0IRBEt63iu8UtfGfMmWX4dw7Q tEuQuewux4gLQGBVstMpSd+zxg1mgo+3P4pqBjpcvG63V75KoP+0BhaBnqN99eKY7zZl jXm5ifxaKbY83wouO0baO1zyNtFtAaa+zCC9JNgwevOnJF3iRLxz2Px0nOXr8OB9M0wv qiVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AQZcXfo9G8LYSteYT7WgoA4705B6+cwG5ceOPpfI2d4=; b=gPCTHe0dP4RRWaEMipJFGpwKhBNC40rCyKeqyY452pqAjPsD9J3PKHYL/t4QVGuoHB pV40tJkq8J3NHnQHQUpfh+xxnumA/qT/i1ySKmGn19pvehh7hfXQiGa88AkfmVH0ztn0 FHC/ewHh/y+ivj72pMxj/mqRg1oKpJBSVSnnEHWZNhnxWQGwtV3Z4O8aBmWjWKKdA/P/ bXr8okrELFvBZQLx+YSZrhQEcKDzpvWrlN3R866JX0l0j+Sn07XShlqkddrFbrRsYGaB J6JnzqoczSugRXKhm6KnMLa4yvvnIEVrDiQ5/p1plEXtClZJaThADC9v0d/LSXRcPgit 6W3w== X-Gm-Message-State: AOAM532Eo53g2U918qo4bNsKWD3AfvhB09v0Yh2ICgHW4oNCvOvAJNUi A1em6XOicFI4z1fKQbUeKuJZiteqGfMuzQ== X-Google-Smtp-Source: ABdhPJzGv6nlyivrup6XRDHj9bD9muewR9tZMzPIZYbK67oH8JrdLMi+RfLEOQvPJhPoOPYtms6HHg== X-Received: by 2002:adf:f3c2:: with SMTP id g2mr17115509wrp.300.1614709320670; Tue, 02 Mar 2021 10:22:00 -0800 (PST) Received: from [192.168.1.10] (170.red-88-1-105.dynamicip.rima-tde.net. [88.1.105.170]) by smtp.gmail.com with ESMTPSA id h2sm35071052wrq.81.2021.03.02.10.21.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Mar 2021 10:22:00 -0800 (PST) Subject: Re: [PATCH] gpio: regmap: fix direction register check To: Michael Walle Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210302180621.12301-1-noltari@gmail.com> From: =?UTF-8?Q?=c3=81lvaro_Fern=c3=a1ndez_Rojas?= Message-ID: Date: Tue, 2 Mar 2021 19:21:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hi Michael, El 02/03/2021 a las 19:16, Michael Walle escribió: > 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? I've just realized that I need to set reg_set_base to the same value as reg_dat_base in my case. Please, ignore this patch and excuse me :$. > > -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 */