]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Revert "clk: enhance clk-gpio to also handle gated-fixed-clock"
authorTom Rini <trini@konsulko.com>
Thu, 11 Jun 2026 14:01:22 +0000 (08:01 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 11 Jun 2026 14:01:22 +0000 (08:01 -0600)
I had missed the review comments from Jonas Karlman when applying this,
it's not yet ready for inclusion.

This reverts commit 4e249b94af928aca29972fc22ef2b5ed0016eab9.

Signed-off-by: Tom Rini <trini@konsulko.com>
configs/rock-5-itx-rk3588_defconfig
drivers/clk/clk-gpio.c

index adb20c2f3a0097306de269bd7d823d33ab4d3e31..cb014de41883e2cf23e7410839e6acd7953cea5c 100644 (file)
@@ -52,7 +52,6 @@ CONFIG_AHCI=y
 CONFIG_AHCI_PCI=y
 CONFIG_DWC_AHCI=y
 CONFIG_SPL_CLK=y
-CONFIG_CLK_GPIO=y
 # CONFIG_USB_FUNCTION_FASTBOOT is not set
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
index b7abc891ed2f0ce0e3416c9e4146bf2cf802bc0e..4ed14306575405f80ca5a6b05b281ec78b31fc3b 100644 (file)
@@ -6,7 +6,6 @@
 #include <clk.h>
 #include <clk-uclass.h>
 #include <dm.h>
-#include <power/regulator.h>
 #include <linux/clk-provider.h>
 
 #include <asm/gpio.h>
 struct clk_gpio_priv {
        struct gpio_desc        enable; /* GPIO, controlling the gate */
        struct clk              *clk;   /* Gated clock */
-       struct udevice          *vdd_supply;
 };
 
 static int clk_gpio_enable(struct clk *clk)
 {
        struct clk_gpio_priv *priv = dev_get_priv(clk->dev);
 
-       if (priv->clk)
-               clk_enable(priv->clk);
-
-       if (priv->enable.dev)
-               dm_gpio_set_value(&priv->enable, 1);
+       clk_enable(priv->clk);
+       dm_gpio_set_value(&priv->enable, 1);
 
        return 0;
 }
@@ -34,11 +29,8 @@ static int clk_gpio_disable(struct clk *clk)
 {
        struct clk_gpio_priv *priv = dev_get_priv(clk->dev);
 
-       if (priv->enable.dev)
-               dm_gpio_set_value(&priv->enable, 0);
-
-       if (priv->clk)
-               clk_disable(priv->clk);
+       dm_gpio_set_value(&priv->enable, 0);
+       clk_disable(priv->clk);
 
        return 0;
 }
@@ -47,7 +39,7 @@ static ulong clk_gpio_get_rate(struct clk *clk)
 {
        struct clk_gpio_priv *priv = dev_get_priv(clk->dev);
 
-       return (priv->clk) ? clk_get_rate(priv->clk) : -1;
+       return clk_get_rate(priv->clk);
 }
 
 const struct clk_ops clk_gpio_ops = {
@@ -65,7 +57,7 @@ static int clk_gpio_probe(struct udevice *dev)
        if (IS_ERR(priv->clk)) {
                log_debug("%s: Could not get gated clock: %ld\n",
                          __func__, PTR_ERR(priv->clk));
-               priv->clk = 0;
+               return PTR_ERR(priv->clk);
        }
 
        ret = gpio_request_by_name(dev, "enable-gpios", 0,
@@ -73,15 +65,9 @@ static int clk_gpio_probe(struct udevice *dev)
        if (ret) {
                log_debug("%s: Could not decode enable-gpios (%d)\n",
                          __func__, ret);
+               return ret;
        }
 
-       ret = device_get_supply_regulator(dev, "vdd-supply",
-                                         &priv->vdd_supply);
-       if (ret == 0)
-               ret = regulator_set_enable(priv->vdd_supply, true);
-
-       log_debug("%s: %s regulator = %d\n", __func__, dev->name, ret);
-
        return 0;
 }
 
@@ -94,7 +80,6 @@ static int clk_gpio_probe(struct udevice *dev)
  */
 static const struct udevice_id clk_gpio_match[] = {
        { .compatible = "gpio-gate-clock" },
-       { .compatible = "gated-fixed-clock" },
        { /* sentinel */ }
 };