pinctrl: imx: Push imx_pinctrl_ops into drivers and staticize
authorMarek Vasut <marex@denx.de>
Fri, 24 Jan 2025 14:50:50 +0000 (15:50 +0100)
committerFabio Estevam <festevam@gmail.com>
Sat, 25 Jan 2025 12:06:32 +0000 (09:06 -0300)
Move imx_pinctrl_ops into drivers and staticize. This is preparatory
patch for follow up pinctrl drivers which will not use this variant
of imx_pinctrl_ops content. This should not change size, as most of
the deployments compiled in one pinctrl driver anyway. No functional
change.

Signed-off-by: Marek Vasut <marex@denx.de>
12 files changed:
drivers/pinctrl/nxp/pinctrl-imx.c
drivers/pinctrl/nxp/pinctrl-imx.h
drivers/pinctrl/nxp/pinctrl-imx5.c
drivers/pinctrl/nxp/pinctrl-imx6.c
drivers/pinctrl/nxp/pinctrl-imx7.c
drivers/pinctrl/nxp/pinctrl-imx7ulp.c
drivers/pinctrl/nxp/pinctrl-imx8.c
drivers/pinctrl/nxp/pinctrl-imx8m.c
drivers/pinctrl/nxp/pinctrl-imx8ulp.c
drivers/pinctrl/nxp/pinctrl-imx93.c
drivers/pinctrl/nxp/pinctrl-imxrt.c
drivers/pinctrl/nxp/pinctrl-vf610.c

index 54cec37..3f05532 100644 (file)
@@ -18,7 +18,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config)
+int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config)
 {
        struct imx_pinctrl_priv *priv = dev_get_priv(dev);
        struct imx_pinctrl_soc_info *info = priv->info;
@@ -194,10 +194,6 @@ static int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config)
        return 0;
 }
 
-const struct pinctrl_ops imx_pinctrl_ops  = {
-       .set_state = imx_pinctrl_set_state,
-};
-
 int imx_pinctrl_probe(struct udevice *dev,
                      struct imx_pinctrl_soc_info *info)
 {
index fa4c084..02f05fd 100644 (file)
@@ -28,8 +28,6 @@ struct imx_pinctrl_priv {
        struct imx_pinctrl_soc_info *info;
 };
 
-extern const struct pinctrl_ops imx_pinctrl_ops;
-
 #define IMX_NO_PAD_CTL 0x80000000      /* no pin config need */
 #define IMX_PAD_SION   0x40000000      /* set SION */
 
@@ -54,6 +52,8 @@ int imx_pinctrl_probe(struct udevice *dev, struct imx_pinctrl_soc_info *info);
 
 int imx_pinctrl_remove(struct udevice *dev);
 
+int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config);
+
 #ifdef CONFIG_PINCTRL_IMX_SCU
 int imx_pinctrl_scu_conf_pins(struct imx_pinctrl_soc_info *info,
                              u32 *pin_data, int npins);
index 6b690fd..c17d396 100644 (file)
@@ -31,6 +31,10 @@ static const struct udevice_id imx5_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imx5_pinctrl) = {
        .name = "imx5-pinctrl",
        .id = UCLASS_PINCTRL,
index 322eec8..2d3d4ce 100644 (file)
@@ -40,6 +40,10 @@ static const struct udevice_id imx6_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(fsl_imx6q_iomuxc) = {
        .name = "fsl_imx6q_iomuxc",
        .id = UCLASS_PINCTRL,
index a8275e2..2505f5d 100644 (file)
@@ -28,6 +28,10 @@ static const struct udevice_id imx7_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imx7_pinctrl) = {
        .name = "imx7-pinctrl",
        .id = UCLASS_PINCTRL,
index 7ea2dbe..7d732f5 100644 (file)
@@ -32,6 +32,10 @@ static const struct udevice_id imx7ulp_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imx7ulp_pinctrl) = {
        .name = "imx7ulp-pinctrl",
        .id = UCLASS_PINCTRL,
index 4e9a9ea..930de19 100644 (file)
@@ -29,6 +29,10 @@ static const struct udevice_id imx8_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imx8_pinctrl) = {
        .name = "imx8_pinctrl",
        .id = UCLASS_PINCTRL,
index 6ea66a0..d30a6ee 100644 (file)
@@ -26,6 +26,10 @@ static const struct udevice_id imx8m_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imx8mq_pinctrl) = {
        .name = "imx8mq-pinctrl",
        .id = UCLASS_PINCTRL,
index 73d3c00..0fb116a 100644 (file)
@@ -31,6 +31,10 @@ static const struct udevice_id imx8ulp_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imx8ulp_pinctrl) = {
        .name = "imx8ulp-pinctrl",
        .id = UCLASS_PINCTRL,
index 8d8ffec..2d027cd 100644 (file)
@@ -26,6 +26,10 @@ static const struct udevice_id imx93_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imx93_pinctrl) = {
        .name = "imx93-pinctrl",
        .id = UCLASS_PINCTRL,
index 23f07f8..fdb3cbe 100644 (file)
@@ -27,6 +27,10 @@ static const struct udevice_id imxrt_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(imxrt_pinctrl) = {
        .name = "imxrt-pinctrl",
        .id = UCLASS_PINCTRL,
index adf3073..86514eb 100644 (file)
@@ -27,6 +27,10 @@ static const struct udevice_id vf610_pinctrl_match[] = {
        { /* sentinel */ }
 };
 
+static const struct pinctrl_ops imx_pinctrl_ops = {
+       .set_state = imx_pinctrl_set_state,
+};
+
 U_BOOT_DRIVER(vf610_pinctrl) = {
        .name = "vf610-pinctrl",
        .id = UCLASS_PINCTRL,