Skip to contentSkip to conversation

pinctrl: qcom: Add QCS615 LPASS LPI pinctrl support

PATCH Superseded Karthik S 4 participants 9 messages Sep 8 – Nov 17

Subsystems (6)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Karthik S

author
#0 lore raw

cover pinctrl: qcom: Add QCS615 LPASS LPI pinctrl support

This series adds LPASS (Low Power Audio SubSystem) LPI (Low Power Island) pinctrl support for Qualcomm QCS615 SoC.

The LPASS LPI TLMM is a dedicated pin controller for audio pins on QCS615 which supports 32 GPIOs (gpio0-gpio31) with mux functions for i2s1, dmic1, dmic2 and spkr_i2s_mclk_a.

Karthik S (2):
dt-bindings: pinctrl: qcom: Add QCS615 LPASS LPI pinctrl bindings
pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

 .../qcom,qcs615-lpass-lpi-pinctrl.yaml        | 114 +++++++++++
 arch/arm64/configs/defconfig                  |   1 +
 drivers/pinctrl/qcom/Kconfig                  |  10 +
 drivers/pinctrl/qcom/Makefile                 |   1 +
 .../pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c   | 185 ++++++++++++++++++
 5 files changed, 311 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,qcs615-lpass-lpi-pinctrl.yaml
 create mode 100644 drivers/pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/2 dt-bindings: pinctrl: qcom: Add QCS615 LPASS LPI pinctrl bindings

Add bindings for the pin controller in the QCS615 Low Power Audio SubSystem (LPASS) Low Power Island (LPI).

The LPASS LPI TLMM is a dedicated pin controller for audio pins on QCS615 which supports 32 GPIOs (gpio0-gpio31) with functions including i2s1, dmic1, dmic2 and spkr_i2s_mclk_a.

---
 .../qcom,qcs615-lpass-lpi-pinctrl.yaml        | 114 ++++++++++++++++++
 1 file changed, 114 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,qcs615-lpass-lpi-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/qcom,qcs615-lpass-lpi-pinctrl.yaml new file +114 -0
new file mode 100644
index 000000000000..dc1525d7bf55
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/qcom,qcs615-lpass-lpi-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm QCS615 SoC LPASS LPI TLMM
+
+maintainers:
+  - Karthik S <[email protected]>
+
+description:
+  Top Level Mode Multiplexer pin controller in the Low Power Audio SubSystem
+  (LPASS) Low Power Island (LPI) of Qualcomm QCS615 SoC.
+
+properties:
+  compatible:
+    const: qcom,qcs615-lpass-lpi-pinctrl
+
+  reg:
+    items:
+      - description: LPASS LPI TLMM Control and Status registers
+      - description: LPASS LPI MCC registers
+
+  clocks:
+    items:
+      - description: LPASS Core voting clock
+
+  clock-names:
+    items:
+      - const: core
+
+patternProperties:
+  "-state$":
+    oneOf:
+      - $ref: "#/$defs/qcom-qcs615-lpass-state"
+      - patternProperties:
+          "-pins$":
+            $ref: "#/$defs/qcom-qcs615-lpass-state"
+        additionalProperties: false
+
+$defs:
+  qcom-qcs615-lpass-state:
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin configuration.
+      Client device subnodes use below standard properties.
+    $ref: qcom,lpass-lpi-common.yaml#/$defs/qcom-tlmm-state
+    unevaluatedProperties: false
+
+    properties:
+      pins:
+        description:
+          List of gpio pins affected by the properties specified in this
+          subnode.
+        items:
+          pattern: "^gpio([0-9]|1[0-9]|2[0-9]|3[0-1])$"
+
+      function:
+        enum: [ dmic1_clk, dmic1_data, dmic2_clk, dmic2_data, gpio, i2s1_clk,
+                i2s1_data, i2s1_ws, spkr_i2s_mclk_a ]
+        description:
+          Specify the alternative function to be configured for the specified
+          pins.
+
+allOf:
+  - $ref: qcom,lpass-lpi-common.yaml#
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/sound/qcom,q6afe.h>
+    lpi_tlmm: pinctrl@62b40000 {
+        compatible = "qcom,qcs615-lpass-lpi-pinctrl";
+        reg = <0x62b40000 0x20000>,
+              <0x62b00000 0x10000>;
+        clocks = <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+        clock-names = "core";
+        gpio-controller;
+        #gpio-cells = <2>;
+        gpio-ranges = <&lpi_tlmm 0 0 32>;
+
+        i2s1-active-state {
+            clk-pins {
+                pins = "gpio8";
+                function = "i2s1_clk";
+                drive-strength = <8>;
+                bias-disable;
+                output-high;
+            };
+
+            ws-pins {
+                pins = "gpio9";
+                function = "i2s1_ws";
+                drive-strength = <8>;
+                bias-disable;
+                output-high;
+            };
+
+            data-pins {
+                pins = "gpio10", "gpio11";
+                function = "i2s1_data";
+                drive-strength = <8>;
+                bias-disable;
+            };
+        };
+    };
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/2 pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

