u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] gpio: update gpio_get_status()
@ 2022-08-30 12:09 Patrice Chotard
  2022-08-30 12:09 ` [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function Patrice Chotard
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Patrice Chotard @ 2022-08-30 12:09 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Andrew Jeffery,
	Eddie James, Heinrich Schuchardt, Samuel Holland, Simon Glass


Currently, if pin's function is GPIOF_FUNC, only "func" if displayed
without any other information. It would be interesting, if information is
available, to indicate which pinmuxing's name is used.


Changes in v3:
   - add lost Simon Glass's reviewed-by during v1 review in patch 1 and 2

Patrice Chotard (4):
  gpio: Allow to print pin's label even for pin with GPIOF_FUNC function
  gpio: Fix pin's status display for pin with GPIOF_UNUSED function
  pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's
    name
  gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate
    function

 drivers/gpio/gpio-uclass.c              | 18 ++++++++++-----
 drivers/gpio/sandbox.c                  |  5 +++++
 drivers/pinctrl/pinctrl_stm32.c         |  8 +++++--
 include/asm-generic/gpio.h              |  1 +
 include/dt-bindings/gpio/sandbox-gpio.h |  3 +++
 test/dm/gpio.c                          | 30 +++++++++++++++++++++++++
 6 files changed, 57 insertions(+), 8 deletions(-)

-- 
2.25.1


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

* [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function
  2022-08-30 12:09 [PATCH v3 0/4] gpio: update gpio_get_status() Patrice Chotard
@ 2022-08-30 12:09 ` Patrice Chotard
  2022-08-30 12:16   ` Patrick DELAUNAY
  2022-09-15 14:02   ` Tom Rini
  2022-08-30 12:09 ` [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function Patrice Chotard
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Patrice Chotard @ 2022-08-30 12:09 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Simon Glass,
	Andrew Jeffery, Eddie James, Heinrich Schuchardt, Samuel Holland

Currently, if pin's function is GPIOF_FUNC, only "func" if displayed
without any other information. It would be interesting, if information is
available, to indicate which pinmuxing's name is used.

For example, for STM32 SoC's based platform, "gpio status" command
output :

   before
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func
      GPIOZ5: func
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

   After
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func i2c4-0
      GPIOZ5: func i2c4-0
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
   - add lost Simon Glass's reviewed-by during v1 review

 drivers/gpio/gpio-uclass.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index 0ed32b7217..d60e46159a 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -884,26 +884,31 @@ int gpio_get_status(struct udevice *dev, int offset, char *buf, int buffsize)
 	const struct dm_gpio_ops *ops = gpio_get_ops(dev);
 	struct gpio_dev_priv *priv;
 	char *str = buf;
+	const char *label;
 	int func;
 	int ret;
 	int len;
+	bool used;
 
 	BUILD_BUG_ON(GPIOF_COUNT != ARRAY_SIZE(gpio_function));
 
 	*buf = 0;
 	priv = dev_get_uclass_priv(dev);
-	ret = gpio_get_raw_function(dev, offset, NULL);
+	ret = gpio_get_raw_function(dev, offset, &label);
 	if (ret < 0)
 		return ret;
 	func = ret;
 	len = snprintf(str, buffsize, "%s%d: %s",
 		       priv->bank_name ? priv->bank_name : "",
 		       offset, gpio_function[func]);
-	if (func == GPIOF_INPUT || func == GPIOF_OUTPUT ||
-	    func == GPIOF_UNUSED) {
-		const char *label;
-		bool used;
 
+	switch (func) {
+	case GPIOF_FUNC:
+		snprintf(str + len, buffsize - len, " %s", label ? label : "");
+		break;
+	case GPIOF_INPUT:
+	case GPIOF_OUTPUT:
+	case GPIOF_UNUSED:
 		ret = ops->get_value(dev, offset);
 		if (ret < 0)
 			return ret;
@@ -913,6 +918,7 @@ int gpio_get_status(struct udevice *dev, int offset, char *buf, int buffsize)
 			 used ? 'x' : ' ',
 			 used ? " " : "",
 			 label ? label : "");
+		break;
 	}
 
 	return 0;
-- 
2.25.1


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

* [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function
  2022-08-30 12:09 [PATCH v3 0/4] gpio: update gpio_get_status() Patrice Chotard
  2022-08-30 12:09 ` [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function Patrice Chotard
@ 2022-08-30 12:09 ` Patrice Chotard
  2022-08-30 12:16   ` Patrick DELAUNAY
  2022-09-15 14:03   ` Tom Rini
  2022-08-30 12:09 ` [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name Patrice Chotard
  2022-08-30 12:09 ` [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function Patrice Chotard
  3 siblings, 2 replies; 13+ messages in thread
From: Patrice Chotard @ 2022-08-30 12:09 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Simon Glass,
	Andrew Jeffery, Eddie James, Heinrich Schuchardt, Samuel Holland

Even pin with GPIOF_UNUSED function can have a label.
The criteria to add or not a space character is linked to label not to
the used/unused status.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
   - add lost Simon Glass's reviewed-by during v1 review

 drivers/gpio/gpio-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index d60e46159a..a00880e446 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -916,7 +916,7 @@ int gpio_get_status(struct udevice *dev, int offset, char *buf, int buffsize)
 		snprintf(str + len, buffsize - len, ": %d [%c]%s%s",
 			 ret,
 			 used ? 'x' : ' ',
-			 used ? " " : "",
+			 label ? " " : "",
 			 label ? label : "");
 		break;
 	}
-- 
2.25.1


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

* [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name
  2022-08-30 12:09 [PATCH v3 0/4] gpio: update gpio_get_status() Patrice Chotard
  2022-08-30 12:09 ` [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function Patrice Chotard
  2022-08-30 12:09 ` [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function Patrice Chotard
@ 2022-08-30 12:09 ` Patrice Chotard
  2022-08-30 12:21   ` Patrick DELAUNAY
  2022-09-15 14:03   ` Tom Rini
  2022-08-30 12:09 ` [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function Patrice Chotard
  3 siblings, 2 replies; 13+ messages in thread
From: Patrice Chotard @ 2022-08-30 12:09 UTC (permalink / raw)
  To: u-boot; +Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32

Populate uc_priv->name[] with pinmux node's name in order to indicate
the pinmuxing's name in case GPIO is configured in alternate.

For example, for STM32 SoC's based platform, "gpio status" command
output :

  before
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func
      GPIOZ5: func
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

  After
    Bank GPIOZ:
      GPIOZ0: unused : 0 [ ]
      GPIOZ1: unused : 0 [ ]
      GPIOZ2: unused : 0 [ ]
      GPIOZ3: unused : 0 [ ]
      GPIOZ4: func i2c4-0
      GPIOZ5: func i2c4-0
      GPIOZ6: unused : 0 [ ]
      GPIOZ7: unused : 0 [ ]
      GPIOZ8: unknown
      GPIOZ9: unknown
      GPIOZ10: unknown
      GPIOZ11: unknown
      GPIOZ12: unknown
      GPIOZ13: unknown
      GPIOZ14: unknown
      GPIOZ15: unknown

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
---

(no changes since v1)

 drivers/pinctrl/pinctrl_stm32.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl_stm32.c b/drivers/pinctrl/pinctrl_stm32.c
index 990cd19286..b755fa42b4 100644
--- a/drivers/pinctrl/pinctrl_stm32.c
+++ b/drivers/pinctrl/pinctrl_stm32.c
@@ -257,10 +257,12 @@ static int stm32_pinctrl_probe(struct udevice *dev)
 	return 0;
 }
 
-static int stm32_gpio_config(struct gpio_desc *desc,
+static int stm32_gpio_config(ofnode node,
+			     struct gpio_desc *desc,
 			     const struct stm32_gpio_ctl *ctl)
 {
 	struct stm32_gpio_priv *priv = dev_get_priv(desc->dev);
+	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(desc->dev);
 	struct stm32_gpio_regs *regs = priv->regs;
 	struct stm32_pinctrl_priv *ctrl_priv;
 	int ret;
@@ -291,6 +293,8 @@ static int stm32_gpio_config(struct gpio_desc *desc,
 	index = desc->offset;
 	clrsetbits_le32(&regs->otyper, OTYPE_MSK << index, ctl->otype << index);
 
+	uc_priv->name[desc->offset] = strdup(ofnode_get_name(node));
+
 	hwspinlock_unlock(&ctrl_priv->hws);
 
 	return 0;
@@ -385,7 +389,7 @@ static int stm32_pinctrl_config(ofnode node)
 			if (rv)
 				return rv;
 			desc.offset = gpio_dsc.pin;
-			rv = stm32_gpio_config(&desc, &gpio_ctl);
+			rv = stm32_gpio_config(node, &desc, &gpio_ctl);
 			log_debug("rv = %d\n\n", rv);
 			if (rv)
 				return rv;
-- 
2.25.1


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

* [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function
  2022-08-30 12:09 [PATCH v3 0/4] gpio: update gpio_get_status() Patrice Chotard
                   ` (2 preceding siblings ...)
  2022-08-30 12:09 ` [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name Patrice Chotard
@ 2022-08-30 12:09 ` Patrice Chotard
  2022-08-30 12:24   ` Patrick DELAUNAY
  2022-09-15 14:03   ` Tom Rini
  3 siblings, 2 replies; 13+ messages in thread
From: Patrice Chotard @ 2022-08-30 12:09 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Simon Glass,
	Andrew Jeffery, Heinrich Schuchardt, Samuel Holland

This allows to test if a pin's label if displayed using gpio_get_status()
when this pin is configured in alternate function.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

---

(no changes since v1)

 drivers/gpio/sandbox.c                  |  5 +++++
 include/asm-generic/gpio.h              |  1 +
 include/dt-bindings/gpio/sandbox-gpio.h |  3 +++
 test/dm/gpio.c                          | 30 +++++++++++++++++++++++++
 4 files changed, 39 insertions(+)

diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 106b2a7b27..305f9a6ff6 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -196,6 +196,8 @@ static int sb_gpio_get_function(struct udevice *dev, unsigned offset)
 		return GPIOF_OUTPUT;
 	if (get_gpio_flag(dev, offset, GPIOD_IS_IN))
 		return GPIOF_INPUT;
+	if (get_gpio_flag(dev, offset, GPIOD_IS_AF))
+		return GPIOF_FUNC;
 
 	return GPIOF_INPUT; /*GPIO is not configurated */
 }
@@ -219,6 +221,9 @@ static int sb_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
 	if (args->args[1] & GPIO_OUT_ACTIVE)
 		desc->flags |= GPIOD_IS_OUT_ACTIVE;
 
+	if (args->args[1] & GPIO_AF)
+		desc->flags |= GPIOD_IS_AF;
+
 	return 0;
 }
 
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 81f63f06f1..0fcf70983f 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -127,6 +127,7 @@ struct gpio_desc {
 #define GPIOD_OPEN_SOURCE	BIT(6)	/* GPIO is open source type */
 #define GPIOD_PULL_UP		BIT(7)	/* GPIO has pull-up enabled */
 #define GPIOD_PULL_DOWN		BIT(8)	/* GPIO has pull-down enabled */
+#define GPIOD_IS_AF		BIT(9)	/* GPIO is an alternate function */
 
 /* Flags for updating the above */
 #define GPIOD_MASK_DIR		(GPIOD_IS_OUT | GPIOD_IS_IN | \
diff --git a/include/dt-bindings/gpio/sandbox-gpio.h b/include/dt-bindings/gpio/sandbox-gpio.h
index e4bfdb3ce1..05f9836583 100644
--- a/include/dt-bindings/gpio/sandbox-gpio.h
+++ b/include/dt-bindings/gpio/sandbox-gpio.h
@@ -21,4 +21,7 @@
 /* Bit 18 express GPIO output is active */
 #define GPIO_OUT_ACTIVE		0x40000
 
+/* Bit 19 express GPIO set as alternate function */
+#define GPIO_AF			0x80000
+
 #endif
diff --git a/test/dm/gpio.c b/test/dm/gpio.c
index 33ae98701f..a8c35d4370 100644
--- a/test/dm/gpio.c
+++ b/test/dm/gpio.c
@@ -778,3 +778,33 @@ static int dm_test_gpio_get_values_as_int_base3(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_gpio_get_values_as_int_base3,
 	UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
+/* Check that gpio_get_status return the label of a GPIO configured as GPIOD_AF */
+static int dm_test_gpio_function(struct unit_test_state *uts)
+{
+	struct gpio_desc desc;
+	struct udevice *dev;
+	ulong flags;
+	unsigned int offset, gpio;
+	char buf[80];
+
+	ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev));
+	ut_asserteq_str("a-test", dev->name);
+
+	/* request gpio_b 5 */
+	ut_assertok(gpio_request_by_name(dev, "test-gpios", 2, &desc, 0));
+	/* update gpio_b 5 function to GPIO_AF */
+	ut_assertok(dm_gpio_clrset_flags(&desc, GPIOD_IS_AF, GPIOD_IS_AF));
+	ut_assertok(dm_gpio_get_flags(&desc, &flags));
+	ut_asserteq(GPIOD_IS_AF, flags);
+	/* check using gpio_get_status that label is displayed for a pin with GPIO_AF function */
+	ut_assertok(gpio_lookup_name("b5", &dev, &offset, &gpio));
+	ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
+	ut_asserteq_str("b5: func a-test.test-gpios2", buf);
+
+	ut_assertok(dm_gpio_free(dev, &desc));
+
+	return 0;
+}
+DM_TEST(dm_test_gpio_function,
+	UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
-- 
2.25.1


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

* Re: [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function
  2022-08-30 12:09 ` [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function Patrice Chotard
@ 2022-08-30 12:16   ` Patrick DELAUNAY
  2022-09-15 14:02   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Patrick DELAUNAY @ 2022-08-30 12:16 UTC (permalink / raw)
  To: Patrice Chotard, u-boot
  Cc: U-Boot STM32, Simon Glass, Andrew Jeffery, Eddie James,
	Heinrich Schuchardt, Samuel Holland

Hi Patrice

On 8/30/22 14:09, Patrice Chotard wrote:
> Currently, if pin's function is GPIOF_FUNC, only "func" if displayed
> without any other information. It would be interesting, if information is
> available, to indicate which pinmuxing's name is used.
>
> For example, for STM32 SoC's based platform, "gpio status" command
> output :
>
>     before
>      Bank GPIOZ:
>        GPIOZ0: unused : 0 [ ]
>        GPIOZ1: unused : 0 [ ]
>        GPIOZ2: unused : 0 [ ]
>        GPIOZ3: unused : 0 [ ]
>        GPIOZ4: func
>        GPIOZ5: func
>        GPIOZ6: unused : 0 [ ]
>        GPIOZ7: unused : 0 [ ]
>        GPIOZ8: unknown
>        GPIOZ9: unknown
>        GPIOZ10: unknown
>        GPIOZ11: unknown
>        GPIOZ12: unknown
>        GPIOZ13: unknown
>        GPIOZ14: unknown
>        GPIOZ15: unknown
>
>     After
>      Bank GPIOZ:
>        GPIOZ0: unused : 0 [ ]
>        GPIOZ1: unused : 0 [ ]
>        GPIOZ2: unused : 0 [ ]
>        GPIOZ3: unused : 0 [ ]
>        GPIOZ4: func i2c4-0
>        GPIOZ5: func i2c4-0
>        GPIOZ6: unused : 0 [ ]
>        GPIOZ7: unused : 0 [ ]
>        GPIOZ8: unknown
>        GPIOZ9: unknown
>        GPIOZ10: unknown
>        GPIOZ11: unknown
>        GPIOZ12: unknown
>        GPIOZ13: unknown
>        GPIOZ14: unknown
>        GPIOZ15: unknown
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3:
>     - add lost Simon Glass's reviewed-by during v1 review
>
>   drivers/gpio/gpio-uclass.c | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
>

Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks
Patrick



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

* Re: [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function
  2022-08-30 12:09 ` [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function Patrice Chotard
@ 2022-08-30 12:16   ` Patrick DELAUNAY
  2022-09-15 14:03   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Patrick DELAUNAY @ 2022-08-30 12:16 UTC (permalink / raw)
  To: Patrice Chotard, u-boot
  Cc: U-Boot STM32, Simon Glass, Andrew Jeffery, Eddie James,
	Heinrich Schuchardt, Samuel Holland

Hi Patrice,


On 8/30/22 14:09, Patrice Chotard wrote:
> Even pin with GPIOF_UNUSED function can have a label.
> The criteria to add or not a space character is linked to label not to
> the used/unused status.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3:
>     - add lost Simon Glass's reviewed-by during v1 review
>
>   drivers/gpio/gpio-uclass.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>


Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks
Patrick


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

* Re: [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name
  2022-08-30 12:09 ` [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name Patrice Chotard
@ 2022-08-30 12:21   ` Patrick DELAUNAY
  2022-09-15 14:03   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Patrick DELAUNAY @ 2022-08-30 12:21 UTC (permalink / raw)
  To: Patrice Chotard, u-boot; +Cc: U-Boot STM32

Hi,

On 8/30/22 14:09, Patrice Chotard wrote:
> Populate uc_priv->name[] with pinmux node's name in order to indicate
> the pinmuxing's name in case GPIO is configured in alternate.
>
> For example, for STM32 SoC's based platform, "gpio status" command
> output :
>
>    before
>      Bank GPIOZ:
>        GPIOZ0: unused : 0 [ ]
>        GPIOZ1: unused : 0 [ ]
>        GPIOZ2: unused : 0 [ ]
>        GPIOZ3: unused : 0 [ ]
>        GPIOZ4: func
>        GPIOZ5: func
>        GPIOZ6: unused : 0 [ ]
>        GPIOZ7: unused : 0 [ ]
>        GPIOZ8: unknown
>        GPIOZ9: unknown
>        GPIOZ10: unknown
>        GPIOZ11: unknown
>        GPIOZ12: unknown
>        GPIOZ13: unknown
>        GPIOZ14: unknown
>        GPIOZ15: unknown
>
>    After
>      Bank GPIOZ:
>        GPIOZ0: unused : 0 [ ]
>        GPIOZ1: unused : 0 [ ]
>        GPIOZ2: unused : 0 [ ]
>        GPIOZ3: unused : 0 [ ]
>        GPIOZ4: func i2c4-0
>        GPIOZ5: func i2c4-0
>        GPIOZ6: unused : 0 [ ]
>        GPIOZ7: unused : 0 [ ]
>        GPIOZ8: unknown
>        GPIOZ9: unknown
>        GPIOZ10: unknown
>        GPIOZ11: unknown
>        GPIOZ12: unknown
>        GPIOZ13: unknown
>        GPIOZ14: unknown
>        GPIOZ15: unknown
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
>
> (no changes since v1)
>
>   drivers/pinctrl/pinctrl_stm32.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>


Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks
Patrick





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

* Re: [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function
  2022-08-30 12:09 ` [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function Patrice Chotard
@ 2022-08-30 12:24   ` Patrick DELAUNAY
  2022-09-15 14:03   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Patrick DELAUNAY @ 2022-08-30 12:24 UTC (permalink / raw)
  To: Patrice Chotard, u-boot
  Cc: U-Boot STM32, Simon Glass, Andrew Jeffery, Heinrich Schuchardt,
	Samuel Holland

Hi Patrice,

On 8/30/22 14:09, Patrice Chotard wrote:
> This allows to test if a pin's label if displayed using gpio_get_status()
> when this pin is configured in alternate function.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> ---
>
> (no changes since v1)
>
>   drivers/gpio/sandbox.c                  |  5 +++++
>   include/asm-generic/gpio.h              |  1 +
>   include/dt-bindings/gpio/sandbox-gpio.h |  3 +++
>   test/dm/gpio.c                          | 30 +++++++++++++++++++++++++
>   4 files changed, 39 insertions(+)
>


Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks
Patrick




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

* Re: [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function
  2022-08-30 12:09 ` [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function Patrice Chotard
  2022-08-30 12:16   ` Patrick DELAUNAY
@ 2022-09-15 14:02   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Tom Rini @ 2022-09-15 14:02 UTC (permalink / raw)
  To: Patrice Chotard
  Cc: u-boot, Patrick DELAUNAY, U-Boot STM32, Simon Glass,
	Andrew Jeffery, Eddie James, Heinrich Schuchardt, Samuel Holland

[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]

On Tue, Aug 30, 2022 at 02:09:11PM +0200, Patrice Chotard wrote:

> Currently, if pin's function is GPIOF_FUNC, only "func" if displayed
> without any other information. It would be interesting, if information is
> available, to indicate which pinmuxing's name is used.
> 
> For example, for STM32 SoC's based platform, "gpio status" command
> output :
> 
>    before
>     Bank GPIOZ:
>       GPIOZ0: unused : 0 [ ]
>       GPIOZ1: unused : 0 [ ]
>       GPIOZ2: unused : 0 [ ]
>       GPIOZ3: unused : 0 [ ]
>       GPIOZ4: func
>       GPIOZ5: func
>       GPIOZ6: unused : 0 [ ]
>       GPIOZ7: unused : 0 [ ]
>       GPIOZ8: unknown
>       GPIOZ9: unknown
>       GPIOZ10: unknown
>       GPIOZ11: unknown
>       GPIOZ12: unknown
>       GPIOZ13: unknown
>       GPIOZ14: unknown
>       GPIOZ15: unknown
> 
>    After
>     Bank GPIOZ:
>       GPIOZ0: unused : 0 [ ]
>       GPIOZ1: unused : 0 [ ]
>       GPIOZ2: unused : 0 [ ]
>       GPIOZ3: unused : 0 [ ]
>       GPIOZ4: func i2c4-0
>       GPIOZ5: func i2c4-0
>       GPIOZ6: unused : 0 [ ]
>       GPIOZ7: unused : 0 [ ]
>       GPIOZ8: unknown
>       GPIOZ9: unknown
>       GPIOZ10: unknown
>       GPIOZ11: unknown
>       GPIOZ12: unknown
>       GPIOZ13: unknown
>       GPIOZ14: unknown
>       GPIOZ15: unknown
> 
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function
  2022-08-30 12:09 ` [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function Patrice Chotard
  2022-08-30 12:16   ` Patrick DELAUNAY
@ 2022-09-15 14:03   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Tom Rini @ 2022-09-15 14:03 UTC (permalink / raw)
  To: Patrice Chotard
  Cc: u-boot, Patrick DELAUNAY, U-Boot STM32, Simon Glass,
	Andrew Jeffery, Eddie James, Heinrich Schuchardt, Samuel Holland

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

On Tue, Aug 30, 2022 at 02:09:12PM +0200, Patrice Chotard wrote:

> Even pin with GPIOF_UNUSED function can have a label.
> The criteria to add or not a space character is linked to label not to
> the used/unused status.
> 
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name
  2022-08-30 12:09 ` [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name Patrice Chotard
  2022-08-30 12:21   ` Patrick DELAUNAY
@ 2022-09-15 14:03   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Tom Rini @ 2022-09-15 14:03 UTC (permalink / raw)
  To: Patrice Chotard; +Cc: u-boot, Patrick DELAUNAY, U-Boot STM32

[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]

On Tue, Aug 30, 2022 at 02:09:13PM +0200, Patrice Chotard wrote:

> Populate uc_priv->name[] with pinmux node's name in order to indicate
> the pinmuxing's name in case GPIO is configured in alternate.
> 
> For example, for STM32 SoC's based platform, "gpio status" command
> output :
> 
>   before
>     Bank GPIOZ:
>       GPIOZ0: unused : 0 [ ]
>       GPIOZ1: unused : 0 [ ]
>       GPIOZ2: unused : 0 [ ]
>       GPIOZ3: unused : 0 [ ]
>       GPIOZ4: func
>       GPIOZ5: func
>       GPIOZ6: unused : 0 [ ]
>       GPIOZ7: unused : 0 [ ]
>       GPIOZ8: unknown
>       GPIOZ9: unknown
>       GPIOZ10: unknown
>       GPIOZ11: unknown
>       GPIOZ12: unknown
>       GPIOZ13: unknown
>       GPIOZ14: unknown
>       GPIOZ15: unknown
> 
>   After
>     Bank GPIOZ:
>       GPIOZ0: unused : 0 [ ]
>       GPIOZ1: unused : 0 [ ]
>       GPIOZ2: unused : 0 [ ]
>       GPIOZ3: unused : 0 [ ]
>       GPIOZ4: func i2c4-0
>       GPIOZ5: func i2c4-0
>       GPIOZ6: unused : 0 [ ]
>       GPIOZ7: unused : 0 [ ]
>       GPIOZ8: unknown
>       GPIOZ9: unknown
>       GPIOZ10: unknown
>       GPIOZ11: unknown
>       GPIOZ12: unknown
>       GPIOZ13: unknown
>       GPIOZ14: unknown
>       GPIOZ15: unknown
> 
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function
  2022-08-30 12:09 ` [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function Patrice Chotard
  2022-08-30 12:24   ` Patrick DELAUNAY
@ 2022-09-15 14:03   ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Tom Rini @ 2022-09-15 14:03 UTC (permalink / raw)
  To: Patrice Chotard
  Cc: u-boot, Patrick DELAUNAY, U-Boot STM32, Simon Glass,
	Andrew Jeffery, Heinrich Schuchardt, Samuel Holland

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

On Tue, Aug 30, 2022 at 02:09:14PM +0200, Patrice Chotard wrote:

> This allows to test if a pin's label if displayed using gpio_get_status()
> when this pin is configured in alternate function.
> 
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2022-09-15 14:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 12:09 [PATCH v3 0/4] gpio: update gpio_get_status() Patrice Chotard
2022-08-30 12:09 ` [PATCH v3 1/4] gpio: Allow to print pin's label even for pin with GPIOF_FUNC function Patrice Chotard
2022-08-30 12:16   ` Patrick DELAUNAY
2022-09-15 14:02   ` Tom Rini
2022-08-30 12:09 ` [PATCH v3 2/4] gpio: Fix pin's status display for pin with GPIOF_UNUSED function Patrice Chotard
2022-08-30 12:16   ` Patrick DELAUNAY
2022-09-15 14:03   ` Tom Rini
2022-08-30 12:09 ` [PATCH v3 3/4] pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name Patrice Chotard
2022-08-30 12:21   ` Patrick DELAUNAY
2022-09-15 14:03   ` Tom Rini
2022-08-30 12:09 ` [PATCH v3 4/4] gpio: sandbox: Add GPIOD_IS_AF for gpio configured in alternate function Patrice Chotard
2022-08-30 12:24   ` Patrick DELAUNAY
2022-09-15 14:03   ` Tom Rini

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