* [PATCH v1 0/1] pinctrl: nuvoton: modify NPCM7xx pin configuration
@ 2018-11-07 13:44 Tomer Maimon
2018-11-07 13:44 ` [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function Tomer Maimon
0 siblings, 1 reply; 4+ messages in thread
From: Tomer Maimon @ 2018-11-07 13:44 UTC (permalink / raw)
To: linus.walleij, yuenn, venture, benjaminfair, brendanhiggins,
avifishman70, joel, kunyi
Cc: linux-gpio, openbmc, linux-kernel, Tomer Maimon
This patch Modify GPIO direction setting in pin configuration function.
please refer patch:
Kun Yi https://patchwork.ozlabs.org/patch/985540/
Tomer Maimon (1):
pinctrl: nuvoton: modify NPCM7xx pin configuration function
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function
2018-11-07 13:44 [PATCH v1 0/1] pinctrl: nuvoton: modify NPCM7xx pin configuration Tomer Maimon
@ 2018-11-07 13:44 ` Tomer Maimon
2018-11-07 19:51 ` Kun Yi
2018-11-15 10:15 ` Linus Walleij
0 siblings, 2 replies; 4+ messages in thread
From: Tomer Maimon @ 2018-11-07 13:44 UTC (permalink / raw)
To: linus.walleij, yuenn, venture, benjaminfair, brendanhiggins,
avifishman70, joel, kunyi
Cc: linux-gpio, openbmc, linux-kernel, Tomer Maimon
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 <tmaimon77@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function
2018-11-07 13:44 ` [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function Tomer Maimon
@ 2018-11-07 19:51 ` Kun Yi
2018-11-15 10:15 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Kun Yi @ 2018-11-07 19:51 UTC (permalink / raw)
To: tmaimon77
Cc: Linus Walleij, Nancy Yuen, Patrick Venture, Benjamin Fair,
Brendan Higgins, avifishman70, Joel Stanley, linux-gpio,
OpenBMC Maillist, linux-kernel
On Wed, Nov 7, 2018 at 5:44 AM Tomer Maimon <tmaimon77@gmail.com> 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 <tmaimon77@gmail.com>
Tested-by: Kun Yi <kunyi@google.com>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function
2018-11-07 13:44 ` [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function Tomer Maimon
2018-11-07 19:51 ` Kun Yi
@ 2018-11-15 10:15 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2018-11-15 10:15 UTC (permalink / raw)
To: Tomer Maimon
Cc: Nancy Yuen, Patrick Venture, benjaminfair, Brendan Higgins,
avifishman70, Joel Stanley, Kun Yi, open list:GPIO SUBSYSTEM,
OpenBMC Maillist, linux-kernel
On Wed, Nov 7, 2018 at 2:44 PM Tomer Maimon <tmaimon77@gmail.com> 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 <tmaimon77@gmail.com>
Patch applied with Kun Yi's tested-by tag!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-15 10:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 13:44 [PATCH v1 0/1] pinctrl: nuvoton: modify NPCM7xx pin configuration Tomer Maimon
2018-11-07 13:44 ` [PATCH v1 1/1] pinctrl: nuvoton: modify NPCM7xx pin configuration function Tomer Maimon
2018-11-07 19:51 ` Kun Yi
2018-11-15 10:15 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).