From: Luca Weiss <luca.weiss@fairphone.com>
To: Sumit Garg <sumit.garg@kernel.org>,
u-boot@lists.denx.de, u-boot-qcom@groups.io
Cc: Tom Rini <trini@konsulko.com>, Lukasz Majewski <lukma@denx.de>,
Casey Connolly <casey.connolly@linaro.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Biswapriyo Nath <nathbappai@gmail.com>,
Aswin Murugan <aswin.murugan@oss.qualcomm.com>,
Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Johan Jonker <jbx6244@gmail.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Antony Kurniawan Soemardi <linux@smankusors.com>,
Luca Weiss <luca.weiss@fairphone.com>
Subject: [PATCH 3/4] drivers: pinctrl: Add Qualcomm MSM8953 TLMM driver
Date: Wed, 15 Jul 2026 17:17:42 +0200 [thread overview]
Message-ID: <20260715-msm8953-basic-v1-3-bc4cb5099d8e@fairphone.com> (raw)
In-Reply-To: <20260715-msm8953-basic-v1-0-bc4cb5099d8e@fairphone.com>
Add support for TLMM pin controller block (Top Level Mode Multiplexer)
on MSM8953 SoC.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
drivers/pinctrl/qcom/Kconfig | 8 ++++
drivers/pinctrl/qcom/Makefile | 1 +
drivers/pinctrl/qcom/pinctrl-msm8953.c | 80 ++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+)
diff --git a/drivers/pinctrl/qcom/Kconfig b/drivers/pinctrl/qcom/Kconfig
index 0bea461fcc3..21e735a2b99 100644
--- a/drivers/pinctrl/qcom/Kconfig
+++ b/drivers/pinctrl/qcom/Kconfig
@@ -62,6 +62,14 @@ config PINCTRL_QCOM_MILOS
Say Y here to enable support for pinctrl on the Snapdragon Milos SoC,
as well as the associated GPIO driver.
+config PINCTRL_QCOM_MSM8953
+ bool "Qualcomm MSM8953 Pinctrl"
+ default y if PINCTRL_QCOM_GENERIC
+ select PINCTRL_QCOM
+ help
+ Say Y here to enable support for pinctrl on the MSM8953 SoC,
+ as well as the associated GPIO driver.
+
config PINCTRL_QCOM_QCM2290
bool "Qualcomm QCM2290 Pinctrl"
default y if PINCTRL_QCOM_GENERIC
diff --git a/drivers/pinctrl/qcom/Makefile b/drivers/pinctrl/qcom/Makefile
index 87cb128c4d4..064c75207cf 100644
--- a/drivers/pinctrl/qcom/Makefile
+++ b/drivers/pinctrl/qcom/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_PINCTRL_QCOM_IPQ5424) += pinctrl-ipq5424.o
obj-$(CONFIG_PINCTRL_QCOM_IPQ9574) += pinctrl-ipq9574.o
obj-$(CONFIG_PINCTRL_QCOM_APQ8096) += pinctrl-apq8096.o
obj-$(CONFIG_PINCTRL_QCOM_MILOS) += pinctrl-milos.o
+obj-$(CONFIG_PINCTRL_QCOM_MSM8953) += pinctrl-msm8953.o
obj-$(CONFIG_PINCTRL_QCOM_QCM2290) += pinctrl-qcm2290.o
obj-$(CONFIG_PINCTRL_QCOM_QCS404) += pinctrl-qcs404.o
obj-$(CONFIG_PINCTRL_QCOM_QCS615) += pinctrl-qcs615.o
diff --git a/drivers/pinctrl/qcom/pinctrl-msm8953.c b/drivers/pinctrl/qcom/pinctrl-msm8953.c
new file mode 100644
index 00000000000..0c51461183c
--- /dev/null
+++ b/drivers/pinctrl/qcom/pinctrl-msm8953.c
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Qualcomm MSM8953 pinctrl
+ *
+ * (C) Copyright 2026 Luca Weiss <luca.weiss@fairphone.com>
+ *
+ */
+
+#include <dm.h>
+
+#include "pinctrl-qcom.h"
+
+#define MAX_PIN_NAME_LEN 32
+static char pin_name[MAX_PIN_NAME_LEN] __section(".data");
+static const char * const msm_pinctrl_pins[] = {
+ "qdsd_clk",
+ "qdsd_cmd",
+ "qdsd_data0",
+ "qdsd_data1",
+ "qdsd_data2",
+ "qdsd_data3",
+ "sdc1_clk",
+ "sdc1_cmd",
+ "sdc1_data",
+ "sdc1_rclk",
+ "sdc2_clk",
+ "sdc2_cmd",
+ "sdc2_data",
+};
+
+static const struct pinctrl_function msm_pinctrl_functions[] = {
+ {"blsp_uart2", 2},
+};
+
+static const char *msm8953_get_function_name(struct udevice *dev,
+ unsigned int selector)
+{
+ return msm_pinctrl_functions[selector].name;
+}
+
+static const char *msm8953_get_pin_name(struct udevice *dev,
+ unsigned int selector)
+{
+ if (selector < 142) {
+ snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);
+ return pin_name;
+ } else {
+ return msm_pinctrl_pins[selector - 142];
+ }
+}
+
+static int msm8953_get_function_mux(__maybe_unused unsigned int pin,
+ unsigned int selector)
+{
+ return msm_pinctrl_functions[selector].val;
+}
+
+static const struct msm_pinctrl_data msm8953_data = {
+ .pin_data = {
+ .pin_count = 155,
+ .special_pins_start = 142,
+ },
+ .functions_count = ARRAY_SIZE(msm_pinctrl_functions),
+ .get_function_name = msm8953_get_function_name,
+ .get_function_mux = msm8953_get_function_mux,
+ .get_pin_name = msm8953_get_pin_name,
+};
+
+static const struct udevice_id msm_pinctrl_ids[] = {
+ { .compatible = "qcom,msm8953-pinctrl", .data = (ulong)&msm8953_data },
+ { /* Sentinel */ }
+};
+
+U_BOOT_DRIVER(pinctrl_msm8953) = {
+ .name = "pinctrl_msm8953",
+ .id = UCLASS_NOP,
+ .of_match = msm_pinctrl_ids,
+ .ops = &msm_pinctrl_ops,
+ .bind = msm_pinctrl_bind,
+};
--
2.55.0
next prev parent reply other threads:[~2026-07-16 1:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 15:17 [PATCH 0/4] Initial MSM8953 support Luca Weiss
2026-07-15 15:17 ` [PATCH 1/4] clk/qcom: Add MSM8953 clock driver Luca Weiss
2026-07-15 15:17 ` [PATCH 2/4] qcom_defconfig: Enable " Luca Weiss
2026-07-15 15:17 ` Luca Weiss [this message]
2026-07-15 15:17 ` [PATCH 4/4] mach-snapdragon: Do reserved memory carveout for MSM8953/SDM632 Luca Weiss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260715-msm8953-basic-v1-3-bc4cb5099d8e@fairphone.com \
--to=luca.weiss@fairphone.com \
--cc=aswin.murugan@oss.qualcomm.com \
--cc=casey.connolly@linaro.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jbx6244@gmail.com \
--cc=linux@smankusors.com \
--cc=lukma@denx.de \
--cc=nathbappai@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=quentin.schulz@cherry.de \
--cc=sumit.garg@kernel.org \
--cc=trini@konsulko.com \
--cc=u-boot-qcom@groups.io \
--cc=u-boot@lists.denx.de \
--cc=varadarajan.narayanan@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox