pinctrl: stmfx: update pincontrol and gpio device name
Subsystems (2)
PATCH 1/2 pinctrl: stmfx: update pincontrol and gpio device name
The device name is used in pinmux command and in log trace so it is better to use the parent parent name ("stmfx at 42" for example) than a generic name ("pinctrl" or "stmfx-gpio") to identify the device instance.
---
drivers/pinctrl/pinctrl-stmfx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-stmfx.c +4 -1
@@ -408,8 +408,11 @@ static int stmfx_pinctrl_bind(struct udevice *dev) {struct stmfx_pinctrl *plat =dev_get_platdata (dev); +/* subnode name is not explicit: use father name */ +device_set_name (dev, dev->parent->name); +return device_bind_driver_to_node (dev->parent, -"stmfx-gpio" ,"stmfx-gpio" , +"stmfx-gpio" , dev->parent->name,dev_ofnode (dev), &plat->gpio); };
Signature · 1 line
2.17.1
PATCH 1/2 pinctrl: stmfx: update pincontrol and gpio device name
Hi,
Quoted 8 lines
From: Patrick DELAUNAY <[email protected]>
Sent: mercredi 28 octobre 2020 10:52The device name is used in pinmux command and in log trace so it is better to use the parent parent name ("stmfx at 42" for
example) than a generic name ("pinctrl" or "stmfx-gpio") to identify the device instance.
Quoted 6 lines
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/pinctrl/pinctrl-stmfx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Applied to u-boot-stm/master, thanks!
Regards
Patrick
PATCH 1/2 pinctrl: stmfx: update pincontrol and gpio device name
In reply to Patrick DelaunayHi Patrick
Quoted 18 lines · Patrick Delaunay
The device name is used in pinmux command and in log trace so it is better to use the parent parent name ("stmfx at 42" for example) than a generic name ("pinctrl" or "stmfx-gpio") to identify the device instance.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/pinctrl/pinctrl-stmfx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/pinctrl/pinctrl-stmfx.c +0
-0@@ -408,8 +408,11 @@ static int stmfx_pinctrl_bind(struct udevice *dev) {struct stmfx_pinctrl *plat =dev_get_platdata (dev);
drivers/pinctrl/pinctrl-stmfx.c static int stmfx_pinctrl_bind(struct udevice *dev) · line 418
Quoted 10 lines
drivers/pinctrl/pinctrl-stmfx.c +4
-1+/* subnode name is not explicit: use father name */ +device_set_name (dev, dev->parent->name); +return device_bind_driver_to_node (dev->parent, -"stmfx-gpio" ,"stmfx-gpio" , +"stmfx-gpio" , dev->parent->name,dev_ofnode (dev), &plat->gpio); };
Thanks
Patrice
PATCH 2/2 pinctrl: stmfx: update pin name
In reply to Patrick DelaunayUpdate pin name to avoid duplicated name with SOC GPIO gpio0...gpio15 / agpio0....agpio7: add a stmfx prefix.
This pin name can be used in pinmux command.
---
drivers/pinctrl/pinctrl-stmfx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/pinctrl-stmfx.c +4 -4
@@ -343,8 +343,8 @@ static int stmfx_pinctrl_get_pins_count(struct udevice *dev) }/* -* STMFX pins[15:0] are called "gpio[15:0]" -* and STMFX pins[23:16] are called "agpio[7:0]" +* 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 7static char pin_name[MAX_PIN_NAME_LEN ];
@@ -352,9 +352,9 @@ static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev, unsigned int selector) {if (selector <STMFX_MAX_GPIO ) -snprintf (pin_name,MAX_PIN_NAME_LEN ,"gpio%u" , selector); +snprintf (pin_name,MAX_PIN_NAME_LEN ,"stmfx_gpio%u" , selector);else -snprintf (pin_name,MAX_PIN_NAME_LEN ,"agpio%u" , selector -16 ); +snprintf (pin_name,MAX_PIN_NAME_LEN ,"stmfx_agpio%u" , selector -16 );return pin_name; }
Signature · 1 line
2.17.1
PATCH 2/2 pinctrl: stmfx: update pin name
Hi Patrick
Quoted 28 lines · Patrick Delaunay
Update pin name to avoid duplicated name with SOC GPIO gpio0...gpio15 / agpio0....agpio7: add a stmfx prefix.
This pin name can be used in pinmux command.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/pinctrl/pinctrl-stmfx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/pinctrl/pinctrl-stmfx.c +2
-2@@ -343,8 +343,8 @@ static int stmfx_pinctrl_get_pins_count(struct udevice *dev) }/* -* STMFX pins[15:0] are called "gpio[15:0]" -* and STMFX pins[23:16] are called "agpio[7:0]" +* 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 7static char pin_name[MAX_PIN_NAME_LEN ];@@ -352,9 +352,9 @@ static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev, unsigned int selector)
drivers/pinctrl/pinctrl-stmfx.c static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev, · line 360
Quoted 10 lines
drivers/pinctrl/pinctrl-stmfx.c +2
-2{if (selector <STMFX_MAX_GPIO ) -snprintf (pin_name,MAX_PIN_NAME_LEN ,"gpio%u" , selector); +snprintf (pin_name,MAX_PIN_NAME_LEN ,"stmfx_gpio%u" , selector);else -snprintf (pin_name,MAX_PIN_NAME_LEN ,"agpio%u" , selector -16 ); +snprintf (pin_name,MAX_PIN_NAME_LEN ,"stmfx_agpio%u" , selector -16 );return pin_name; }
Thanks
Patrice
PATCH 2/2 pinctrl: stmfx: update pin name
In reply to Patrick DelaunayHi,
Quoted 6 lines
From: Patrick DELAUNAY <[email protected]>
Sent: mercredi 28 octobre 2020 10:52Update pin name to avoid duplicated name with SOC GPIO gpio0...gpio15 / agpio0....agpio7: add a stmfx prefix.
Quoted 8 lines
This pin name can be used in pinmux command.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/pinctrl/pinctrl-stmfx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied to u-boot-stm/master, thanks!
Regards
Patrick