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

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-11-git-send-email-jolly.shah@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/zynqmp/clk-mux-zynqmp.c
drivers/firmware/xilinx/zynqmp.c
include/linux/firmware/xlnx-zynqmp.h

index 0af8f74c5fa5424028b63bf8c4db45fc93db0aee..06194149be831208f4bd5321ab30b01a27b40998 100644 (file)
@@ -47,9 +47,8 @@ static u8 zynqmp_clk_mux_get_parent(struct clk_hw *hw)
        u32 clk_id = mux->clk_id;
        u32 val;
        int ret;
-       const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
 
-       ret = eemi_ops->clock_getparent(clk_id, &val);
+       ret = zynqmp_pm_clock_getparent(clk_id, &val);
 
        if (ret)
                pr_warn_once("%s() getparent failed for clock: %s, ret = %d\n",
@@ -71,9 +70,8 @@ static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index)
        const char *clk_name = clk_hw_get_name(hw);
        u32 clk_id = mux->clk_id;
        int ret;
-       const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
 
-       ret = eemi_ops->clock_setparent(clk_id, index);
+       ret = zynqmp_pm_clock_setparent(clk_id, index);
 
        if (ret)
                pr_warn_once("%s() set parent failed for clock: %s, ret = %d\n",
index 84622014601ecf5d2bfe05d30908fd2603a547d3..b0aa967d9b7c56a7159ac9f402f443d6f3a67f71 100644 (file)
@@ -485,11 +485,12 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getrate);
  *
  * Return: Returns status, either success or error+reason
  */
-static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
+int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
 {
        return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id,
                                   parent_id, 0, 0, NULL);
 }
+EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setparent);
 
 /**
  * zynqmp_pm_clock_getparent() - Get the clock parent for given id
@@ -501,7 +502,7 @@ static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
  *
  * Return: Returns status, either success or error+reason
  */
-static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
+int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
 {
        u32 ret_payload[PAYLOAD_ARG_CNT];
        int ret;
@@ -512,6 +513,7 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getparent);
 
 /**
  * zynqmp_is_valid_ioctl() - Check whether IOCTL ID is valid or not
@@ -744,8 +746,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
 }
 
 static const struct zynqmp_eemi_ops eemi_ops = {
-       .clock_setparent = zynqmp_pm_clock_setparent,
-       .clock_getparent = zynqmp_pm_clock_getparent,
        .ioctl = zynqmp_pm_ioctl,
        .reset_assert = zynqmp_pm_reset_assert,
        .reset_get_status = zynqmp_pm_reset_get_status,
index a71f52c6173e6b5ca7a4a1bcf460a67d44243890..7abb68311f1792e438e1c7fe24a22b5d82ed7162 100644 (file)
@@ -296,8 +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_setparent)(u32 clock_id, u32 parent_id);
-       int (*clock_getparent)(u32 clock_id, u32 *parent_id);
        int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
        int (*reset_assert)(const enum zynqmp_pm_reset reset,
                            const enum zynqmp_pm_reset_action assert_flag);
@@ -331,6 +329,8 @@ int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider);
 int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider);
 int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate);
 int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate);
+int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id);
+int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id);
 #else
 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
 {
@@ -377,6 +377,14 @@ static inline int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate)
 {
        return -ENODEV;
 }
+static inline int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
+{
+       return -ENODEV;
+}
+static inline int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
+{
+       return -ENODEV;
+}
 #endif
 
 #endif /* __FIRMWARE_ZYNQMP_H__ */