dm: treewide: Rename auto_alloc_size members to be shorter
[platform/kernel/u-boot.git] / drivers / clk / clk-ti-sci.c
index c25415d..6f0fdaa 100644 (file)
 #include <dm.h>
 #include <errno.h>
 #include <clk-uclass.h>
+#include <log.h>
+#include <malloc.h>
+#include <dm/device_compat.h>
+#include <linux/err.h>
 #include <linux/soc/ti/ti_sci_protocol.h>
+#include <k3-avs.h>
 
 /**
  * struct ti_sci_clk_data - clock controller information structure
@@ -101,8 +106,11 @@ static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate)
 
        debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);
 
-       /* Ask for exact frequency by using same value for min/target/max */
-       ret = cops->set_freq(sci, clk->id, clk->data, rate, rate, rate);
+#ifdef CONFIG_K3_AVS0
+       k3_avs_notify_freq(clk->id, clk->data, rate);
+#endif
+
+       ret = cops->set_freq(sci, clk->id, clk->data, 0, rate, ULONG_MAX);
        if (ret)
                dev_err(clk->dev, "%s: set_freq failed (%d)\n", __func__, ret);
 
@@ -199,7 +207,7 @@ static const struct udevice_id ti_sci_clk_of_match[] = {
 static struct clk_ops ti_sci_clk_ops = {
        .of_xlate = ti_sci_clk_of_xlate,
        .request = ti_sci_clk_request,
-       .free = ti_sci_clk_free,
+       .rfree = ti_sci_clk_free,
        .get_rate = ti_sci_clk_get_rate,
        .set_rate = ti_sci_clk_set_rate,
        .set_parent = ti_sci_clk_set_parent,
@@ -212,6 +220,6 @@ U_BOOT_DRIVER(ti_sci_clk) = {
        .id = UCLASS_CLK,
        .of_match = ti_sci_clk_of_match,
        .probe = ti_sci_clk_probe,
-       .priv_auto_alloc_size = sizeof(struct ti_sci_clk_data),
+       .priv_auto      = sizeof(struct ti_sci_clk_data),
        .ops = &ti_sci_clk_ops,
 };