Skip to contentSkip to conversation

pinctrl: aspeed: Fix GPI only function problem.

PATCH Superseded Billy Tsai 4 participants 6 messages Oct 27, 2020 – Nov 5, 2020

Subsystems (4)
lore
Share & tools
lore

Billy Tsai

author reviewer
#0 lore raw

PATCH 1/1 pinctrl: aspeed: Fix GPI only function problem.

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".

---
 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/aspeed/pinctrl-aspeed.c +1 -1
index 53f3f8aec695..a2f5ede3f897 100644
@@ -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)
Signature · 1 line
2.17.1
#1 lore raw

Hi Billy,

Quoted 5 lines · Billy Tsai

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".

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

Quoted 23 lines
---
 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/aspeed/pinctrl-aspeed.c +1 -1
index 53f3f8aec695..a2f5ede3f897 100644
@@ -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)

Signature · 1 line
2.17.1
maintainer
#2 lore raw
Quoted 8 lines · Andrew Jeffery

Hi Billy,

Quoted 4 lines · Billy Tsai

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".

Quoted 8 lines
Quoted 1 line

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

Quoted 28 lines

Cheers,

Andrew

Quoted 23 lines
---
 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/aspeed/pinctrl-aspeed.c +1 -1
index 53f3f8aec695..a2f5ede3f897 100644
@@ -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

author reviewer
#3 lore raw

PATCH v2 1/1 pinctrl: aspeed: Fix GPI only function problem.

In reply to Billy Tsai

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")
---
 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/pinctrl/aspeed/pinctrl-aspeed.c +4 -3
index e03ee78b2434..95c8d400ad59 100644
@@ -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)
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1
#4 lore raw
Quoted 9 lines · Billy Tsai

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")

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

#5 lore raw
In reply to Billy Tsai
Quoted 9 lines · Billy Tsai

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")

Thanks Billy, patch applied for fixes!

Yours,
Linus Walleij