The QCM2290 function table only lists "qup4" (the debug UART) and
"gpio". The default pin state of every other QUP serial engine refers
to its own "qupN" function, so the function name lookup fails with
-ENOENT when such a device probes. On the Arduino UNO Q
(qrb2210-arduino-imola) this prints a warning for each enabled engine
on every boot:

  i2c_geni i2c@4a80000: pinctrl_select_state_full: pinctrl_config_one: err=-2
  i2c_geni i2c@4a84000: pinctrl_select_state_full: pinctrl_config_one: err=-2
  serial_msm_geni serial@4a88000: pinctrl_select_state_full: 
pinctrl_config_one: err=-2
  serial_msm_geni serial@4a8c000: pinctrl_select_state_full: 
pinctrl_config_one: err=-2

The warning is not fatal, but the state is not applied either: the
lookup fails on the "function" property, so neither the mux nor the
drive-strength and bias settings that follow it in the state node are
written. The pins keep whatever the previous boot stage left there, and
a driver using one of these engines only works if that stage happened
to configure them.

Add qup0-qup3 and qup5. On QCM2290 each QUP function is in mux slot 1
on every pin that can carry it (see the pin groups in Linux's
pinctrl-qcm2290.c):

  qup0: gpio0-3, gpio82, gpio86
  qup1: gpio4, gpio5, gpio69, gpio70
  qup2: gpio6, gpio7, gpio71, gpio80
  qup3: gpio8-11
  qup4: gpio12, gpio13, gpio96, gpio97
  qup5: gpio14-17

so a single mux value per function is enough, as it already is for
qup4.

Tested on the Arduino UNO Q: the four warnings are gone and the board
still boots Linux through U-Boot.

Signed-off-by: Igor Opaniuk <[email protected]>
---
Add the missing qup0-qup3 and qup5 functions to the QCM2290 pin
controller, so the default pin states of the QUP serial engines apply
instead of failing with -ENOENT on every boot.
---
 drivers/pinctrl/qcom/pinctrl-qcm2290.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pinctrl/qcom/pinctrl-qcm2290.c 
b/drivers/pinctrl/qcom/pinctrl-qcm2290.c
index 84f76b63b93..766c7cd0db2 100644
--- a/drivers/pinctrl/qcom/pinctrl-qcm2290.c
+++ b/drivers/pinctrl/qcom/pinctrl-qcm2290.c
@@ -13,8 +13,14 @@
 #define MAX_PIN_NAME_LEN 32
 static char pin_name[MAX_PIN_NAME_LEN] __section(".data");
 
+/* The QUP serial engines are function 1 on every pin they can use. */
 static const struct pinctrl_function msm_pinctrl_functions[] = {
+       { "qup0", 1 },
+       { "qup1", 1 },
+       { "qup2", 1 },
+       { "qup3", 1 },
        { "qup4", 1 },
+       { "qup5", 1 },
        { "gpio", 0 },
 };
 

---
base-commit: 3973f3c4d24df75ca90d7c0a9f03e5e5c9b48f32
change-id: 20261030-qcm2290-qup-pinctrl-af359d6c3099

Best regards,
-- 
Igor Opaniuk <[email protected]>

Reply via email to