[PATCH 0/2] Fix pinmux status display with long pin's name

This series is fixing 2 issue when pin-controller pin's name are long : _ First issue is concerning stmfx pin-controller which pin's name is at least 13 char long but only 10 can be displayed. _ Second issue is about pinmux command which is using PINNAME_SIZE which need to be increased to displayed long pin's name.
Patrice Chotard (2): pinctrl: stmfx: Fix MAX_PIN_NAME_LEN pinctrl: Set PINNAME_SIZE to 16
drivers/pinctrl/pinctrl-stmfx.c | 2 +- include/dm/pinctrl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

MAX_PIN_NAME_LEN is set to 7 whereas stmfx pin name prefix "stmfx_gpio" is 10 char long. So "pinmux status" output looks like:
STM32MP> pinmux status -a -------------------------- stmfx@42: stmfx_ : input stmfx_ : input stmfx_ : input stmfx_ : input stmfx_ : input .....
Set MAX_PIN_NAME_LEN to 13 to get a correct pinmux command output.
Fixes: e27e96aa804e("pinctrl: stmfx: update pin name")
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
---
drivers/pinctrl/pinctrl-stmfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index a62be44d2d..d23ad862f2 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -346,7 +346,7 @@ static int stmfx_pinctrl_get_pins_count(struct udevice *dev) * STMFX pins[15:0] are called "stmfx_gpio[15:0]" * and STMFX pins[23:16] are called "stmfx_agpio[7:0]" */ -#define MAX_PIN_NAME_LEN 7 +#define MAX_PIN_NAME_LEN 13 static char pin_name[MAX_PIN_NAME_LEN]; static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev, unsigned int selector)

Hi
This series is abandoned and will be replaced by a new one.
Patrice
On 1/11/21 3:03 PM, Patrice Chotard wrote:
MAX_PIN_NAME_LEN is set to 7 whereas stmfx pin name prefix "stmfx_gpio" is 10 char long. So "pinmux status" output looks like:
STM32MP> pinmux status -a
stmfx@42: stmfx_ : input stmfx_ : input stmfx_ : input stmfx_ : input stmfx_ : input .....
Set MAX_PIN_NAME_LEN to 13 to get a correct pinmux command output.
Fixes: e27e96aa804e("pinctrl: stmfx: update pin name")
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
drivers/pinctrl/pinctrl-stmfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index a62be44d2d..d23ad862f2 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -346,7 +346,7 @@ static int stmfx_pinctrl_get_pins_count(struct udevice *dev)
- STMFX pins[15:0] are called "stmfx_gpio[15:0]"
- and STMFX pins[23:16] are called "stmfx_agpio[7:0]"
*/ -#define MAX_PIN_NAME_LEN 7 +#define MAX_PIN_NAME_LEN 13 static char pin_name[MAX_PIN_NAME_LEN]; static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev, unsigned int selector)

To allow to print longer pin name, set PINNAME_SIZE to 16.
Fixes: d5a8313905f5("cmd: pinmux: Add pinmux command")
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
---
include/dm/pinctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h index 1bdc8d3cbd..2f09c7fa49 100644 --- a/include/dm/pinctrl.h +++ b/include/dm/pinctrl.h @@ -6,7 +6,7 @@ #ifndef __PINCTRL_H #define __PINCTRL_H
-#define PINNAME_SIZE 10 +#define PINNAME_SIZE 16 #define PINMUX_SIZE 40
/**
participants (2)
-
Patrice CHOTARD
-
Patrice Chotard