mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-16 03:18:54 +00:00
v1.0.3
This commit is contained in:
@@ -21,6 +21,7 @@ int hal_clk_enable_deassertrst(uint32_t clk_id)
|
||||
cfg->ops->enable_clk_deassert_rst != NULL,
|
||||
-EINVAL);
|
||||
|
||||
cfg->enable_count = 1;
|
||||
return (cfg->ops->enable_clk_deassert_rst(cfg));
|
||||
}
|
||||
|
||||
@@ -35,6 +36,7 @@ int hal_clk_disable_assertrst(uint32_t clk_id)
|
||||
cfg->ops->disable_clk_assert_rst != NULL,
|
||||
-EINVAL);
|
||||
|
||||
cfg->enable_count = 0;
|
||||
cfg->ops->disable_clk_assert_rst(cfg);
|
||||
return 0;
|
||||
}
|
||||
@@ -44,11 +46,12 @@ int hal_clk_enable(uint32_t clk_id)
|
||||
struct aic_clk_comm_cfg *cfg;
|
||||
|
||||
CHECK_PARAM(clk_id < AIC_CLK_END && clk_id > 0, -EINVAL);
|
||||
|
||||
cfg = (struct aic_clk_comm_cfg *)aic_clk_cfgs[clk_id];
|
||||
|
||||
CHECK_PARAM(cfg != NULL && cfg->ops != NULL && cfg->ops->enable != NULL,
|
||||
-EINVAL);
|
||||
|
||||
cfg->enable_count = 1;
|
||||
return (cfg->ops->enable(cfg));
|
||||
}
|
||||
|
||||
@@ -62,6 +65,8 @@ int hal_clk_disable(uint32_t clk_id)
|
||||
CHECK_PARAM(cfg != NULL && cfg->ops != NULL && cfg->ops->disable != NULL,
|
||||
-EINVAL);
|
||||
|
||||
cfg->enable_count = 0;
|
||||
|
||||
cfg->ops->disable(cfg);
|
||||
return 0;
|
||||
}
|
||||
@@ -73,8 +78,10 @@ int hal_clk_is_enabled(uint32_t clk_id)
|
||||
CHECK_PARAM(clk_id < AIC_CLK_END && clk_id > 0, -EINVAL);
|
||||
|
||||
cfg = (struct aic_clk_comm_cfg *)aic_clk_cfgs[clk_id];
|
||||
CHECK_PARAM(cfg != NULL && cfg->ops != NULL && cfg->ops->is_enabled != NULL,
|
||||
-EINVAL);
|
||||
CHECK_PARAM(cfg != NULL && cfg->ops != NULL, -EINVAL);
|
||||
|
||||
if (cfg->ops->is_enabled == NULL)
|
||||
return cfg->enable_count;
|
||||
|
||||
return (cfg->ops->is_enabled(cfg));
|
||||
}
|
||||
@@ -220,3 +227,14 @@ int hal_clk_enable_deassertrst_iter(uint32_t clk_id)
|
||||
ret = hal_clk_enable(clk_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char *hal_clk_get_name(uint32_t clk_id)
|
||||
{
|
||||
struct aic_clk_comm_cfg *cfg;
|
||||
|
||||
CHECK_PARAM(clk_id < AIC_CLK_END && clk_id > 0, 0);
|
||||
cfg = (struct aic_clk_comm_cfg *)aic_clk_cfgs[clk_id];
|
||||
CHECK_PARAM(cfg != NULL && cfg->name != NULL, NULL);
|
||||
|
||||
return cfg->name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user