From: Patrice Chotard Date: Wed, 20 Jan 2021 12:43:39 +0000 (+0100) Subject: pinctrl: stmfx: Fix pin configuration issue X-Git-Url: http://git.dujemihanovic.xyz/html/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=54f5bf3d61084c15a9e364ac7a5fdede7c1c780e;p=u-boot.git pinctrl: stmfx: Fix pin configuration issue 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 Tested-by: Patrick DELAUNAY Reviewed-by: Patrick Delaunay --- diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index 7cf08dbddd..b4baf357dd 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; }