All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue
@ 2021-01-20 12:43 Patrice Chotard
  2021-01-20 12:43 ` [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size Patrice Chotard
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Patrice Chotard @ 2021-01-20 12:43 UTC (permalink / raw)
  To: u-boot

pin-controller pin's name must be equal to pin's name used in device
tree with "pins" DT property.

Issue detected on stm32mp157c-ev1 board with goodix touchscreen.
In DT, the goodix's pin is declared in DT with the node:

        goodix_pins: goodix {
		pins = "gpio14";
		bias-pull-down;
	};

Whereas in stmfx pin-controller driver, pin's name are equal to
"stmfx_gpioxx" where xx is the pin number.
This lead to not configure stmfx's pins at probe because pins is
identified by its name (see pinctrl_pin_name_to_selector() in
pinctrl-generic.c) and stmfx pin "gpio14" can't be found.

To fix this issue, come back to the original stmfx pin's name.

Revert "pinctrl: stmfx: update pin name"

This reverts commit 38d30cdcd65c73eeefac5efa328ad444a53b77dd.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
---

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

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index a62be44d2d..b789f3686c 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -343,8 +343,8 @@ 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]"
+ * STMFX pins[15:0] are called "gpio[15:0]"
+ * and STMFX pins[23:16] are called "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, "stmfx_gpio%u", selector);
+		snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);
 	else
-		snprintf(pin_name, MAX_PIN_NAME_LEN, "stmfx_agpio%u", selector - 16);
+		snprintf(pin_name, MAX_PIN_NAME_LEN, "agpio%u", selector - 16);
 	return pin_name;
 }
 
-- 
2.17.1

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

* [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size
  2021-01-20 12:43 [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue Patrice Chotard
@ 2021-01-20 12:43 ` Patrice Chotard
  2021-01-27 14:06   ` Patrick DELAUNAY
  2021-02-09  9:27   ` Patrick DELAUNAY
  2021-01-27 14:05 ` [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue Patrick DELAUNAY
  2021-02-09  9:27 ` Patrick DELAUNAY
  2 siblings, 2 replies; 6+ messages in thread
From: Patrice Chotard @ 2021-01-20 12:43 UTC (permalink / raw)
  To: u-boot

Instead of redefining a pin's name size, use PINNAME_SIZE defined
in include/dm/pinctrl.h

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

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

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index b789f3686c..fbbd479575 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -346,15 +346,14 @@ 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]"
  */
-#define MAX_PIN_NAME_LEN 7
-static char pin_name[MAX_PIN_NAME_LEN];
+static char pin_name[PINNAME_SIZE];
 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, PINNAME_SIZE, "gpio%u", selector);
 	else
-		snprintf(pin_name, MAX_PIN_NAME_LEN, "agpio%u", selector - 16);
+		snprintf(pin_name, PINNAME_SIZE, "agpio%u", selector - 16);
 	return pin_name;
 }
 
-- 
2.17.1

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

