Skip to contentSkip to conversation

Add pinctrl driver for Qualcomm Halliday (SXR2250P)

PATCH Superseded Stanislav Aleksandrov 3 participants 5 messages Nov 24

Subsystems (6)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add pinctrl driver for Qualcomm Halliday (SXR2250P)

This series adds the devicetree bindings and pinctrl/GPIO driver for the Top-Level Mode Multiplexer (TLMM) on the Qualcomm Halliday (SXR2250P / Snapdragon XR2+ Gen 2) SoC.

This is part of the initial bring-up effort for Qualcomm Halliday and Samsung Galaxy XR.

This work was made together with Claude, ChatGPT and Gemini. Reviewed and tested on my Galaxy XR.

---
Changes in v3:
- Add the egpio function for GPIOs 185 to 223, which have EGPIO_PRESENT
set (Bartosz). The binding gets it in its function list.
- Use the exact PDC map provided by Bartosz
- Add the Reviewed-by tag (Krzysztof)
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- dt-bindings: Add the tlmm label that gpio-ranges refers to in the
example (Bartosz)
- Link to v1: https://patch.msgid.link/[email protected]

---
Stanislav Aleksandrov (2):
dt-bindings: pinctrl: document the Halliday Top Level Mode Multiplexer
pinctrl: qcom: Add Halliday pinctrl driver

 .../bindings/pinctrl/qcom,halliday-tlmm.yaml       |  146 ++
 drivers/pinctrl/qcom/Kconfig.msm                   |   10 +
 drivers/pinctrl/qcom/Makefile                      |    1 +
 drivers/pinctrl/qcom/pinctrl-halliday.c            | 1840 ++++++++++++++++++++
 4 files changed, 1997 insertions(+)

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261108-halliday-tlmm-f250374110e0

Best regards,

Signature · 1 line
Stanislav Aleksandrov <[email protected]>
#1 lore raw

PATCH v3 1/2 dt-bindings: pinctrl: document the Halliday Top Level Mode Multiplexer

Document the Top Level Mode Multiplexer on the Qualcomm Halliday SoC (SXR2250P).

---
 .../bindings/pinctrl/qcom,halliday-tlmm.yaml       | 146 +++++++++++++++++++++
 1 file changed, 146 insertions(+)
