Skip to content

Commit 7fd79ee

Browse files
author
Tero Kristo
committed
clk: ti: add new API for checking if a provided clock is an OMAP clock
omap2_clk_is_hw_omap can now be used to verify if the provided clk_hw is an omap HW clock or not. This is done to replace the usage of CLK_IS_BASIC flag within the TI clock drivers. Signed-off-by: Tero Kristo <t-kristo@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Tested-by: Keerthy <j-keerthy@ti.com>
1 parent 77b773a commit 7fd79ee

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎drivers/clk/ti/clk.c‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,22 @@ int omap2_clk_for_each(int (*fn)(struct clk_hw_omap *hw))
559559

560560
return ret;
561561
}
562+
563+
/**
564+
* omap2_clk_is_hw_omap - check if the provided clk_hw is OMAP clock
565+
* @hw: clk_hw to check if it is an omap clock or not
566+
*
567+
* Checks if the provided clk_hw is OMAP clock or not. Returns true if
568+
* it is, false otherwise.
569+
*/
570+
bool omap2_clk_is_hw_omap(struct clk_hw *hw)
571+
{
572+
struct clk_hw_omap *oclk;
573+
574+
list_for_each_entry(oclk, &clk_hw_omap_clocks, node) {
575+
if (&oclk->hw == hw)
576+
return true;
577+
}
578+
579+
return false;
580+
}

‎drivers/clk/ti/clock.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
302302
int omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw,
303303
struct clk_rate_request *req);
304304
int omap2_clk_for_each(int (*fn)(struct clk_hw_omap *hw));
305+
bool omap2_clk_is_hw_omap(struct clk_hw *hw);
305306

306307
extern struct ti_clk_ll_ops *ti_clk_ll_ops;
307308

0 commit comments

Comments
 (0)