In reply to Karthik S

Add pinctrl driver to support pin configuration for LPASS (Low Power Audio SubSystem) LPI (Low Power Island) pinctrl on QCS615.

This IP is an additional pin control block for Audio Pins on top the existing SoC Top level pin-controller.

This pin controller has some similarities compared to Top level msm SoC Pin controller like 'each pin belongs to a single group' and so on. However this one is intended to control only audio pins in particular, which can not be configured/touched by the Top level SoC pin controller except setting them as gpios.

---
 arch/arm64/configs/defconfig                  |   1 +
 drivers/pinctrl/qcom/Kconfig                  |  10 +
 drivers/pinctrl/qcom/Makefile                 |   1 +
 .../pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c   | 185 ++++++++++++++++++
 4 files changed, 197 insertions(+)
 create mode 100644 drivers/pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c
arch/arm64/configs/defconfig +1 -0
index 6ec8d3a69c98..80423678fe25 100644
@@ -700,6 +700,7 @@ CONFIG_PINCTRL_IMX_SCMI=y
 CONFIG_PINCTRL_IMX91=y
 CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
 CONFIG_PINCTRL_LPASS_LPI=m
+CONFIG_PINCTRL_QCS615_LPASS_LPI=m
 CONFIG_PINCTRL_MILOS_LPASS_LPI=m
 CONFIG_PINCTRL_SC7280_LPASS_LPI=m
 CONFIG_PINCTRL_SM6115_LPASS_LPI=m
drivers/pinctrl/qcom/Kconfig +10 -0
index 18db350222b9..9cef5fccae3f 100644
@@ -62,6 +62,16 @@ config PINCTRL_LPASS_LPI
 	  Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
 	  (Low Power Island) found on the Qualcomm Technologies Inc SoCs.
 
+config PINCTRL_QCS615_LPASS_LPI
+       tristate "Qualcomm Technologies Inc QCS615 LPASS LPI pin controller driver"
+       depends on ARM64 || COMPILE_TEST
+       depends on PINCTRL_LPASS_LPI
+       help
+         This is the pinctrl, pinmux, pinconf and gpiolib driver for the
+         Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
+         (Low Power Island) found on the Qualcomm Technologies Inc QCS615
+         platform.
+
 config PINCTRL_MILOS_LPASS_LPI
 	tristate "Qualcomm Milos LPASS LPI pin controller driver"
 	depends on ARM64 || COMPILE_TEST
drivers/pinctrl/qcom/Makefile +1 -0
index 43ecd246afe8..de2c9bdfbad2 100644
@@ -33,6 +33,7 @@ obj-$(CONFIG_PINCTRL_MSM8998)   += pinctrl-msm8998.o
 obj-$(CONFIG_PINCTRL_QCM2290)	+= pinctrl-qcm2290.o
 obj-$(CONFIG_PINCTRL_QCS404)	+= pinctrl-qcs404.o
 obj-$(CONFIG_PINCTRL_QCS615)    += pinctrl-qcs615.o
+obj-$(CONFIG_PINCTRL_QCS615_LPASS_LPI) += pinctrl-qcs615-lpass-lpi.o
 obj-$(CONFIG_PINCTRL_QCS8300)	+= pinctrl-qcs8300.o
 obj-$(CONFIG_PINCTRL_QDF2XXX)	+= pinctrl-qdf2xxx.o
 obj-$(CONFIG_PINCTRL_MDM9607)	+= pinctrl-mdm9607.o
drivers/pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c new file +185 -0

185 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v1 2/2] pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Unused static arrays (`gpio0_pins` through `gpio31_pins`) will cause compiler warnings --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Unused static arrays (gpio0_pins through gpio31_pins) will cause compiler warnings --

commit 72e924992eb3de90f14daba573a913e0c3530e32
Author: Karthik S <[email protected]>

pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

This commit adds a pinctrl driver to support pin configuration for the Low Power Audio SubSystem (LPASS) Low Power Island (LPI) on QCS615. It introduces a separate pin controller block specifically intended to control audio pins.

Quoted 4 lines
drivers/pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c new file +0 -0
new file mode 100644

[ ... ]