Documentation/devicetree/bindings/pinctrl/qcom,halliday-tlmm.yaml new file +146 -0
new file mode 100644
index 000000000000..2615d40b0478
@@ -0,0 +1,146 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/qcom,halliday-tlmm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies, Inc. Halliday TLMM block
+
+maintainers:
+  - Stanislav Aleksandrov <[email protected]>
+
+description:
+  Top Level Mode Multiplexer pin controller in Qualcomm Halliday SoC.
+
+allOf:
+  - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
+
+properties:
+  compatible:
+    const: qcom,halliday-tlmm
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  gpio-reserved-ranges:
+    minItems: 1
+    maxItems: 112
+
+  gpio-line-names:
+    maxItems: 224
+
+patternProperties:
+  "-state$":
+    oneOf:
+      - $ref: "#/$defs/qcom-halliday-tlmm-state"
+      - patternProperties:
+          "-pins$":
+            $ref: "#/$defs/qcom-halliday-tlmm-state"
+        additionalProperties: false
+
+$defs:
+  qcom-halliday-tlmm-state:
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin configuration.
+      Client device subnodes use below standard properties.
+    $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
+    unevaluatedProperties: false
+
+    properties:
+      pins:
+        description:
+          List of gpio pins affected by the properties specified in this
+          subnode.
+        items:
+          oneOf:
+            - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|2[01][0-9]|22[0-3])$"
+            - enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ]
+        minItems: 1
+        maxItems: 36
+
+      function:
+        description:
+          Specify the alternative function to be configured for the specified
+          pins.
+        enum: [ atest_char, atest_usb, audio_ext_mclk0, audio_ext_mclk1,
+                audio_ref_clk, cam_mclk, cci_async_in, cci_i2c_scl,
+                cci_i2c_sda, cci_timer, cmu_rng, dbg_out_clk,
+                ddr_bist_complete, ddr_bist_fail, ddr_bist_start,
+                ddr_bist_stop, ddr_pxi0, ddr_pxi1, ddr_pxi2, ddr_pxi3, dp0_hot,
+                edp0_hot, edp0_lcd_self, edp1_dpu0_lcd, edp1_dpu1_lcd,
+                edp1_hot, egpio, gcc_gp1, gcc_gp10, gcc_gp11, gcc_gp2, gcc_gp3,
+                gcc_gp4, gcc_gp5, gcc_gp6, gcc_gp7, gcc_gp8, gcc_gp9, gpio,
+                i2s0_data0, i2s0_data1, i2s0_sck, i2s0_ws, i2s2_data0,
+                i2s2_data1, i2s2_sck, i2s2_ws, ibi_i3c, jitter_bist,
+                mdp0_vsync, mdp0_vsync0_out, mdp0_vsync1_out, mdp0_vsync2_out,
+                mdp0_vsync3_out, mdp0_vsync4_out, mdp0_vsync5_out,
+                mdp0_vsync6_out, mdp0_vsync7_out, mdp0_vsync8_out, mdp1_vsync,
+                mdp1_vsync0_out, mdp1_vsync1_out, mdp1_vsync2_out,
+                mdp1_vsync3_out, mdp1_vsync4_out, mdp1_vsync5_out,
+                mdp1_vsync6_out, mdp1_vsync7_out, mdp1_vsync8_out,
+                pcie0_clk_req_n, pcie1_clk_req_n, pcie2_clk_req_n, phase_flag,
+                pll_bist_sync, pll_clk_aux, prng_rosc0, prng_rosc1, prng_rosc2,
+                prng_rosc3, pwm_0, pwm_1, pwm_10, pwm_11, pwm_12, pwm_13,
+                pwm_14, pwm_15, pwm_16, pwm_17, pwm_18, pwm_19, pwm_2, pwm_3,
+                pwm_4, pwm_5, pwm_6, pwm_7, pwm_8, pwm_9, qdss_cti, qdss_gpio,
+                qup0_se0, qup0_se1, qup0_se2, qup0_se3, qup0_se4,
+                qup0_se4_l0_mira, qup0_se4_l0_mirb, qup0_se4_l1_mira,
+                qup0_se4_l1_mirb, qup0_se4_l2_mira, qup0_se4_l2_mirb,
+                qup0_se4_l3_mira, qup0_se4_l3_mirb, qup0_se5, qup0_se6,
+                qup1_se0, qup1_se0_l3_mira, qup1_se0_l3_mirb, qup1_se1,
+                qup1_se1_l3_mira, qup1_se1_l3_mirb, qup1_se2, qup1_se2_l3_mira,
+                qup1_se2_l3_mirb, qup1_se3, qup1_se3_l3_mira, qup1_se3_l3_mirb,
+                qup1_se4, qup1_se5, qup1_se6, qup1_se6_l0_mira,
+                qup1_se6_l0_mirb, qup1_se6_l1_mira, qup1_se6_l1_mirb,
+                sd_write_protect, sdcc5_vdd2_on, tb_trig_sdc2, tgu_ch0_trigout,
+                tgu_ch1_trigout, tgu_ch2_trigout, tgu_ch3_trigout, tmess_prng0,
+                tmess_prng1, tmess_prng2, tmess_prng3, tsense_pwm1,
+                tsense_pwm2, usb0_phy_ps, usb2phy_ac_en,
+                vsense_trigger_mirnat ]
+
+    required:
+      - pins
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    tlmm: pinctrl@f100000 {
+        compatible = "qcom,halliday-tlmm";
+        reg = <0x0f100000 0x300000>;
+        gpio-controller;
+        #gpio-cells = <2>;
+        gpio-ranges = <&tlmm 0 0 225>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+        interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
+
+        gpio-wo-state {
+            pins = "gpio1";
+            function = "gpio";
+        };
+
+        i2c-w-state {
+            scl-pins {
+                pins = "gpio58";
+                function = "qup1_se0";
+                bias-pull-up;
+            };
+
+            sda-pins {
+                pins = "gpio57";
+                function = "qup1_se0";
+                bias-pull-up;
+            };
+        };
+    };
+...
Signature · 1 line
2.55.0
#2 lore raw

