Ok so i narrowed it down to one specific patch :
From bfca167356adef07b2bca2288a63a8b6fceb2d75 Mon Sep 17 00:00:00 2001
From: Ilan Ganor <ilan@kamacode.com>
Date: Fri, 9 Feb 2024 15:08:35 +0200
Subject: [PATCH] personal gpio
---
arch/arm/configs/mdm9607_defconfig | 1 +
arch/arm64/boot/dts/qcom/mdm9607.dtsi | 12 +++
drivers/misc/Kconfig | 4 +
drivers/misc/Makefile | 1 +
drivers/misc/personal_pm.c | 131 ++++++++++++++++++++++++++
include/dt-bindings/gpio/gpio.h | 3 +
6 files changed, 152 insertions(+)
create mode 100644 drivers/misc/personal_pm.c
diff --git a/arch/arm/configs/mdm9607_defconfig b/arch/arm/configs/mdm9607_defconfig
index e320a8a5c71c..e861fcdc2741 100644
--- a/arch/arm/configs/mdm9607_defconfig
+++ b/arch/arm/configs/mdm9607_defconfig
@@ -454,3 +454,4 @@ CONFIG_IMA_TRUSTED_KEYRING=y
# Sierra USB
CONFIG_SIERRA_USB_COMP=y
+CONFIG_PERSONAL_PM=y
diff --git a/arch/arm64/boot/dts/qcom/mdm9607.dtsi b/arch/arm64/boot/dts/qcom/mdm9607.dtsi
index f05b18f23cea..dfbd2431ad69 100644
--- a/arch/arm64/boot/dts/qcom/mdm9607.dtsi
+++ b/arch/arm64/boot/dts/qcom/mdm9607.dtsi
@@ -18,6 +18,7 @@
#include <dt-bindings/regulator/qcom,rpm-smd-regulator.h>
#include <dt-bindings/spmi/spmi.h>
#include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/gpio/gpio.h>
#define MHZ_TO_MBPS(mhz, w) ((mhz * 1000000 * w) / (1024 * 1024))
#define BW_OPP_ENTRY(mhz, w) opp-mhz {opp-hz = /bits/ 64 <MHZ_TO_MBPS(mhz, w)>;}
@@ -110,6 +111,17 @@
#size-cells = <1>;
ranges;
+ personal_station-pm {
+ compatible = "personal,personal_station-pm";
+ platform-unique;
+ status = "okay";
+ pin_numbers = <7 8 13 35 32 33>;
+ pin_names = "SYS_PWR_OFF", "ROUTER_RESET", "JETSON_RESET", "TP1", "TP2", "12V_TZ";
+ //GPIOF_OUT_INIT_LOW GPIOF_OUT_INIT_HIGH GPIOF_IN
+ pin_states = <GPIOF_OUT_INIT_LOW GPIOF_OUT_INIT_LOW GPIOF_OUT_INIT_LOW GPIOF_IN GPIOF_IN GPIOF_IN>;
+ pin_init_val = <0 0 0 0 0 0>;
+ };
+
intc: interrupt-controller@b000000 {
compatible = "qcom,msm-qgic2";
interrupt-controller;
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 3c6ecc0b15e6..c0835a436c77 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -605,6 +605,10 @@ config SIERRA_TZDEV
If in doubt, say N.
+config PERSONAL_PM
+ tristate "personal power mangment driver"
+ help
+ driver handling named GPIO and initial status settings.
source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index c7c51d59a7bf..9c1a17d2ffb3 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -92,3 +92,4 @@ $(obj)/lkdtm_rodata_objcopy.o: $(obj)/lkdtm_rodata.o FORCE
obj-$(CONFIG_OKL4_USER_VIPC) += okl4-vipc.o
obj-$(CONFIG_OKL4_GUEST) += okl4-panic.o
obj-$(CONFIG_OKL4_LINK_SHBUF) += okl4-link-shbuf.o
+obj-$(CONFIG_PERSONAL_PM) += personal_pm.o
diff --git a/drivers/misc/personal_pm.c b/drivers/misc/personal_pm.c
new file mode 100644
index 000000000000..f66d49030031
--- /dev/null
+++ b/drivers/misc/personal_pm.c
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2010 Amarula Solutions.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kallsyms.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of_gpio.h>
+#include <linux/platform_device.h>
+#include <linux/pm.h>
+#include <linux/regulator/consumer.h>
+
+struct personal_station {
+ int n0_general_som_to_pos_61;
+};
+
+
+struct regulator * v3v3_supply;
+
+
+static int personal_station_request_export(struct device *dev, int flags)
+{
+ struct device_node *np = dev->of_node;
+ int ret;
+ u32 tmp;
+ u8 num_relays, i;
+ u32 pin_num, pin_init_val, pin_stat;
+ const char *oh_name;
+
+ if (!of_get_property(np, "pin_numbers", &tmp))
+ goto error_parse;
+ if (!of_get_property(np, "pin_names", &tmp))
+ goto error_parse;
+ if (!of_get_property(np, "pin_states", &tmp))
+ goto error_parse;
+ if (!of_get_property(np, "pin_init_val", &tmp))
+ goto error_parse;
+ num_relays = tmp / (sizeof(u32));
+ dev_info(dev, "num_relays %d\n", num_relays);
+ for (i = 0; i < num_relays; i++) {
+ if (of_property_read_u32_index(np, "pin_numbers", i, &pin_num))
+ goto error_parse;
+ if (of_property_read_u32_index(np, "pin_init_val", i, &pin_init_val))
+ goto error_parse;
+ if (of_property_read_u32_index(np, "pin_states", i, &pin_stat))
+ goto error_parse;
+ if (of_property_read_string_index(np, "pin_names", i, &oh_name))
+ goto error_parse;
+ ret = devm_gpio_request_one(dev, pin_num, pin_stat, oh_name);
+ if (ret) {
+ dev_err(dev, "Failed to request GPIO %d, error %d\n",
+ pin_num, ret);
+ return ret;
+ }
+ gpio_export(pin_num, 1);
+ gpio_export_link(dev, oh_name, pin_num);
+ }
+ return 0;
+
+error_parse:
+ dev_err(dev, "Failed to parse DT\n");
+ return -EINVAL;
+}
+
+static int personal_station_probe(struct platform_device *pdev)
+{
+ struct personal_station *priv;
+ int ret;
+
+ if (!pdev->dev.of_node) {
+ dev_err(&pdev->dev, "This driver support only DT init\n");
+ return -EINVAL;
+ }
+ priv = devm_kzalloc(&pdev->dev,
+ sizeof(struct personal_station), GFP_KERNEL);
+ if (!priv) {
+ dev_err(&pdev->dev, "Failed to allocate memory\n");
+ return -ENOMEM;
+ }
+
+ platform_set_drvdata(pdev, priv);
+ ret = personal_station_request_export(&pdev->dev, GPIOF_OUT_INIT_LOW);
+ dev_info(&pdev->dev, "Probed\n");
+
+ return 0;
+}
+
+static int personal_station_remove(struct platform_device *pdev)
+{
+ platform_set_drvdata(pdev, NULL);
+
+ return 0;
+}
+
+static const struct of_device_id personal_station_match[] = {
+ { .compatible = "personal,personal_station-pm", },
+ { },
+};
+
+static struct platform_driver personal_station_driver = {
+ .probe = personal_station_probe,
+ .remove = personal_station_remove,
+ .driver = {
+ .name = "personal_station-pm",
+ .of_match_table = of_match_ptr(personal_station_match),
+ },
+};
+
+static int __init personal_station_init(void)
+{
+ return platform_driver_register(&personal_station_driver);
+}
+
+static void __exit personal_station_exit(void)
+{
+ platform_driver_unregister(&personal_station_driver);
+}
+
+module_init(personal_station_init);
+module_exit(personal_station_exit);
+
+MODULE_ALIAS("platform:personal_station-pm");
+MODULE_DESCRIPTION("Personal Station Board Driver");
+MODULE_LICENSE("GPL");
diff --git a/include/dt-bindings/gpio/gpio.h b/include/dt-bindings/gpio/gpio.h
index 32dd58a3d13c..cc235fe315a7 100644
--- a/include/dt-bindings/gpio/gpio.h
+++ b/include/dt-bindings/gpio/gpio.h
@@ -33,4 +33,7 @@
#define GPIO_SLEEP_MAINTAIN_VALUE 0
#define GPIO_SLEEP_MAY_LOOSE_VALUE 8
+#define GPIOF_IN 1
+#define GPIOF_OUT_INIT_LOW 0
+#define GPIOF_OUT_INIT_HIGH 2
#endif
--
2.17.1
and here no changes or anything that related to the uarts or serial :weary: