firmware: xilinx: Remove eemi ops for clock_getdivider
authorRajan Vaja <rajan.vaja@xilinx.com>
Fri, 24 Apr 2020 20:57:50 +0000 (13:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Apr 2020 13:45:07 +0000 (15:45 +0200)
Use direct function call instead of using eemi ops for
clock_getdivider.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Link: https://lore.kernel.org/r/1587761887-4279-9-git-send-email-jolly.shah@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/zynqmp/divider.c
drivers/clk/zynqmp/pll.c
drivers/firmware/xilinx/zynqmp.c
include/linux/firmware/xlnx-zynqmp.h

index 13041cd93968dfb833bf7d4bae8007f1c7e0f773..8eed715707e38ea4627e26eb8f4b12db7d48d29f 100644 (file)
@@ -83,9 +83,8 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
        u32 div_type = divider->div_type;
        u32 div, value;
        int ret;
-       const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
 
-       ret = eemi_ops->clock_getdivider(clk_id, &div);
+       ret = zynqmp_pm_clock_getdivider(clk_id, &div);
 
        if (ret)
                pr_warn_once("%s() get divider failed for %s, ret = %d\n",
@@ -163,11 +162,10 @@ static long zynqmp_clk_divider_round_rate(struct clk_hw *hw,
        u32 div_type = divider->div_type;
        u32 bestdiv;
        int ret;
-       const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
 
        /* if read only, just return current value */
        if (divider->flags & CLK_DIVIDER_READ_ONLY) {
-               ret = eemi_ops->clock_getdivider(clk_id, &bestdiv);
+               ret = zynqmp_pm_clock_getdivider(clk_id, &bestdiv);
 
                if (ret)
                        pr_warn_once("%s() get divider failed for %s, ret = %d\n",
index 95fad06eb5428ce15c28d1ae31ef2a3dd9abe2d9..73fb5bb8eb55c44c2af900d44a5cf0a3f117560d 100644 (file)
@@ -141,7 +141,7 @@ static unsigned long zynqmp_pll_recalc_rate(struct clk_hw *hw,
        int ret;
        const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
 
-       ret = eemi_ops->clock_getdivider(clk_id, &fbdiv);
+       ret = zynqmp_pm_clock_getdivider(clk_id, &fbdiv);
        if (ret)
                pr_warn_once("%s() get divider failed for %s, ret = %d\n",
                             __func__, clk_name, ret);
index ef2412dc7d9f230be8867a1ac872b1040e125f56..5782b5c3bf9e12df25e38c04d72f3be11296bae0 100644 (file)
@@ -422,7 +422,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setdivider);
  *
  * Return: Returns status, either success or error+reason
  */
-static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider)
+int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider)
 {
        u32 ret_payload[PAYLOAD_ARG_CNT];
        int ret;
@@ -433,6 +433,7 @@ static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider)
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getdivider);
 
 /**
  * zynqmp_pm_clock_setrate() - Set the clock rate for given id
@@ -741,7 +742,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
 }
 
 static const struct zynqmp_eemi_ops eemi_ops = {
-       .clock_getdivider = zynqmp_pm_clock_getdivider,
        .clock_setrate = zynqmp_pm_clock_setrate,
        .clock_getrate = zynqmp_pm_clock_getrate,
        .clock_setparent = zynqmp_pm_clock_setparent,
index 023f1f9807ed010ba876b363861888219873f612..3bda22f5262b17752b511283b3b4ba689042e878 100644 (file)
@@ -296,7 +296,6 @@ struct zynqmp_pm_query_data {
 struct zynqmp_eemi_ops {
        int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
        int (*fpga_get_status)(u32 *value);
-       int (*clock_getdivider)(u32 clock_id, u32 *divider);
        int (*clock_setrate)(u32 clock_id, u64 rate);
        int (*clock_getrate)(u32 clock_id, u64 *rate);
        int (*clock_setparent)(u32 clock_id, u32 parent_id);
@@ -331,6 +330,7 @@ int zynqmp_pm_clock_enable(u32 clock_id);
 int zynqmp_pm_clock_disable(u32 clock_id);
 int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state);
 int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider);
+int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider);
 #else
 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
 {
@@ -365,6 +365,10 @@ static inline int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider)
 {
        return -ENODEV;
 }
+static inline int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider)
+{
+       return -ENODEV;
+}
 #endif
 
 #endif /* __FIRMWARE_ZYNQMP_H__ */