PATCH v3 2/2 pinctrl: qcom: Add Halliday pinctrl driver

In reply to Stanislav Aleksandrov

Add the pinctrl driver for the TLMM block found in the Qualcomm Halliday
SoC: 224 GPIOs with their functions and PDC wakeup interrupts, the UFS reset pin and the SDC2 pins.

The tables are based on Qualcomm's downstream pinctrl-anorak driver. The exact PDC map was provided by Bartosz Golaszewski.

---
 drivers/pinctrl/qcom/Kconfig.msm        |   10 +
 drivers/pinctrl/qcom/Makefile           |    1 +
 drivers/pinctrl/qcom/pinctrl-halliday.c | 1840 +++++++++++++++++++++++++++++++
 3 files changed, 1851 insertions(+)
drivers/pinctrl/qcom/Kconfig.msm +10 -0
index e45c701db627..2d470783bfe1 100644
@@ -39,6 +39,16 @@ config PINCTRL_GLYMUR
 	  Say Y here to compile statically, or M here to compile it as a module.
 	  If unsure, say N.
 
+config PINCTRL_HALLIDAY
+	tristate "Qualcomm Halliday pin controller driver"
+	depends on ARM64 || COMPILE_TEST
+	default ARCH_QCOM
+	help
+	  This is the pinctrl, pinmux, pinconf and gpiolib driver for the
+	  Qualcomm Technologies Inc TLMM block found on the Qualcomm
+	  Technologies Inc Halliday platform
+	  (SXR2250P / Snapdragon XR2+ Gen 2).
+
 config PINCTRL_HAWI
 	tristate "Qualcomm Hawi pin controller driver"
 	depends on ARM64 || COMPILE_TEST
drivers/pinctrl/qcom/Makefile +1 -0
index a3daca77a448..c2b3cb284faa 100644
@@ -5,6 +5,7 @@ obj-$(CONFIG_PINCTRL_APQ8064)	+= pinctrl-apq8064.o
 obj-$(CONFIG_PINCTRL_APQ8084)	+= pinctrl-apq8084.o
 obj-$(CONFIG_PINCTRL_ELIZA)	+= pinctrl-eliza.o
 obj-$(CONFIG_PINCTRL_GLYMUR)	+= pinctrl-glymur.o
+obj-$(CONFIG_PINCTRL_HALLIDAY)	+= pinctrl-halliday.o
 obj-$(CONFIG_PINCTRL_HAWI)	+= pinctrl-hawi.o
 obj-$(CONFIG_PINCTRL_HAWI_LPASS_LPI) += pinctrl-hawi-lpass-lpi.o
 obj-$(CONFIG_PINCTRL_IPQ4019)	+= pinctrl-ipq4019.o
drivers/pinctrl/qcom/pinctrl-halliday.c new file +1840 -0

1,840 lines not on this page · raw message

Signature · 1 line
2.55.0
#3 lore raw

Re: [PATCH v3 2/2] pinctrl: qcom: Add Halliday pinctrl driver

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] pinctrl: qcom: halliday: egpio function missing MSM_GPIO_PIN_FUNCTION() --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] pinctrl: qcom: halliday: egpio function missing MSM_GPIO_PIN_FUNCTION()
--

commit 15b578bd9798073a1a0bb1b2dd492309ef5f9871
Author: Stanislav Aleksandrov <[email protected]>

pinctrl: qcom: Add Halliday pinctrl driver

This commit adds the pinctrl driver for the TLMM block on the Qualcomm Halliday SoC, covering 224 GPIOs, PDC wakeup interrupts, UFS reset, and SDC2 pins.

Quoted 5 lines
drivers/pinctrl/qcom/pinctrl-halliday.c new file +0 -0
new file mode 100644
index 0000000000000..a8f501457b35b

[ ... ]

