Skip to contentSkip to conversation

pinctrl: add support for Qualcomm Technologies QDF2xxx ARM64 SoCs

PATCH Superseded Timur Tabi 2 participants 2 messages Jul 14, 2015 – Jul 15, 2015

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 pinctrl: add support for Qualcomm Technologies QDF2xxx ARM64 SoCs

Add the pinctrl driver for the Qualcomm Technologies QDF2xxx ARM64 SoCs, which uses the Qualcomm Technologies TLMM pinctrl/gpio device. This driver is probed via ACPI and uses the pinctrl-msm.c backend driver.

This driver is intended to be used only an ACPI-enabled system. As such, UEFI will handle all pin control configuration, so this driver does not provide pin control functions. It is effectively a GPIO-only driver.

---
 drivers/pinctrl/qcom/Kconfig           |   8 +++
 drivers/pinctrl/qcom/Makefile          |   1 +
 drivers/pinctrl/qcom/pinctrl-qdf2xxx.c | 124 +++++++++++++++++++++++++++++++++
 3 files changed, 133 insertions(+)
 create mode 100644 drivers/pinctrl/qcom/pinctrl-qdf2xxx.c
drivers/pinctrl/qcom/Kconfig +8 -0
index 58f5632..8a38323 100644
@@ -63,6 +63,14 @@ config PINCTRL_MSM8916
 	  This is the pinctrl, pinmux, pinconf and gpiolib driver for the
 	  Qualcomm TLMM block found on the Qualcomm 8916 platform.
 
+config PINCTRL_QDF2XXX
+	tristate "Qualcomm Technologies QDF2xxx pin controller driver"
+	depends on GPIOLIB && ACPI
+	select PINCTRL_MSM
+	help
+	  This is the GPIO driver for the TLMM block found on the
+	  Qualcomm Technologies QDF2xxx SOCs.
+
 config PINCTRL_QCOM_SPMI_PMIC
        tristate "Qualcomm SPMI PMIC pin controller driver"
        depends on GPIOLIB && OF && SPMI
drivers/pinctrl/qcom/Makefile +1 -0
index 3666c70..798d662 100644
@@ -7,5 +7,6 @@ obj-$(CONFIG_PINCTRL_MSM8660)	+= pinctrl-msm8660.o
 obj-$(CONFIG_PINCTRL_MSM8960)	+= pinctrl-msm8960.o
 obj-$(CONFIG_PINCTRL_MSM8X74)	+= pinctrl-msm8x74.o
 obj-$(CONFIG_PINCTRL_MSM8916)	+= pinctrl-msm8916.o
+obj-$(CONFIG_PINCTRL_QDF2XXX)	+= pinctrl-qdf2xxx.o
 obj-$(CONFIG_PINCTRL_QCOM_SPMI_PMIC) += pinctrl-spmi-gpio.o
 obj-$(CONFIG_PINCTRL_QCOM_SPMI_PMIC) += pinctrl-spmi-mpp.o
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c new file +124 -0

124 lines not on this page · raw message

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#1 lore raw

PATCH 1/1 pinctrl: add support for Qualcomm Technologies QDF2xxx ARM64 SoCs

On Tue 14 Jul 16:29 PDT 2015, Timur Tabi wrote:

[..]

Quoted 1 line
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c +0 -0

[..]

Quoted 5 lines

+ *
+ * GPIO and pin control functions on this SOC are handled by the "TLMM"
+ * device. The driver which controls this device is pinctrl-msm.c. Each
+ * SOC with a TLMM is expected to create a client driver that registers
+ * with pinctrl-msm.c. This means that all TLMM drivers are pin control

Quoted 8 lines

+ * drivers.
+ *
+ * This pin control driver is intended to be used only an ACPI-enabled
+ * system. As such, UEFI will handle all pin control configuration, so
+ * this driver does not provide pin control functions. It is effectively
+ * a GPIO-only driver. The alternative is to duplicate the GPIO code of
+ * pinctrl-msm.c into another driver.
+ */

That should be fine, better reuse the existing code than duplicating it.

drivers/pinctrl/qcom/pinctrl-qdf2xxx.c line 29

Quoted 5 lines
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c +5 -0
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/pinctrl/pinctrl.h>
+#include <linux/pinctrl/pinmux.h>

Do you really need pinmux.h?

Quoted 4 lines
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c +4 -0
+#include <linux/acpi.h>
+
+#include "pinctrl-msm.h"
+

[..]

drivers/pinctrl/qcom/pinctrl-qdf2xxx.c line 104

Quoted 5 lines
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c +5 -0
+
+static struct platform_driver qdf2xxx_pinctrl_driver = {
+	.driver = {
+		.name = "qdf2xxx-pinctrl",
+		.owner = THIS_MODULE,

No need to specify 'owner' of a platform_driver, so please drop this.

Quoted 10 lines
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c +10 -0
+		.acpi_match_table = ACPI_PTR(qdf2xxx_acpi_ids),
+	},
+	.probe = qdf2xxx_pinctrl_probe,
+	.remove = msm_pinctrl_remove,
+};
+
+static int __init qdf2xxx_pinctrl_init(void)
+{
+	return platform_driver_register(&qdf2xxx_pinctrl_driver);
+}

drivers/pinctrl/qcom/pinctrl-qdf2xxx.c line 124

Quoted 10 lines
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c +10 -0
+arch_initcall(qdf2xxx_pinctrl_init);
+
+static void __exit qdf2xxx_pinctrl_exit(void)
+{
+	platform_driver_unregister(&qdf2xxx_pinctrl_driver);
+}
+module_exit(qdf2xxx_pinctrl_exit);
+
+MODULE_DESCRIPTION("Qualcomm Technologies QDF2xxx pin control driver");
+MODULE_LICENSE("GPL v2");

Looks good with above nits fixed.

Regards,
Bjorn