Lines Matching refs:module

37 static int set_module_rate(const struct s32cc_clk_obj *module,
40 static int get_module_rate(const struct s32cc_clk_obj *module,
75 static int enable_module(struct s32cc_clk_obj *module,
79 static struct s32cc_clk_obj *get_clk_parent(const struct s32cc_clk_obj *module) in get_clk_parent() argument
81 const struct s32cc_clk *clk = s32cc_obj2clk(module); in get_clk_parent()
83 if (clk->module != NULL) { in get_clk_parent()
84 return clk->module; in get_clk_parent()
167 static int enable_osc(struct s32cc_clk_obj *module, in enable_osc() argument
171 const struct s32cc_osc *osc = s32cc_obj2osc(module); in enable_osc()
198 static struct s32cc_clk_obj *get_pll_parent(const struct s32cc_clk_obj *module) in get_pll_parent() argument
200 const struct s32cc_pll *pll = s32cc_obj2pll(module); in get_pll_parent()
263 if (clk->module == NULL) { in get_pll_mux()
268 source = clk->module; in get_pll_mux()
455 static int enable_pll(struct s32cc_clk_obj *module, in enable_pll() argument
459 const struct s32cc_pll *pll = s32cc_obj2pll(module); in enable_pll()
478 if (pll->instance != mux->module) { in enable_pll()
560 static struct s32cc_clk_obj *get_pll_div_parent(const struct s32cc_clk_obj *module) in get_pll_div_parent() argument
562 const struct s32cc_pll_out_div *pdiv = s32cc_obj2plldiv(module); in get_pll_div_parent()
571 static int enable_pll_div(struct s32cc_clk_obj *module, in enable_pll_div() argument
575 const struct s32cc_pll_out_div *pdiv = s32cc_obj2plldiv(module); in enable_pll_div()
692 ret = get_base_addr(mux->module, drv, &cgm_addr); in enable_cgm_mux()
703 static struct s32cc_clk_obj *get_mux_parent(const struct s32cc_clk_obj *module) in get_mux_parent() argument
705 const struct s32cc_clkmux *mux = s32cc_obj2clkmux(module); in get_mux_parent()
722 static int enable_mux(struct s32cc_clk_obj *module, in enable_mux() argument
726 const struct s32cc_clkmux *mux = s32cc_obj2clkmux(module); in enable_mux()
747 switch (mux->module) { in enable_mux()
763 ERROR("Unknown mux parent type: %d\n", mux->module); in enable_mux()
771 static struct s32cc_clk_obj *get_dfs_parent(const struct s32cc_clk_obj *module) in get_dfs_parent() argument
773 const struct s32cc_dfs *dfs = s32cc_obj2dfs(module); in get_dfs_parent()
782 static int enable_dfs(struct s32cc_clk_obj *module, in enable_dfs() argument
797 static int get_dfs_freq(const struct s32cc_clk_obj *module, in get_dfs_freq() argument
801 const struct s32cc_dfs *dfs = s32cc_obj2dfs(module); in get_dfs_freq()
942 get_dfs_div_parent(const struct s32cc_clk_obj *module) in get_dfs_div_parent() argument
944 const struct s32cc_dfs_div *dfs_div = s32cc_obj2dfsdiv(module); in get_dfs_div_parent()
953 static int enable_dfs_div(struct s32cc_clk_obj *module, in enable_dfs_div() argument
957 const struct s32cc_dfs_div *dfs_div = s32cc_obj2dfsdiv(module); in enable_dfs_div()
993 typedef int (*enable_clk_t)(struct s32cc_clk_obj *module,
997 static int enable_part(struct s32cc_clk_obj *module, in enable_part() argument
1001 const struct s32cc_part *part = s32cc_obj2part(module); in enable_part()
1011 static int enable_part_block(struct s32cc_clk_obj *module, in enable_part_block() argument
1015 const struct s32cc_part_block *block = s32cc_obj2partblock(module); in enable_part_block()
1040 get_part_block_parent(const struct s32cc_clk_obj *module) in get_part_block_parent() argument
1042 const struct s32cc_part_block *block = s32cc_obj2partblock(module); in get_part_block_parent()
1047 static int enable_module_with_refcount(struct s32cc_clk_obj *module,
1051 static int enable_part_block_link(struct s32cc_clk_obj *module, in enable_part_block_link() argument
1055 const struct s32cc_part_block_link *link = s32cc_obj2partblocklink(module); in enable_part_block_link()
1070 get_part_block_link_parent(const struct s32cc_clk_obj *module) in get_part_block_link_parent() argument
1072 const struct s32cc_part_block_link *link = s32cc_obj2partblocklink(module); in get_part_block_link_parent()
1077 static int get_part_block_link_freq(const struct s32cc_clk_obj *module, in get_part_block_link_freq() argument
1081 const struct s32cc_part_block_link *block = s32cc_obj2partblocklink(module); in get_part_block_link_freq()
1133 if (clk->module == NULL) { in get_cgm_div_mux()
1138 mux_obj = clk->module; in get_cgm_div_mux()
1149 static int enable_cgm_div(struct s32cc_clk_obj *module, in enable_cgm_div() argument
1152 const struct s32cc_cgm_div *cgm_div = s32cc_obj2cgmdiv(module); in enable_cgm_div()
1181 ret = get_base_addr(mux->module, drv, &cgm_addr); in enable_cgm_div()
1184 mux->module); in enable_cgm_div()
1211 static int set_cgm_div_freq(const struct s32cc_clk_obj *module, in set_cgm_div_freq() argument
1215 struct s32cc_cgm_div *cgm_div = s32cc_obj2cgmdiv(module); in set_cgm_div_freq()
1256 static int get_cgm_div_freq(const struct s32cc_clk_obj *module, in get_cgm_div_freq() argument
1260 const struct s32cc_cgm_div *cgm_div = s32cc_obj2cgmdiv(module); in get_cgm_div_freq()
1282 ret = get_base_addr(mux->module, drv, &cgm_addr); in get_cgm_div_freq()
1285 mux->module); in get_cgm_div_freq()
1307 get_cgm_div_parent(const struct s32cc_clk_obj *module) in get_cgm_div_parent() argument
1309 const struct s32cc_cgm_div *cgm_div = s32cc_obj2cgmdiv(module); in get_cgm_div_parent()
1319 static int no_enable(struct s32cc_clk_obj *module, in no_enable() argument
1358 static struct s32cc_clk_obj *get_module_parent(const struct s32cc_clk_obj *module);
1360 static int enable_module(struct s32cc_clk_obj *module, in enable_module() argument
1364 struct s32cc_clk_obj *parent = get_module_parent(module); in enable_module()
1392 index = (uint32_t)module->type; in enable_module()
1395 ERROR("Undefined module type: %d\n", module->type); in enable_module()
1401 module->type); in enable_module()
1405 parent = get_module_parent(module); in enable_module()
1413 ret = exec_cb_with_refcount(enable_clbs[index], module, drv, in enable_module()
1422 static int enable_module_with_refcount(struct s32cc_clk_obj *module, in enable_module_with_refcount() argument
1426 return exec_cb_with_refcount(enable_module, module, drv, false, depth); in enable_module_with_refcount()
1452 static int set_osc_freq(const struct s32cc_clk_obj *module, unsigned long rate, in set_osc_freq() argument
1455 struct s32cc_osc *osc = s32cc_obj2osc(module); in set_osc_freq()
1475 static int get_osc_freq(const struct s32cc_clk_obj *module, in get_osc_freq() argument
1479 const struct s32cc_osc *osc = s32cc_obj2osc(module); in get_osc_freq()
1498 static int set_clk_freq(const struct s32cc_clk_obj *module, unsigned long rate, in set_clk_freq() argument
1501 const struct s32cc_clk *clk = s32cc_obj2clk(module); in set_clk_freq()
1516 if (clk->module != NULL) { in set_clk_freq()
1517 return set_module_rate(clk->module, rate, orate, depth); in set_clk_freq()
1527 static int get_clk_freq(const struct s32cc_clk_obj *module, in get_clk_freq() argument
1531 const struct s32cc_clk *clk = s32cc_obj2clk(module); in get_clk_freq()
1545 if (clk->module != NULL) { in get_clk_freq()
1546 return get_module_rate(clk->module, drv, rate, ldepth); in get_clk_freq()
1557 static int set_pll_freq(const struct s32cc_clk_obj *module, unsigned long rate, in set_pll_freq() argument
1560 struct s32cc_pll *pll = s32cc_obj2pll(module); in set_pll_freq()
1579 static int get_pll_freq(const struct s32cc_clk_obj *module, in get_pll_freq() argument
1583 const struct s32cc_pll *pll = s32cc_obj2pll(module); in get_pll_freq()
1653 static int set_pll_div_freq(const struct s32cc_clk_obj *module, unsigned long rate, in set_pll_div_freq() argument
1656 struct s32cc_pll_out_div *pdiv = s32cc_obj2plldiv(module); in set_pll_div_freq()
1701 static int get_pll_div_freq(const struct s32cc_clk_obj *module, in get_pll_div_freq() argument
1705 const struct s32cc_pll_out_div *pdiv = s32cc_obj2plldiv(module); in get_pll_div_freq()
1752 static int set_fixed_div_freq(const struct s32cc_clk_obj *module, unsigned long rate, in set_fixed_div_freq() argument
1755 const struct s32cc_fixed_div *fdiv = s32cc_obj2fixeddiv(module); in set_fixed_div_freq()
1776 static int get_fixed_div_freq(const struct s32cc_clk_obj *module, in get_fixed_div_freq() argument
1780 const struct s32cc_fixed_div *fdiv = s32cc_obj2fixeddiv(module); in get_fixed_div_freq()
1793 static inline struct s32cc_clk_obj *get_fixed_div_parent(const struct s32cc_clk_obj *module) in get_fixed_div_parent() argument
1795 const struct s32cc_fixed_div *fdiv = s32cc_obj2fixeddiv(module); in get_fixed_div_parent()
1800 static int set_mux_freq(const struct s32cc_clk_obj *module, unsigned long rate, in set_mux_freq() argument
1803 const struct s32cc_clkmux *mux = s32cc_obj2clkmux(module); in set_mux_freq()
1821 static int get_mux_freq(const struct s32cc_clk_obj *module, in get_mux_freq() argument
1825 const struct s32cc_clkmux *mux = s32cc_obj2clkmux(module); in get_mux_freq()
1844 static int set_dfs_div_freq(const struct s32cc_clk_obj *module, unsigned long rate, in set_dfs_div_freq() argument
1847 struct s32cc_dfs_div *dfs_div = s32cc_obj2dfsdiv(module); in set_dfs_div_freq()
1897 static int get_dfs_div_freq(const struct s32cc_clk_obj *module, in get_dfs_div_freq() argument
1901 const struct s32cc_dfs_div *dfs_div = s32cc_obj2dfsdiv(module); in get_dfs_div_freq()
1945 static int set_part_block_link_freq(const struct s32cc_clk_obj *module, in set_part_block_link_freq() argument
1949 const struct s32cc_part_block_link *link = s32cc_obj2partblocklink(module); in set_part_block_link_freq()
1967 static int set_module_rate(const struct s32cc_clk_obj *module, in set_module_rate() argument
1980 switch (module->type) { in set_module_rate()
1982 ret = set_clk_freq(module, rate, orate, depth); in set_module_rate()
1985 ret = set_osc_freq(module, rate, orate, depth); in set_module_rate()
1988 ret = set_pll_freq(module, rate, orate, depth); in set_module_rate()
1991 ret = set_pll_div_freq(module, rate, orate, depth); in set_module_rate()
1994 ret = set_fixed_div_freq(module, rate, orate, depth); in set_module_rate()
1997 ret = set_mux_freq(module, rate, orate, depth); in set_module_rate()
2000 ret = set_mux_freq(module, rate, orate, depth); in set_module_rate()
2003 ret = set_cgm_div_freq(module, rate, orate, depth); in set_module_rate()
2009 ret = set_dfs_div_freq(module, rate, orate, depth); in set_module_rate()
2012 ret = set_part_block_link_freq(module, rate, orate, depth); in set_module_rate()
2027 static int get_module_rate(const struct s32cc_clk_obj *module, in get_module_rate() argument
2040 switch (module->type) { in get_module_rate()
2042 ret = get_osc_freq(module, drv, rate, ldepth); in get_module_rate()
2045 ret = get_clk_freq(module, drv, rate, ldepth); in get_module_rate()
2048 ret = get_pll_freq(module, drv, rate, ldepth); in get_module_rate()
2051 ret = get_dfs_freq(module, drv, rate, ldepth); in get_module_rate()
2054 ret = get_dfs_div_freq(module, drv, rate, ldepth); in get_module_rate()
2057 ret = get_fixed_div_freq(module, drv, rate, ldepth); in get_module_rate()
2060 ret = get_pll_div_freq(module, drv, rate, ldepth); in get_module_rate()
2063 ret = get_mux_freq(module, drv, rate, ldepth); in get_module_rate()
2066 ret = get_mux_freq(module, drv, rate, ldepth); in get_module_rate()
2075 ret = get_part_block_link_freq(module, drv, rate, ldepth); in get_module_rate()
2078 ret = get_cgm_div_freq(module, drv, rate, ldepth); in get_module_rate()
2132 static struct s32cc_clk_obj *get_no_parent(const struct s32cc_clk_obj *module) in get_no_parent() argument
2139 static struct s32cc_clk_obj *get_module_parent(const struct s32cc_clk_obj *module) in get_module_parent() argument
2158 if (module == NULL) { in get_module_parent()
2162 index = (uint32_t)module->type; in get_module_parent()
2165 ERROR("Undefined module type: %d\n", module->type); in get_module_parent()
2170 ERROR("Undefined parent getter for type: %d\n", module->type); in get_module_parent()
2174 return parents_clbs[index](module); in get_module_parent()
2190 parent = get_module_parent(clk->module); in s32cc_clk_get_parent()