Skip to contentSkip to conversation

pinctrl: stmfx: update pincontrol and gpio device name

PATCH New Patrick Delaunay 2 participants 6 messages Oct 28, 2020 – Nov 25, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index c2ea82770e..b789f3686c 100644
@@ -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
#1 lore raw

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:52

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.

Quoted 6 lines

---

 drivers/pinctrl/pinctrl-stmfx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Applied to u-boot-stm/master, thanks!

Regards

Patrick

#2 lore raw

PATCH 1/2 pinctrl: stmfx: update pincontrol and gpio device name

In reply to Patrick Delaunay

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

---

 drivers/pinctrl/pinctrl-stmfx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-stmfx.c +0 -0
index c2ea82770e..b789f3686c 100644
@@ -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

#3 lore raw

PATCH 2/2 pinctrl: stmfx: update pin name

In reply to 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.

---

 drivers/pinctrl/pinctrl-stmfx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/pinctrl-stmfx.c +4 -4
index b789f3686c..a62be44d2d 100644
@@ -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 7
 static 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
#4 lore raw

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.

---

 drivers/pinctrl/pinctrl-stmfx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/pinctrl-stmfx.c +2 -2
index b789f3686c..a62be44d2d 100644
@@ -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 7
 static 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

#5 lore raw

PATCH 2/2 pinctrl: stmfx: update pin name

In reply to Patrick Delaunay

Hi,

Quoted 6 lines

From: Patrick DELAUNAY <[email protected]>
Sent: mercredi 28 octobre 2020 10:52

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

---

 drivers/pinctrl/pinctrl-stmfx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-stm/master, thanks!

Regards

Patrick