openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: aspeed: Fix GPI only function problem.
@ 2020-10-27  8:44 Billy Tsai
  2020-10-30  4:28 ` Andrew Jeffery
  2020-10-30  5:54 ` [PATCH v2] " Billy Tsai
  0 siblings, 2 replies; 6+ messages in thread
From: Billy Tsai @ 2020-10-27  8:44 UTC (permalink / raw)
  To: andrew, linus.walleij, joel, linux-aspeed, openbmc, linux-gpio,
	linux-arm-kernel, linux-kernel
  Cc: BMC-SW

Some gpio pin at aspeed soc is input only and the prefix name of these
pin is "GPI" only. This patch fine-tune the condition of GPIO check from
"GPIO" to "GPI".

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
index 53f3f8aec695..a2f5ede3f897 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
@@ -292,7 +292,7 @@ static bool aspeed_expr_is_gpio(const struct aspeed_sig_expr *expr)
 	 *
 	 * expr->signal might look like "GPIOT3" in the GPIO case.
 	 */
-	return strncmp(expr->signal, "GPIO", 4) == 0;
+	return strncmp(expr->signal, "GPI", 3) == 0;
 }
 
 static bool aspeed_gpio_in_exprs(const struct aspeed_sig_expr **exprs)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: aspeed: Fix GPI only function problem.
  2020-10-27  8:44 [PATCH] pinctrl: aspeed: Fix GPI only function problem Billy Tsai
@ 2020-10-30  4:28 ` Andrew Jeffery
  2020-10-30  4:46   ` Joel Stanley
  2020-10-30  5:54 ` [PATCH v2] " Billy Tsai
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Jeffery @ 2020-10-30  4:28 UTC (permalink / raw)
  To: Billy Tsai, Linus Walleij, Joel Stanley, linux-aspeed, openbmc,
	linux-gpio, linux-arm-kernel, linux-kernel
  Cc: BMC-SW

Hi Billy,

On Tue, 27 Oct 2020, at 19:14, Billy Tsai wrote:
> Some gpio pin at aspeed soc is input only and the prefix name of these
> pin is "GPI" only. This patch fine-tune the condition of GPIO check from
> "GPIO" to "GPI".
> 
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>

I'd like it if we were a bit more specific in the commit message, and even 
better if we update the comment in the code. A quick look at the code suggests 
this issue affects GPIO banks D and E in the AST2400 and AST2500, and banks T 
and U in the AST2600.

Functionally I think the patch is fine.

Cheers,

Andrew

> ---
>  drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c 
> b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> index 53f3f8aec695..a2f5ede3f897 100644
> --- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> @@ -292,7 +292,7 @@ static bool aspeed_expr_is_gpio(const struct 
> aspeed_sig_expr *expr)
>  	 *
>  	 * expr->signal might look like "GPIOT3" in the GPIO case.
>  	 */
> -	return strncmp(expr->signal, "GPIO", 4) == 0;
> +	return strncmp(expr->signal, "GPI", 3) == 0;
>  }
>  
>  static bool aspeed_gpio_in_exprs(const struct aspeed_sig_expr **exprs)
> -- 
> 2.17.1
> 
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: aspeed: Fix GPI only function problem.
  2020-10-30  4:28 ` Andrew Jeffery
@ 2020-10-30  4:46   ` Joel Stanley
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Stanley @ 2020-10-30  4:46 UTC (permalink / raw)
  To: Andrew Jeffery
  Cc: BMC-SW, linux-aspeed, Linus Walleij, Linux Kernel Mailing List,
	Billy Tsai, open list:GPIO SUBSYSTEM, OpenBMC Maillist,
	Linux ARM

On Fri, 30 Oct 2020 at 04:28, Andrew Jeffery <andrew@aj.id.au> wrote:
>
> Hi Billy,
>
> On Tue, 27 Oct 2020, at 19:14, Billy Tsai wrote:
> > Some gpio pin at aspeed soc is input only and the prefix name of these
> > pin is "GPI" only. This patch fine-tune the condition of GPIO check from
> > "GPIO" to "GPI".
> >
> > Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
>
> I'd like it if we were a bit more specific in the commit message, and even
> better if we update the comment in the code. A quick look at the code suggests
> this issue affects GPIO banks D and E in the AST2400 and AST2500, and banks T
> and U in the AST2600.
>
> Functionally I think the patch is fine.

Also add this line:

Fixes: 4d3d0e4272d8 ("pinctrl: Add core support for Aspeed SoCs")

Cheers,

Joel

>
> Cheers,
>
> Andrew
>
> > ---
> >  drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> > b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> > index 53f3f8aec695..a2f5ede3f897 100644
> > --- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> > +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> > @@ -292,7 +292,7 @@ static bool aspeed_expr_is_gpio(const struct
> > aspeed_sig_expr *expr)
> >        *
> >        * expr->signal might look like "GPIOT3" in the GPIO case.
> >        */
> > -     return strncmp(expr->signal, "GPIO", 4) == 0;
> > +     return strncmp(expr->signal, "GPI", 3) == 0;
> >  }
> >
> >  static bool aspeed_gpio_in_exprs(const struct aspeed_sig_expr **exprs)
> > --
> > 2.17.1
> >
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] pinctrl: aspeed: Fix GPI only function problem.
  2020-10-27  8:44 [PATCH] pinctrl: aspeed: Fix GPI only function problem Billy Tsai
  2020-10-30  4:28 ` Andrew Jeffery
