Skip to content

Commit 3637e84

Browse files
rajanv-xilinxgregkh
authored andcommitted
firmware: xilinx: Remove eemi ops for clock_enable
Use direct function call for clock_enable instead of eemi ops. 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-5-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6366c1b commit 3637e84

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎drivers/clk/zynqmp/clk-gate-zynqmp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static int zynqmp_clk_gate_enable(struct clk_hw *hw)
3939
int ret;
4040
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
4141

42-
ret = eemi_ops->clock_enable(clk_id);
42+
ret = zynqmp_pm_clock_enable(clk_id);
4343

4444
if (ret)
4545
pr_warn_once("%s() clock enabled failed for %s, ret = %d\n",

‎drivers/clk/zynqmp/pll.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,11 @@ static int zynqmp_pll_enable(struct clk_hw *hw)
246246
const char *clk_name = clk_hw_get_name(hw);
247247
u32 clk_id = clk->clk_id;
248248
int ret;
249-
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
250249

251250
if (zynqmp_pll_is_enabled(hw))
252251
return 0;
253252

254-
ret = eemi_ops->clock_enable(clk_id);
253+
ret = zynqmp_pm_clock_enable(clk_id);
255254
if (ret)
256255
pr_warn_once("%s() clock enable failed for %s, ret = %d\n",
257256
__func__, clk_name, ret);

‎drivers/firmware/xilinx/zynqmp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,11 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_query_data);
351351
*
352352
* Return: Returns status, either success or error+reason
353353
*/
354-
static int zynqmp_pm_clock_enable(u32 clock_id)
354+
int zynqmp_pm_clock_enable(u32 clock_id)
355355
{
356356
return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL);
357357
}
358+
EXPORT_SYMBOL_GPL(zynqmp_pm_clock_enable);
358359

359360
/**
360361
* 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)
737738
}
738739

739740
static const struct zynqmp_eemi_ops eemi_ops = {
740-
.clock_enable = zynqmp_pm_clock_enable,
741741
.clock_disable = zynqmp_pm_clock_disable,
742742
.clock_getstate = zynqmp_pm_clock_getstate,
743743
.clock_setdivider = zynqmp_pm_clock_setdivider,

‎include/linux/firmware/xlnx-zynqmp.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ struct zynqmp_pm_query_data {
296296
struct zynqmp_eemi_ops {
297297
int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
298298
int (*fpga_get_status)(u32 *value);
299-
int (*clock_enable)(u32 clock_id);
300299
int (*clock_disable)(u32 clock_id);
301300
int (*clock_getstate)(u32 clock_id, u32 *state);
302301
int (*clock_setdivider)(u32 clock_id, u32 divider);
@@ -331,6 +330,7 @@ const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
331330
int zynqmp_pm_get_api_version(u32 *version);
332331
int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
333332
int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);
333+
int zynqmp_pm_clock_enable(u32 clock_id);
334334
#else
335335
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
336336
{
@@ -349,6 +349,10 @@ static inline int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata,
349349
{
350350
return -ENODEV;
351351
}
352+
static inline int zynqmp_pm_clock_enable(u32 clock_id)
353+
{
354+
return -ENODEV;
355+
}
352356
#endif
353357

354358
#endif /* __FIRMWARE_ZYNQMP_H__ */

0 commit comments

Comments
 (0)