mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
driver: rknpu: Add opp data for rv1126b
Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com> Change-Id: I43c8abde8a892753e843a5ef7765af74f43acad1
This commit is contained in:
@@ -260,6 +260,14 @@ static const struct rockchip_opp_data rk3588_npu_opp_data = {
|
||||
#endif
|
||||
};
|
||||
|
||||
static const struct rockchip_opp_data rv1126b_npu_opp_data = {
|
||||
.is_use_pvtpll = true,
|
||||
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
|
||||
.config_regulators = npu_opp_config_regulators,
|
||||
.config_clks = npu_opp_config_clks,
|
||||
#endif
|
||||
};
|
||||
|
||||
static const struct of_device_id rockchip_npu_of_match[] = {
|
||||
{
|
||||
.compatible = "rockchip,rk3576",
|
||||
@@ -269,6 +277,10 @@ static const struct of_device_id rockchip_npu_of_match[] = {
|
||||
.compatible = "rockchip,rk3588",
|
||||
.data = (void *)&rk3588_npu_opp_data,
|
||||
},
|
||||
{
|
||||
.compatible = "rockchip,rv1126b",
|
||||
.data = (void *)&rv1126b_npu_opp_data,
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
@@ -420,7 +432,7 @@ int rknpu_devfreq_runtime_suspend(struct device *dev)
|
||||
struct rknpu_device *rknpu_dev = dev_get_drvdata(dev);
|
||||
struct rockchip_opp_info *opp_info = &rknpu_dev->opp_info;
|
||||
|
||||
if (opp_info->is_scmi_clk) {
|
||||
if (rockchip_opp_is_use_pvtpll(opp_info)) {
|
||||
if (clk_set_rate(opp_info->clk, POWER_DOWN_FREQ))
|
||||
LOG_DEV_ERROR(dev, "failed to restore clk rate\n");
|
||||
}
|
||||
@@ -448,7 +460,7 @@ int rknpu_devfreq_runtime_resume(struct device *dev)
|
||||
if (opp_info->data && opp_info->data->set_read_margin)
|
||||
opp_info->data->set_read_margin(dev, opp_info,
|
||||
opp_info->target_rm);
|
||||
if (opp_info->is_scmi_clk) {
|
||||
if (rockchip_opp_is_use_pvtpll(opp_info)) {
|
||||
if (clk_set_rate(opp_info->clk, rknpu_dev->current_freq))
|
||||
LOG_DEV_ERROR(dev, "failed to set power down rate\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user