soc {
u-boot,dm-pre-reloc;
- qcom,tlmm@1000000 {
+ pinctrl@1000000 {
u-boot,dm-pre-reloc;
uart {
reg = <0x60000 0x8000>;
};
- pinctrl: qcom,tlmm@1000000 {
- compatible = "qcom,tlmm-apq8016";
+ soc_gpios: pinctrl@1000000 {
+ compatible = "qcom,msm8916-pinctrl";
reg = <0x1000000 0x400000>;
+ gpio-controller;
+ gpio-count = <122>;
+ gpio-bank-name="soc";
+ #gpio-cells = <2>;
blsp1_uart: uart {
function = "blsp1_uart";
pinctrl-0 = <&blsp1_uart>;
};
- soc_gpios: pinctrl@1000000 {
- compatible = "qcom,apq8016-pinctrl";
- reg = <0x1000000 0x300000>;
- gpio-controller;
- gpio-count = <122>;
- gpio-bank-name="soc";
- #gpio-cells = <2>;
- };
-
ehci@78d9000 {
compatible = "qcom,ehci-host";
reg = <0x78d9000 0x400>;
soc {
u-boot,dm-pre-reloc;
- qcom,tlmm@1010000 {
+ pinctrl@1010000 {
u-boot,dm-pre-reloc;
uart {
reg = <0x300000 0x90000>;
};
- pinctrl: qcom,tlmm@1010000 {
- compatible = "qcom,tlmm-apq8096";
+ pinctrl: pinctrl@1010000 {
+ compatible = "qcom,msm8996-pinctrl";
reg = <0x1010000 0x400000>;
blsp8_uart: uart {
u-boot,dm-pre-reloc;
};
- pinctrl: qcom,tlmm@1000000 {
- compatible = "qcom,tlmm-ipq4019";
+ soc_gpios: pinctrl@1000000 {
+ compatible = "qcom,ipq4019-pinctrl";
reg = <0x1000000 0x300000>;
+ gpio-controller;
+ gpio-count = <100>;
+ gpio-bank-name="soc";
+ #gpio-cells = <2>;
u-boot,dm-pre-reloc;
};
u-boot,dm-pre-reloc;
};
- soc_gpios: pinctrl@1000000 {
- compatible = "qcom,ipq4019-pinctrl";
- reg = <0x1000000 0x300000>;
- gpio-controller;
- gpio-count = <100>;
- gpio-bank-name="soc";
- #gpio-cells = <2>;
- u-boot,dm-pre-reloc;
- };
-
blsp1_spi1: spi@78b5000 {
compatible = "qcom,spi-qup-v2.2.1";
reg = <0x78b5000 0x600>;
compatible = "simple-bus";
pinctrl_north@1300000 {
- compatible = "qcom,tlmm-qcs404";
+ compatible = "qcom,qcs404-pinctrl";
reg = <0x1300000 0x200000>;
blsp1_uart2: uart {
};
tlmm_north: pinctrl_north@3900000 {
- compatible = "qcom,tlmm-sdm845";
+ compatible = "qcom,sdm845-pinctrl";
reg = <0x3900000 0x400000>;
gpio-count = <150>;
gpio-controller;
#include <dm.h>
#include <errno.h>
#include <asm/io.h>
+#include <dm/device_compat.h>
+#include <dm/lists.h>
#include <dm/pinctrl.h>
#include <linux/bitops.h>
#include "pinctrl-snapdragon.h"
return 0;
}
+static int msm_pinctrl_bind(struct udevice *dev)
+{
+ ofnode node = dev_ofnode(dev);
+ const char *name;
+ int ret;
+
+ ofnode_get_property(node, "gpio-controller", &ret);
+ if (ret < 0)
+ return 0;
+
+ /* Get the name of gpio node */
+ name = ofnode_get_name(node);
+ if (!name)
+ return -EINVAL;
+
+ /* Bind gpio node */
+ ret = device_bind_driver_to_node(dev, "gpio_msm",
+ name, node, NULL);
+ if (ret)
+ return ret;
+
+ dev_dbg(dev, "bind %s\n", name);
+
+ return 0;
+}
+
static struct pinctrl_ops msm_pinctrl_ops = {
.get_pins_count = msm_get_pins_count,
.get_pin_name = msm_get_pin_name,
};
static const struct udevice_id msm_pinctrl_ids[] = {
- { .compatible = "qcom,tlmm-ipq4019", .data = (ulong)&ipq4019_data },
+ { .compatible = "qcom,ipq4019-pinctrl", .data = (ulong)&ipq4019_data },
{ }
};
.priv_auto = sizeof(struct msm_pinctrl_priv),
.ops = &msm_pinctrl_ops,
.probe = msm_pinctrl_probe,
+ .bind = msm_pinctrl_bind,
};
#include <dm.h>
#include <errno.h>
#include <asm/io.h>
+#include <dm/device_compat.h>
+#include <dm/lists.h>
#include <dm/pinctrl.h>
#include <linux/bitops.h>
#include "pinctrl-snapdragon.h"
.get_function_name = msm_get_function_name,
};
+static int msm_pinctrl_bind(struct udevice *dev)
+{
+ ofnode node = dev_ofnode(dev);
+ const char *name;
+ int ret;
+
+ ofnode_get_property(node, "gpio-controller", &ret);
+ if (ret < 0)
+ return 0;
+
+ /* Get the name of gpio node */
+ name = ofnode_get_name(node);
+ if (!name)
+ return -EINVAL;
+
+ /* Bind gpio node */
+ ret = device_bind_driver_to_node(dev, "gpio_msm",
+ name, node, NULL);
+ if (ret)
+ return ret;
+
+ dev_dbg(dev, "bind %s\n", name);
+
+ return 0;
+}
+
static const struct udevice_id msm_pinctrl_ids[] = {
- { .compatible = "qcom,tlmm-apq8016", .data = (ulong)&apq8016_data },
- { .compatible = "qcom,tlmm-apq8096", .data = (ulong)&apq8096_data },
- { .compatible = "qcom,tlmm-sdm845", .data = (ulong)&sdm845_data },
- { .compatible = "qcom,tlmm-qcs404", .data = (ulong)&qcs404_data },
+ { .compatible = "qcom,msm8916-pinctrl", .data = (ulong)&apq8016_data },
+ { .compatible = "qcom,msm8996-pinctrl", .data = (ulong)&apq8096_data },
+ { .compatible = "qcom,sdm845-pinctrl", .data = (ulong)&sdm845_data },
+ { .compatible = "qcom,qcs404-pinctrl", .data = (ulong)&qcs404_data },
{ }
};
.priv_auto = sizeof(struct msm_pinctrl_priv),
.ops = &msm_pinctrl_ops,
.probe = msm_pinctrl_probe,
+ .bind = msm_pinctrl_bind,
};
return 0;
}
-static const struct udevice_id msm_gpio_ids[] = {
- { .compatible = "qcom,msm8916-pinctrl" },
- { .compatible = "qcom,apq8016-pinctrl" },
- { .compatible = "qcom,ipq4019-pinctrl" },
- { .compatible = "qcom,sdm845-pinctrl" },
- { }
-};
-
U_BOOT_DRIVER(gpio_msm) = {
.name = "gpio_msm",
.id = UCLASS_GPIO,
- .of_match = msm_gpio_ids,
.of_to_plat = msm_gpio_of_to_plat,
.probe = msm_gpio_probe,
.ops = &gpio_msm_ops,
+ .flags = DM_UC_FLAG_SEQ_ALIAS,
.priv_auto = sizeof(struct msm_gpio_bank),
};