summaryrefslogtreecommitdiff
path: root/drivers/clk/at91
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2022-03-20 16:34:46 -0400
committerSean Anderson <seanga2@gmail.com>2022-03-30 14:18:56 -0400
commit682e73d23555afdd733c20810d282d9cc2bc0e0f (patch)
treef161eabd10fed7802ee720a0a4077e8980c2943a /drivers/clk/at91
parent3a11b5ae65c269ef9f7bb1e18826e85fc164f161 (diff)
downloadu-boot-682e73d23555afdd733c20810d282d9cc2bc0e0f.tar.gz
u-boot-682e73d23555afdd733c20810d282d9cc2bc0e0f.tar.bz2
u-boot-682e73d23555afdd733c20810d282d9cc2bc0e0f.zip
clk: Use generic CCF ops where possible
This converts most CCF drivers to use generic ops. imx6q is the only outlier, where we retain the existing functionality by moving the check to request(). Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20220320203446.740178-2-seanga2@gmail.com [ fixed missing include for at91 ] Signed-off-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'drivers/clk/at91')
-rw-r--r--drivers/clk/at91/pmc.c57
1 files changed, 5 insertions, 52 deletions
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index 1fa42d728b..270892517a 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <asm/io.h>
#include <clk-uclass.h>
+#include <linux/clk-provider.h>
#include "pmc.h"
static int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args)
@@ -21,60 +22,12 @@ static int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args)
return 0;
}
-static ulong at91_clk_get_rate(struct clk *clk)
-{
- struct clk *c;
- int ret;
-
- ret = clk_get_by_id(clk->id, &c);
- if (ret)
- return ret;
-
- return clk_get_rate(c);
-}
-
-static ulong at91_clk_set_rate(struct clk *clk, ulong rate)
-{
- struct clk *c;
- int ret;
-
- ret = clk_get_by_id(clk->id, &c);
- if (ret)
- return ret;
-
- return clk_set_rate(c, rate);
-}
-
-static int at91_clk_enable(struct clk *clk)
-{
- struct clk *c;
- int ret;
-
- ret = clk_get_by_id(clk->id, &c);
- if (ret)
- return ret;
-
- return clk_enable(c);
-}
-
-static int at91_clk_disable(struct clk *clk)
-{
- struct clk *c;
- int ret;
-
- ret = clk_get_by_id(clk->id, &c);
- if (ret)
- return ret;
-
- return clk_disable(c);
-}
-
const struct clk_ops at91_clk_ops = {
.of_xlate = at91_clk_of_xlate,
- .set_rate = at91_clk_set_rate,
- .get_rate = at91_clk_get_rate,
- .enable = at91_clk_enable,
- .disable = at91_clk_disable,
+ .set_rate = ccf_clk_set_rate,
+ .get_rate = ccf_clk_get_rate,
+ .enable = ccf_clk_enable,
+ .disable = ccf_clk_disable,
};
/**