@ 2020-10-30  5:54 ` Billy Tsai
  2020-10-30  6:02   ` Andrew Jeffery
  2020-11-05 14:34   ` Linus Walleij
  1 sibling, 2 replies; 6+ messages in thread
From: Billy Tsai @ 2020-10-30  5:54 UTC (permalink / raw)
  To: andrew, linus.walleij, joel, linux-aspeed, openbmc, linux-gpio,
	linux-arm-kernel
  Cc: BMC-SW

Some gpio pin at aspeed soc is input only and the prefix name of these
pin is "GPI" only.
This patch fine-tune the condition of GPIO check from "GPIO" to "GPI"
and it will fix the usage error of banks D and E in the AST2400/AST2500
and banks T and U in the AST2600.

Fixes: 4d3d0e4272d8 ("pinctrl: Add core support for Aspeed SoCs")

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
index e03ee78b2434..95c8d400ad59 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
@@ -286,13 +286,14 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
 static bool aspeed_expr_is_gpio(const struct aspeed_sig_expr *expr)
 {
 	/*
-	 * The signal type is GPIO if the signal name has "GPIO" as a prefix.
+	 * The signal type is GPIO if the signal name has "GPI" as a prefix.
 	 * strncmp (rather than strcmp) is used to implement the prefix
 	 * requirement.
 	 *
-	 * expr->signal might look like "GPIOT3" in the GPIO case.
+	 * expr->signal might look like "GPIOB1" in the GPIO case.
+	 * expr->signal might look like "GPIT0" in the GPI case.
 	 */
-	return strncmp(expr->signal, "GPIO", 4) == 0;
+	return strncmp(expr->signal, "GPI", 3) == 0;
 }
 
 static bool aspeed_gpio_in_exprs(const struct aspeed_sig_expr **exprs)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] pinctrl: aspeed: Fix GPI only function problem.
  2020-10-30  5:54 ` [PATCH v2] " Billy Tsai
@ 2020-10-30  6:02   ` Andrew Jeffery
  2020-11-05 14:34   ` Linus Walleij
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Jeffery @ 2020-10-30  6:02 UTC (permalink / raw)
  To: Billy Tsai, Linus Walleij, Joel Stanley, linux-aspeed, openbmc,
	linux-gpio, linux-arm-kernel
  Cc: BMC-SW



On Fri, 30 Oct 2020, at 16:24, Billy Tsai wrote:
> Some gpio pin at aspeed soc is input only and the prefix name of these
> pin is "GPI" only.
> This patch fine-tune the condition of GPIO check from "GPIO" to "GPI"
> and it will fix the usage error of banks D and E in the AST2400/AST2500
> and banks T and U in the AST2600.
> 
> Fixes: 4d3d0e4272d8 ("pinctrl: Add core support for Aspeed SoCs")
> 
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>

Thanks Billy. Generally the Fixes: tag should be part of the trailer block, 
hopefully Linus is happy to remove the newline for us!

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] pinctrl: aspeed: Fix GPI only function problem.
  2020-10-30  5:54 ` [PATCH v2] " Billy Tsai
  2020-10-30  6:02   ` Andrew Jeffery
@ 2020-11-05 14:34   ` Linus Walleij
  1 sibling, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-11-05 14:34 UTC (permalink / raw)
  To: Billy Tsai
  Cc: BMC-SW, linux-aspeed, Andrew Jeffery, OpenBMC Maillist,
	open list:GPIO SUBSYSTEM, Linux ARM

On Fri, Oct 30, 2020 at 6:55 AM Billy Tsai <billy_tsai@aspeedtech.com> wrote:

> Some gpio pin at aspeed soc is input only and the prefix name of these
> pin is "GPI" only.
> This patch fine-tune the condition of GPIO check from "GPIO" to "GPI"
> and it will fix the usage error of banks D and E in the AST2400/AST2500
> and banks T and U in the AST2600.
>
> Fixes: 4d3d0e4272d8 ("pinctrl: Add core support for Aspeed SoCs")
>
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>

Thanks Billy, patch applied for fixes!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-05 15:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27  8:44 [PATCH] pinctrl: aspeed: Fix GPI only function problem Billy Tsai
2020-10-30  4:28 ` Andrew Jeffery
2020-10-30  4:46   ` Joel Stanley
2020-10-30  5:54 ` [PATCH v2] " Billy Tsai
2020-10-30  6:02   ` Andrew Jeffery
2020-11-05 14:34   ` 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).