Quoted 2 lines
drivers/pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c new file +2 -0
+static int gpio8_pins[] = { 8 };
+static int gpio9_pins[] = { 9 };

[ ... ]

Quoted 1 line

+static int gpio31_pins[] = { 31 };

[Severity: Low]
Are these static integer arrays (gpio0_pins through gpio31_pins) necessary? They appear to be unreferenced in this source file and will cause unused variable warnings.

Unlike the top-level MSM pinctrl driver's PINGROUP macro, the LPASS LPI framework's LPI_PINGROUP macro does not seem to utilize these arrays.

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

Re: [PATCH v1 2/2] pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

In reply to Karthik S
Quoted 13 lines · Karthik S

Add pinctrl driver to support pin configuration for LPASS (Low Power Audio SubSystem) LPI (Low Power Island) pinctrl on QCS615.

This IP is an additional pin control block for Audio Pins on top the existing SoC Top level pin-controller.

This pin controller has some similarities compared to Top level msm SoC Pin controller like 'each pin belongs to a single group' and so on. However this one is intended to control only audio pins in particular, which can not be configured/touched by the Top level SoC pin controller except setting them as gpios.

Quoted 6 lines
---
 arch/arm64/configs/defconfig                  |   1 +
 drivers/pinctrl/qcom/Kconfig                  |  10 +
 drivers/pinctrl/qcom/Makefile                 |   1 +
 .../pinctrl/qcom/pinctrl-qcs615-lpass-lpi.c   | 185 ++++++++++++++++++

This patch produces dozens of compile warnings and is not split properly per subsystem.

Also, it looks like the data you provided here is a subset of pinctrl-sdm670-lpass-lpi.c - is there a chance that the block is directly copy-pasted between these SoCs? Are the extra functions present on 670 also present on QCS615?

Konrad

author
#5 lore raw

Re: [PATCH v1 2/2] pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

Quoted 4 lines · Konrad Dybcio

Also, it looks like the data you provided here is a subset of pinctrl-sdm670-lpass-lpi.c - is there a chance that the block is directly copy-pasted between these SoCs? Are the extra functions present on 670 also present on QCS615?

Hi Konrad,

As you suggested we tried pinctrl-sdm670-lpass-lpi.c on QCS615 and it works fine, the alternate functions seem to be similar between sdm670 and QCS615, we will use the existing pinctrl driver and post the dts and machine driver changes for the same.

Thanks and regards,
Karthik S

author
#6 lore raw

Re: [PATCH v1 2/2] pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

Quoted 1 line · Karthik S

As you suggested we tried pinctrl-sdm670-lpass-lpi.c on QCS615 and it works fine, the alternate functions seem to be similar between sdm670 and QCS615, we will use the existing pinctrl driver and post the dts and machine driver changes for the same.

hi Konrad,

but we will have to add pm_ops support for enablement of clocks, similar to sc8280xp lpi to scdm670 lpass lpi pinctrl driver.

Thanks and regards,
karthik S

author
#7 lore raw

Re: [PATCH v1 2/2] pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

In reply to Konrad Dybcio
Quoted 7 lines · Konrad Dybcio

This patch produces dozens of compile warnings and is not split properly per subsystem.

Also, it looks like the data you provided here is a subset of pinctrl-sdm670-lpass-lpi.c - is there a chance that the block is directly copy-pasted between these SoCs? Are the extra functions present on 670 also present on QCS615?

Hi Konrad,

Initially the i2s1 functionality seem to be similar between this new pinctrl driver and sdm670, but now for further implementation upon further inspection , there seems to be differences between the functionality of this new pinctrl driver and sdm670 for example : i2s2 functions from LPI GPIO 23-28, will send v2 with new functions, hence we will prefer going with this new pinctrl driver

Thanks,
Karthik S

#8 lore raw

Re: [PATCH v1 2/2] pinctrl: qcom: Add qcs615 lpass lpi pinctrl driver

In reply to Karthik S
Quoted 13 lines · Karthik S

Add pinctrl driver to support pin configuration for LPASS (Low Power Audio SubSystem) LPI (Low Power Island) pinctrl on QCS615.

This IP is an additional pin control block for Audio Pins on top the existing SoC Top level pin-controller.

This pin controller has some similarities compared to Top level msm SoC Pin controller like 'each pin belongs to a single group' and so on. However this one is intended to control only audio pins in particular, which can not be configured/touched by the Top level SoC pin controller except setting them as gpios.

Quoted 3 lines
---
 arch/arm64/configs/defconfig                  |   1 +

This should not be here.

Best regards,
Krzysztof