* [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue
  2021-01-20 12:43 [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue Patrice Chotard
  2021-01-20 12:43 ` [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size Patrice Chotard
@ 2021-01-27 14:05 ` Patrick DELAUNAY
  2021-02-09  9:27 ` Patrick DELAUNAY
  2 siblings, 0 replies; 6+ messages in thread
From: Patrick DELAUNAY @ 2021-01-27 14:05 UTC (permalink / raw)
  To: u-boot

Hi Patrice,

On 1/20/21 1:43 PM, Patrice Chotard wrote:
> pin-controller pin's name must be equal to pin's name used in device
> tree with "pins" DT property.
>
> Issue detected on stm32mp157c-ev1 board with goodix touchscreen.
> In DT, the goodix's pin is declared in DT with the node:
>
>          goodix_pins: goodix {
> 		pins = "gpio14";
> 		bias-pull-down;
> 	};
>
> Whereas in stmfx pin-controller driver, pin's name are equal to
> "stmfx_gpioxx" where xx is the pin number.
> This lead to not configure stmfx's pins at probe because pins is
> identified by its name (see pinctrl_pin_name_to_selector() in
> pinctrl-generic.c) and stmfx pin "gpio14" can't be found.
>
> To fix this issue, come back to the original stmfx pin's name.
>
> Revert "pinctrl: stmfx: update pin name"
>
> This reverts commit 38d30cdcd65c73eeefac5efa328ad444a53b77dd.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
> ---
>
>   drivers/pinctrl/pinctrl-stmfx.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>

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

Thanks

Patrick

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

* [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size
  2021-01-20 12:43 ` [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size Patrice Chotard
@ 2021-01-27 14:06   ` Patrick DELAUNAY
  2021-02-09  9:27   ` Patrick DELAUNAY
  1 sibling, 0 replies; 6+ messages in thread
From: Patrick DELAUNAY @ 2021-01-27 14:06 UTC (permalink / raw)
  To: u-boot

Hi Patrice,

On 1/20/21 1:43 PM, Patrice Chotard wrote:
> Instead of redefining a pin's name size, use PINNAME_SIZE defined
> in include/dm/pinctrl.h
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
>
>   drivers/pinctrl/pinctrl-stmfx.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks

Patrick

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

* [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue
  2021-01-20 12:43 [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue Patrice Chotard
  2021-01-20 12:43 ` [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size Patrice Chotard
  2021-01-27 14:05 ` [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue Patrick DELAUNAY
@ 2021-02-09  9:27 ` Patrick DELAUNAY
  2 siblings, 0 replies; 6+ messages in thread
From: Patrick DELAUNAY @ 2021-02-09  9:27 UTC (permalink / raw)
  To: u-boot

Hi,

On 1/20/21 1:43 PM, Patrice Chotard wrote:
> pin-controller pin's name must be equal to pin's name used in device
> tree with "pins" DT property.
>
> Issue detected on stm32mp157c-ev1 board with goodix touchscreen.
> In DT, the goodix's pin is declared in DT with the node:
>
>          goodix_pins: goodix {
> 		pins = "gpio14";
> 		bias-pull-down;
> 	};
>
> Whereas in stmfx pin-controller driver, pin's name are equal to
> "stmfx_gpioxx" where xx is the pin number.
> This lead to not configure stmfx's pins at probe because pins is
> identified by its name (see pinctrl_pin_name_to_selector() in
> pinctrl-generic.c) and stmfx pin "gpio14" can't be found.
>
> To fix this issue, come back to the original stmfx pin's name.
>
> Revert "pinctrl: stmfx: update pin name"
>
> This reverts commit 38d30cdcd65c73eeefac5efa328ad444a53b77dd.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
> ---
>
>   drivers/pinctrl/pinctrl-stmfx.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>

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

Regards

Patrick

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

* [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size
  2021-01-20 12:43 ` [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size Patrice Chotard
  2021-01-27 14:06   ` Patrick DELAUNAY
@ 2021-02-09  9:27   ` Patrick DELAUNAY
  1 sibling, 0 replies; 6+ messages in thread
From: Patrick DELAUNAY @ 2021-02-09  9:27 UTC (permalink / raw)
  To: u-boot

Hi,


On 1/20/21 1:43 PM, Patrice Chotard wrote:
> Instead of redefining a pin's name size, use PINNAME_SIZE defined
> in include/dm/pinctrl.h
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
>
>   drivers/pinctrl/pinctrl-stmfx.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>

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


Regards

Patrick

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

end of thread, other threads:[~2021-02-09  9:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 12:43 [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue Patrice Chotard
2021-01-20 12:43 ` [PATCH 2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size Patrice Chotard
2021-01-27 14:06   ` Patrick DELAUNAY
2021-02-09  9:27   ` Patrick DELAUNAY
2021-01-27 14:05 ` [PATCH 1/2] pinctrl: stmfx: Fix pin configuration issue Patrick DELAUNAY
2021-02-09  9:27 ` Patrick DELAUNAY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.