Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3137726imu; Wed, 7 Nov 2018 05:46:02 -0800 (PST) X-Google-Smtp-Source: AJdET5eJMyUbTqKBt/g4ZaEwUy5Z4Tt/rt6ut9aXNGAygDzW7nFShoPv4jii+BT7dyNVYO15OsLK X-Received: by 2002:a62:29c4:: with SMTP id p187-v6mr295726pfp.62.1541598362211; Wed, 07 Nov 2018 05:46:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541598362; cv=none; d=google.com; s=arc-20160816; b=NAadXoKcw7bXpOD8G/9Gpyyf7IN4g5scwXL2k9DkkId3nzrlz9Ui1XMArB31u5gtIl +71GRB8xMqVOeO9LGsxrJIsve5FrGTYZYwR8yxEqPy+IwfyqYGfSFJY3Q+gaipohWBum zwOLlRnd93hYyQevcMihVmWPYHL8Lhim4Gk1h+DssneFfvO8VvqZ9gyeFDN6dEwMXWJ1 MZMHEMtT9r9UBOxeCJ5gnDj8h/fCRB+jH4w54ZL626wvEm6Ada7kZ8PUDerjaatd9qbD 8YKwl9/TvqTNtQpIrNFd9vNL+7JIMpeykJYM5sljocM95jHcTaiccrMD99aAWhRuQEfb Y5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=0CIzE+94aSTrH6CLTD189GZFRz5460byBfejEvTQjpo=; b=bnrCFoDpeh7x2Ib8+8yIvEWntkgpo+ntcW+8ue7RulilT4VD6W+qHo2XEleEKAJwwW gDY8HZj/MtsW0K0atmsmR2jv189FESEXN7Jn/D97tesj8Vf3wA9DEb00g7BHIhjvLHHJ pvJjfkygtr9mOXIoX7xOSrhaBYuyjWVb06qNhLIOEn6hzA/UNraWpWzlXjLOiSXdq+IV 6GjEUHQzpbCYVRVRy2sX+uyle/ZD3PfBEj+LyWzzVpd85l44kZgMqUsZv9OhaLx9TsCt JVlcHc0Auy2M27t13+qFK+rz/zHu76PqGI/asbShgx6o+nLzxJXzh99CQvmwq4wgDEq3 Aa6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si694770pls.281.2018.11.07.05.45.47; Wed, 07 Nov 2018 05:46:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727773AbeKGXPb (ORCPT + 99 others); Wed, 7 Nov 2018 18:15:31 -0500 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27]:54919 "EHLO herzl.nuvoton.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727350AbeKGXPb (ORCPT ); Wed, 7 Nov 2018 18:15:31 -0500 Received: from taln60.nuvoton.co.il (ntil-fw [212.199.177.25]) by herzl.nuvoton.co.il (8.13.8/8.13.8) with ESMTP id wA7DEbCo011300; Wed, 7 Nov 2018 15:14:37 +0200 Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 8C8F2630CB; Wed, 7 Nov 2018 15:44:35 +0200 (IST) From: Tomer Maimon To: linus.walleij@linaro.org, yuenn@google.com, venture@google.com, benjaminfair@google.com, brendanhiggins@google.com, avifishman70@gmail.com, joel@jms.id.au, kunyi@google.com Cc: linux-gpio@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Tomer Maimon Subject: [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function Date: Wed, 7 Nov 2018 15:44:34 +0200 Message-Id: <20181107134434.354795-2-tmaimon77@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20181107134434.354795-1-tmaimon77@gmail.com> References: <20181107134434.354795-1-tmaimon77@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modify GPIO direction setting in pin configuration function by using generic GPIO functions to set the GPIO direction instead of direct access to the GPIO direction register. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c index 7ad50d9268aa..b455209382a5 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c @@ -1799,19 +1799,12 @@ static int npcm7xx_config_set_one(struct npcm7xx_pinctrl *npcm, npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_PU, gpio); break; case PIN_CONFIG_INPUT_ENABLE: - if (arg) { - iowrite32(gpio, bank->base + NPCM7XX_GP_N_OEC); - npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_IEM, - gpio); - } else - npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_IEM, - gpio); + iowrite32(gpio, bank->base + NPCM7XX_GP_N_OEC); + bank->direction_input(&bank->gc, pin % bank->gc.ngpio); break; case PIN_CONFIG_OUTPUT: - npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_IEM, gpio); - iowrite32(gpio, arg ? bank->base + NPCM7XX_GP_N_DOS : - bank->base + NPCM7XX_GP_N_DOC); iowrite32(gpio, bank->base + NPCM7XX_GP_N_OES); + bank->direction_output(&bank->gc, pin % bank->gc.ngpio, arg); break; case PIN_CONFIG_DRIVE_PUSH_PULL: npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_OTYP, gpio); -- 2.14.1