History

firmware: xilinx: Remove eemi ops for clock_enable

Use direct function call for clock_enable instead of eemi ops.

Rajan Vaja committed 6 years ago

Commit 3637e841 parent 6366c1b4 files · +9 −6Browse files

Unified · Split

4 files
  1. drivers/clk/zynqmp/clk-gate-zynqmp.c +1 −1
  2. drivers/clk/zynqmp/pll.c +1 −2
  3. drivers/firmware/xilinx/zynqmp.c +2 −2
  4. include/linux/firmware/xlnx-zynqmp.h +5 −1
drivers/clk/zynqmp/clk-gate-zynqmp.c+1−1
@@ -39,7 +39,7 @@ static int zynqmp_clk_gate_enable(struct clk_hw *hw) · 38 unmodified lines
39 int ret;39 int ret;
40 const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();40 const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
41 41
42 ret = eemi_ops->clock_enable(clk_id);42 ret = zynqmp_pm_clock_enable(clk_id);
43 43
44 if (ret)44 if (ret)
45 pr_warn_once("%s() clock enabled failed for %s, ret = %d\n",45 pr_warn_once("%s() clock enabled failed for %s, ret = %d\n",
drivers/clk/zynqmp/pll.c+1−2
@@ -246,12 +246,11 @@ static int zynqmp_pll_enable(struct clk_hw *hw) · 245 unmodified lines
246 const char *clk_name = clk_hw_get_name(hw);246 const char *clk_name = clk_hw_get_name(hw);
247 u32 clk_id = clk->clk_id;247 u32 clk_id = clk->clk_id;
248 int ret;248 int ret;
249 const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
250 249
251 if (zynqmp_pll_is_enabled(hw))250 if (zynqmp_pll_is_enabled(hw))
252 return 0;251 return 0;
253 252
254 ret = eemi_ops->clock_enable(clk_id);253 ret = zynqmp_pm_clock_enable(clk_id);
255 if (ret)254 if (ret)
256 pr_warn_once("%s() clock enable failed for %s, ret = %d\n",255 pr_warn_once("%s() clock enable failed for %s, ret = %d\n",
257 __func__, clk_name, ret);256 __func__, clk_name, ret);
drivers/firmware/xilinx/zynqmp.c+2−2
@@ -351,10 +351,11 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_query_data); · 350 unmodified lines
351 *351 *
352 * Return: Returns status, either success or error+reason352 * Return: Returns status, either success or error+reason
353 */353 */
354static int zynqmp_pm_clock_enable(u32 clock_id)354int zynqmp_pm_clock_enable(u32 clock_id)
355{355{
356 return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL);356 return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL);
357}357}
358EXPORT_SYMBOL_GPL(zynqmp_pm_clock_enable);
358 359
359/**360/**
360 * zynqmp_pm_clock_disable() - Disable the clock for given id361 * zynqmp_pm_clock_disable() - Disable the clock for given id
@@ -737,7 +738,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out) · 376 unmodified lines
737}738}
738 739
739static const struct zynqmp_eemi_ops eemi_ops = {740static const struct zynqmp_eemi_ops eemi_ops = {
740 .clock_enable = zynqmp_pm_clock_enable,
741 .clock_disable = zynqmp_pm_clock_disable,741 .clock_disable = zynqmp_pm_clock_disable,
742 .clock_getstate = zynqmp_pm_clock_getstate,742 .clock_getstate = zynqmp_pm_clock_getstate,
743 .clock_setdivider = zynqmp_pm_clock_setdivider,743 .clock_setdivider = zynqmp_pm_clock_setdivider,
include/linux/firmware/xlnx-zynqmp.h+5−1
@@ -296,7 +296,6 @@ struct zynqmp_pm_query_data { · 295 unmodified lines
296struct zynqmp_eemi_ops {296struct zynqmp_eemi_ops {
297 int (*fpga_load)(const u64 address, const u32 size, const u32 flags);297 int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
298 int (*fpga_get_status)(u32 *value);298 int (*fpga_get_status)(u32 *value);
299 int (*clock_enable)(u32 clock_id);
300 int (*clock_disable)(u32 clock_id);299 int (*clock_disable)(u32 clock_id);
301 int (*clock_getstate)(u32 clock_id, u32 *state);300 int (*clock_getstate)(u32 clock_id, u32 *state);
302 int (*clock_setdivider)(u32 clock_id, u32 divider);301 int (*clock_setdivider)(u32 clock_id, u32 divider);
@@ -331,6 +330,7 @@ const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); · 28 unmodified lines
331int zynqmp_pm_get_api_version(u32 *version);330int zynqmp_pm_get_api_version(u32 *version);
332int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);331int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
333int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);332int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);
333int zynqmp_pm_clock_enable(u32 clock_id);
334#else334#else
335static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)335static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
336{336{
@@ -349,6 +349,10 @@ static inline int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, · 12 unmodified lines
349{349{
350 return -ENODEV;350 return -ENODEV;
351}351}
352static inline int zynqmp_pm_clock_enable(u32 clock_id)
353{
354 return -ENODEV;
355}
352#endif356#endif
353 357
354#endif /* __FIRMWARE_ZYNQMP_H__ */358#endif /* __FIRMWARE_ZYNQMP_H__ */