feat(nxp-clk): add get_rate for partition objects

The partition-related objects do not participate in clock rate
calculation, except the s32cc_part_block_link_t, whose call is forwarded
to the parent object.

Change-Id: Id9e7fa49c3c1fb5b30b4c1b97fc8441bc967578a
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
This commit is contained in:
Ghennadi Procopciuc 2025-01-13 12:00:50 +02:00
parent d1567da68d
commit a74cf75f08

View file

@ -958,6 +958,22 @@ get_part_block_link_parent(const struct s32cc_clk_obj *module)
return link->parent; return link->parent;
} }
static int get_part_block_link_freq(const struct s32cc_clk_obj *module,
const struct s32cc_clk_drv *drv,
unsigned long *rate, unsigned int depth)
{
const struct s32cc_part_block_link *block = s32cc_obj2partblocklink(module);
unsigned int ldepth = depth;
int ret;
ret = update_stack_depth(&ldepth);
if (ret != 0) {
return ret;
}
return get_module_rate(block->parent, drv, rate, ldepth);
}
static int no_enable(struct s32cc_clk_obj *module, static int no_enable(struct s32cc_clk_obj *module,
const struct s32cc_clk_drv *drv, const struct s32cc_clk_drv *drv,
unsigned int depth) unsigned int depth)
@ -1667,6 +1683,15 @@ static int get_module_rate(const struct s32cc_clk_obj *module,
case s32cc_shared_clkmux_t: case s32cc_shared_clkmux_t:
ret = get_mux_freq(module, drv, rate, ldepth); ret = get_mux_freq(module, drv, rate, ldepth);
break; break;
case s32cc_part_t:
ERROR("s32cc_part_t cannot be used to get rate\n");
break;
case s32cc_part_block_t:
ERROR("s32cc_part_block_t cannot be used to get rate\n");
break;
case s32cc_part_block_link_t:
ret = get_part_block_link_freq(module, drv, rate, ldepth);
break;
default: default:
ret = -EINVAL; ret = -EINVAL;
break; break;