Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3539766imu; Wed, 7 Nov 2018 11:54:50 -0800 (PST) X-Google-Smtp-Source: AJdET5eMCEjplb2g+tHAUdTPf7OhDZ/gKYxveAkiT2V+lrTg96NNc6sKjjIzp2d3ovwYsf5VpP3d X-Received: by 2002:a63:c24c:: with SMTP id l12mr1371465pgg.146.1541620490094; Wed, 07 Nov 2018 11:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541620490; cv=none; d=google.com; s=arc-20160816; b=wluQ8Kt+txw66AT98uuaojoRQ/pvvk3sVe1s2ps1UV8PyRxiJrw64NmiMdXR5+KEsz WY8EAb+mseEOxB/Ka05TubNWRc4hr0Q31g1lksGuM5oUSoGnJ5iwxPpCJzliJsQJUa6+ sPPvl5s8yQ4PlDwODzMc5lfclL0nlXiSsexek4cO/4q+mfkhEuCXMHJ8PgqSLsrkzqrs zC+fQo7GX1jxnOG+/GHT35JALd2o7OiyR5k7MHgoPQDUfavo5k6XdUTUhxwKL5YdMa6L kFu8A7wCc9HQIz1rpl8rg50S93AhY8o8FSckO0mpduqbq+v5pljbkUAa7QHXc/OSmtfz 3KlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=F4KMUeVBB2PsW2s3eUbDweq1jpGXsySqNaHA3LrsjEo=; b=llAusHSxluQ8Dgd3i2mLEWVY/idpsVZX1UTcPvnZdmKDa3grVDG8hoMTRbKjanYctU StLJKD61BVKEVZ6teDtR2owMuVXH6l5mL7XGpGkNyl9kTi1QgYhY4ulI5W7nYiBg932D MvXYmqfUwuYyIZG8sVhIzYHewklapTFwjjDCk3ORrlcrRGpKASBQJWlcSk4GO5l+8Uk1 +y/I2SEgS8PFa1CoerwhAqXboBt5zcGqUNxRmtDbrQ27DEEZytZqq445gw0T3sCiQUjn kjGdU7BcIFyugBIA/5kYoc7RG5+2HGuRvqxH7//PvhGR6JpiXlIz+cq3ywlC74IoFd9R ha2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ilkOvlVB; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 132si1327679pge.141.2018.11.07.11.54.34; Wed, 07 Nov 2018 11:54:50 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=ilkOvlVB; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727340AbeKHFX4 (ORCPT + 99 others); Thu, 8 Nov 2018 00:23:56 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:40315 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbeKHFX4 (ORCPT ); Thu, 8 Nov 2018 00:23:56 -0500 Received: by mail-it1-f196.google.com with SMTP id e11so21279615itl.5 for ; Wed, 07 Nov 2018 11:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F4KMUeVBB2PsW2s3eUbDweq1jpGXsySqNaHA3LrsjEo=; b=ilkOvlVBXaVi9CSnAf3YDKBTmPO9iMiZVWX/1TXzBLJNYaXkG9Q7H0akE/H270wshs vOfJZ4k24ocLFgZbrlczmzBvdNwTRamOw6+zRxA4lXfbjQl6KCYFmsm/eMBlA2fBA5EY 5TYIsvQphkKs1MmH1PyIN58AU8VfyESCYpMIuXfC9GgUnyfChRm7mzK/7vECyQ+FulCr N9TvQ9rWKTzKdwh9Df8WXwugQ3mXoRg9NXJXRJB2JshIHILhipJrklpLs22SPb8G7NzZ 1u4GdDjJInIkiCboL+ww49totYp7hT3e23VZOspsDdAA5cd6Q2RzMU46pXojDagvofKK gT1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F4KMUeVBB2PsW2s3eUbDweq1jpGXsySqNaHA3LrsjEo=; b=iEa/+JVOmJD01qNgCE7shCDpYGCbhreg/FVGlcOEcfhVM/DhA8jH+NQK4bRC9dyPSM h9W26qvYnHMqqVv6/PNX2zyacX3mXdKSAkZCCClYlpgRl+JHwr+a9o7Z/+OsPkTXgUHS PVg9v5XxJ+kl3HDBkZiIlP2t1UKERDWhj2GZJxwZkJRjZvCi6BQsybvKyHwLl6bRzQPN lPEqpRaKpxQyhFE392tJcraDCZZMnfoytByoxQV2ytw8hQTs+AJb/bXZAy6BO6uVk38q 85jb8jEQUSwzMoh2O5N/U7h4MCysHLA36zwxulu3kIAMAmAxvGsri5pEfGdD8rucKykg q7/A== X-Gm-Message-State: AGRZ1gJ5DvksAiRC7nCxfbPCnFudmnc/v+7ROhi1aZEq3vCujAjW/IQo cA/tT3C5Rr9HbGPgEVaZwmfN8E+ulBiSfyOqn73h3A== X-Received: by 2002:a24:b804:: with SMTP id m4-v6mr1332566ite.72.1541620324553; Wed, 07 Nov 2018 11:52:04 -0800 (PST) MIME-Version: 1.0 References: <20181107134434.354795-1-tmaimon77@gmail.com> <20181107134434.354795-2-tmaimon77@gmail.com> In-Reply-To: <20181107134434.354795-2-tmaimon77@gmail.com> From: Kun Yi Date: Wed, 7 Nov 2018 11:51:37 -0800 Message-ID: Subject: Re: [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function To: tmaimon77@gmail.com Cc: Linus Walleij , Nancy Yuen , Patrick Venture , Benjamin Fair , Brendan Higgins , avifishman70@gmail.com, Joel Stanley , linux-gpio@vger.kernel.org, OpenBMC Maillist , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 7, 2018 at 5:44 AM Tomer Maimon wrote: > > 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 Tested-by: Kun Yi Thanks for sending the patch Tomer! > --- > 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 > -- Regards, Kun