Quoted 2 lines
drivers/pinctrl/qcom/pinctrl-halliday.c new file +2 -0
+static const struct pinfunction halliday_functions[] = {
+	MSM_GPIO_PIN_FUNCTION(gpio),

[ ... ]

drivers/pinctrl/qcom/pinctrl-halliday.c line 1410

Quoted 2 lines
drivers/pinctrl/qcom/pinctrl-halliday.c new file +2 -0
+	MSM_PIN_FUNCTION(edp1_hot),
+	MSM_PIN_FUNCTION(egpio),

[Severity: Medium]
Should the egpio entry in halliday_functions[] use MSM_GPIO_PIN_FUNCTION(egpio) instead of MSM_PIN_FUNCTION(egpio)?

msm_pinmux_ops sets .strict = true and .function_is_gpio = pinmux_generic_function_is_gpio. Without PINFUNCTION_FLAG_GPIO on egpio, pin_request() rejects GPIO requests with -EINVAL for any pin in egpio_groups (gpio185 through gpio223) that is muxed to the egpio function, as addressed in 480dc1952404 ("pinctrl: qcom: mark the gpio and egpio pins function as non-strict functions").

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#4 lore raw

Re: [PATCH v3 2/2] pinctrl: qcom: Add Halliday pinctrl driver

In reply to Stanislav Aleksandrov
Quoted 10 lines · Stanislav Aleksandrov

Add the pinctrl driver for the TLMM block found in the Qualcomm Halliday
SoC: 224 GPIOs with their functions and PDC wakeup interrupts, the UFS reset pin and the SDC2 pins.

The tables are based on Qualcomm's downstream pinctrl-anorak driver. The exact PDC map was provided by Bartosz Golaszewski.

---

...

Quoted 20 lines
drivers/pinctrl/qcom/pinctrl-halliday.c new file +20 -0
+
+static const struct pinfunction halliday_functions[] = {
+	MSM_GPIO_PIN_FUNCTION(gpio),
+	MSM_PIN_FUNCTION(atest_char),
+	MSM_PIN_FUNCTION(atest_usb),
+	MSM_PIN_FUNCTION(audio_ext_mclk0),
+	MSM_PIN_FUNCTION(audio_ext_mclk1),
+	MSM_PIN_FUNCTION(audio_ref_clk),
+	MSM_PIN_FUNCTION(cam_mclk),
+	MSM_PIN_FUNCTION(cci_async_in),
+	MSM_PIN_FUNCTION(cci_i2c_scl),
+	MSM_PIN_FUNCTION(cci_i2c_sda),
+	MSM_PIN_FUNCTION(cci_timer),
+	MSM_PIN_FUNCTION(cmu_rng),
+	MSM_PIN_FUNCTION(dbg_out_clk),
+	MSM_PIN_FUNCTION(ddr_bist_complete),
+	MSM_PIN_FUNCTION(ddr_bist_fail),
+	MSM_PIN_FUNCTION(ddr_bist_start),
+	MSM_PIN_FUNCTION(ddr_bist_stop),
+	MSM_PIN_FUNCTION(ddr_pxi0),

drivers/pinctrl/qcom/pinctrl-halliday.c line 1410

Quoted 10 lines
drivers/pinctrl/qcom/pinctrl-halliday.c new file +10 -0
+	MSM_PIN_FUNCTION(ddr_pxi1),
+	MSM_PIN_FUNCTION(ddr_pxi2),
+	MSM_PIN_FUNCTION(ddr_pxi3),
+	MSM_PIN_FUNCTION(dp0_hot),
+	MSM_PIN_FUNCTION(edp0_hot),
+	MSM_PIN_FUNCTION(edp0_lcd_self),
+	MSM_PIN_FUNCTION(edp1_dpu0_lcd),
+	MSM_PIN_FUNCTION(edp1_dpu1_lcd),
+	MSM_PIN_FUNCTION(edp1_hot),
+	MSM_PIN_FUNCTION(egpio),

Please use MSM_GPIO_PIN_FUNCTION() here. See the series[1] I just sent out too for reference.

Thanks,
Bartosz

[1] https://lore.kernel.org/all/[email protected]/