From: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
To: Bryan O'Donoghue <bod@kernel.org>,
Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Stefan Schmidt <stefan.schmidt@linaro.org>,
Hans Verkuil <hverkuil@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Thierry Reding <thierry.reding@kernel.org>,
Mikko Perttunen <mperttunen@nvidia.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Jonathan Hunter <jonathanh@nvidia.com>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux.dev, driver-core@lists.linux.dev,
dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Subject: [PATCH v2 08/13] media: iris: Use power domain type to look up pd_devs index
Date: Thu, 23 Apr 2026 18:59:37 +0530 [thread overview]
Message-ID: <20260423-glymur-v2-8-0296bccb9f4e@oss.qualcomm.com> (raw)
In-Reply-To: <20260423-glymur-v2-0-0296bccb9f4e@oss.qualcomm.com>
The pmdomain_tbl was a array of strings holding only the power domain
names. Callers had to pass a pd_devs[] pointer indexed directly by the
platform_pm_domain_type enum value to iris_enable_power_domains() and
iris_disable_power_domains().
A future platform may need to introduce a new enum value that aliases
an existing one (e.g. IRIS_VCODEC1_POWER_DOMAIN aliasing the
IRIS_VPP0_HW_POWER_DOMAIN on Glymur), which would break the assumption
that enum values map 1:1 to pd_devs[] indices.
To fix this, replace the string array with a new struct platform_pd_data
that pairs each power domain name with its platform_pm_domain_type. Add
a helper iris_get_pd_index_by_type() that walks this table and returns
the correct pd_devs[] index for a given type.
Update iris_enable_power_domains() and iris_disable_power_domains()
to accept a platform_pm_domain_type instead of a struct device pointer.
They now call the helper internally to resolve the index, removing the
need for callers to do the index lookup themselves.
This prepares the driver for adding new platforms where power domain enum
values cannot be used directly as pd_devs[] indices.
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
---
.../platform/qcom/iris/iris_platform_common.h | 9 +++-
.../media/platform/qcom/iris/iris_platform_gen1.c | 18 +++++---
.../media/platform/qcom/iris/iris_platform_gen2.c | 24 ++++++----
drivers/media/platform/qcom/iris/iris_probe.c | 4 +-
drivers/media/platform/qcom/iris/iris_resources.c | 44 +++++++++++++++++-
drivers/media/platform/qcom/iris/iris_resources.h | 6 ++-
drivers/media/platform/qcom/iris/iris_vpu3x.c | 9 ++--
drivers/media/platform/qcom/iris/iris_vpu4x.c | 52 ++++++++--------------
drivers/media/platform/qcom/iris/iris_vpu_common.c | 23 +++++-----
9 files changed, 117 insertions(+), 72 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 30e9d4d288c6..7d59e6364e9d 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -212,6 +212,12 @@ enum platform_pm_domain_type {
IRIS_APV_HW_POWER_DOMAIN,
};
+struct platform_pd_data {
+ enum platform_pm_domain_type *pd_types;
+ const char **pd_names;
+ u32 pd_count;
+};
+
struct iris_platform_data {
void (*init_hfi_command_ops)(struct iris_core *core);
void (*init_hfi_response_ops)(struct iris_core *core);
@@ -225,8 +231,7 @@ struct iris_platform_data {
unsigned int icc_tbl_size;
const struct bw_info *bw_tbl_dec;
unsigned int bw_tbl_dec_size;
- const char * const *pmdomain_tbl;
- unsigned int pmdomain_tbl_size;
+ const struct platform_pd_data *pmdomain_tbl;
const char * const *opp_pd_tbl;
unsigned int opp_pd_tbl_size;
const struct platform_clk_data *clk_tbl;
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/drivers/media/platform/qcom/iris/iris_platform_gen1.c
index be6a631f8ede..0ec73783bc10 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.c
@@ -279,7 +279,17 @@ static const struct bw_info sm8250_bw_table_dec[] = {
{ ((1920 * 1080) / 256) * 30, 416000 },
};
-static const char * const sm8250_pmdomain_table[] = { "venus", "vcodec0" };
+static const struct platform_pd_data sm8250_pmdomain_table = {
+ .pd_types = (enum platform_pm_domain_type []) {
+ IRIS_CTRL_POWER_DOMAIN,
+ IRIS_VCODEC_POWER_DOMAIN,
+ },
+ .pd_names = (const char *[]) {
+ "venus",
+ "vcodec0",
+ },
+ .pd_count = 2,
+};
static const char * const sm8250_opp_pd_table[] = { "mx" };
@@ -350,8 +360,7 @@ const struct iris_platform_data sm8250_data = {
.clk_rst_tbl_size = ARRAY_SIZE(sm8250_clk_reset_table),
.bw_tbl_dec = sm8250_bw_table_dec,
.bw_tbl_dec_size = ARRAY_SIZE(sm8250_bw_table_dec),
- .pmdomain_tbl = sm8250_pmdomain_table,
- .pmdomain_tbl_size = ARRAY_SIZE(sm8250_pmdomain_table),
+ .pmdomain_tbl = &sm8250_pmdomain_table,
.opp_pd_tbl = sm8250_opp_pd_table,
.opp_pd_tbl_size = ARRAY_SIZE(sm8250_opp_pd_table),
.clk_tbl = sm8250_clk_table,
@@ -403,8 +412,7 @@ const struct iris_platform_data sc7280_data = {
.icc_tbl_size = ARRAY_SIZE(sm8250_icc_table),
.bw_tbl_dec = sc7280_bw_table_dec,
.bw_tbl_dec_size = ARRAY_SIZE(sc7280_bw_table_dec),
- .pmdomain_tbl = sm8250_pmdomain_table,
- .pmdomain_tbl_size = ARRAY_SIZE(sm8250_pmdomain_table),
+ .pmdomain_tbl = &sm8250_pmdomain_table,
.opp_pd_tbl = sc7280_opp_pd_table,
.opp_pd_tbl_size = ARRAY_SIZE(sc7280_opp_pd_table),
.clk_tbl = sc7280_clk_table,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 47c6b650f0b4..5862c89a4971 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -775,7 +775,17 @@ static const struct bw_info sm8550_bw_table_dec[] = {
{ ((1920 * 1080) / 256) * 30, 294000 },
};
-static const char * const sm8550_pmdomain_table[] = { "venus", "vcodec0" };
+static const struct platform_pd_data sm8550_pmdomain_table = {
+ .pd_types = (enum platform_pm_domain_type []) {
+ IRIS_CTRL_POWER_DOMAIN,
+ IRIS_VCODEC_POWER_DOMAIN,
+ },
+ .pd_names = (const char *[]) {
+ "venus",
+ "vcodec0",
+ },
+ .pd_count = 2,
+};
static const char * const sm8550_opp_pd_table[] = { "mxc", "mmcx" };
@@ -934,8 +944,7 @@ const struct iris_platform_data sm8550_data = {
.clk_rst_tbl_size = ARRAY_SIZE(sm8550_clk_reset_table),
.bw_tbl_dec = sm8550_bw_table_dec,
.bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec),
- .pmdomain_tbl = sm8550_pmdomain_table,
- .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table),
+ .pmdomain_tbl = &sm8550_pmdomain_table,
.opp_pd_tbl = sm8550_opp_pd_table,
.opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table),
.clk_tbl = sm8550_clk_table,
@@ -1039,8 +1048,7 @@ const struct iris_platform_data sm8650_data = {
.controller_rst_tbl_size = ARRAY_SIZE(sm8650_controller_reset_table),
.bw_tbl_dec = sm8550_bw_table_dec,
.bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec),
- .pmdomain_tbl = sm8550_pmdomain_table,
- .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table),
+ .pmdomain_tbl = &sm8550_pmdomain_table,
.opp_pd_tbl = sm8550_opp_pd_table,
.opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table),
.clk_tbl = sm8550_clk_table,
@@ -1135,8 +1143,7 @@ const struct iris_platform_data sm8750_data = {
.clk_rst_tbl_size = ARRAY_SIZE(sm8750_clk_reset_table),
.bw_tbl_dec = sm8550_bw_table_dec,
.bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec),
- .pmdomain_tbl = sm8550_pmdomain_table,
- .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table),
+ .pmdomain_tbl = &sm8550_pmdomain_table,
.opp_pd_tbl = sm8550_opp_pd_table,
.opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table),
.clk_tbl = sm8750_clk_table,
@@ -1235,8 +1242,7 @@ const struct iris_platform_data qcs8300_data = {
.clk_rst_tbl_size = ARRAY_SIZE(sm8550_clk_reset_table),
.bw_tbl_dec = sm8550_bw_table_dec,
.bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec),
- .pmdomain_tbl = sm8550_pmdomain_table,
- .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table),
+ .pmdomain_tbl = &sm8550_pmdomain_table,
.opp_pd_tbl = sm8550_opp_pd_table,
.opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table),
.clk_tbl = sm8550_clk_table,
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index 34751912f871..34c981be9bc1 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -43,8 +43,8 @@ static int iris_init_power_domains(struct iris_core *core)
int ret;
struct dev_pm_domain_attach_data iris_pd_data = {
- .pd_names = core->iris_platform_data->pmdomain_tbl,
- .num_pd_names = core->iris_platform_data->pmdomain_tbl_size,
+ .pd_names = core->iris_platform_data->pmdomain_tbl->pd_names,
+ .num_pd_names = core->iris_platform_data->pmdomain_tbl->pd_count,
.pd_flags = PD_FLAG_NO_DEV_LINK,
};
diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/media/platform/qcom/iris/iris_resources.c
index 773f6548370a..ae27488579d7 100644
--- a/drivers/media/platform/qcom/iris/iris_resources.c
+++ b/drivers/media/platform/qcom/iris/iris_resources.c
@@ -70,10 +70,43 @@ int iris_opp_set_rate(struct device *dev, unsigned long freq)
return dev_pm_opp_set_opp(dev, opp);
}
-int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev)
+static int iris_get_pd_index_by_type(struct iris_core *core, enum platform_pm_domain_type pd_type)
{
+ const struct platform_pd_data *pd_tbl;
+ u32 pd_count, i;
+
+ pd_tbl = core->iris_platform_data->pmdomain_tbl;
+ pd_count = core->iris_platform_data->pmdomain_tbl->pd_count;
+
+ for (i = 0; i < pd_count; i++) {
+ if (pd_tbl->pd_types[i] == pd_type)
+ return i;
+ }
+
+ return -EINVAL;
+}
+
+int iris_genpd_set_hwmode(struct iris_core *core, enum platform_pm_domain_type pd_type, bool hwmode)
+{
+ int pd_index = iris_get_pd_index_by_type(core, pd_type);
+
+ if (pd_index < 0)
+ return pd_index;
+
+ return dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[pd_index], hwmode);
+}
+
+int iris_enable_power_domains(struct iris_core *core, enum platform_pm_domain_type pd_type)
+{
+ int pd_index = iris_get_pd_index_by_type(core, pd_type);
+ struct device *pd_dev;
int ret;
+ if (pd_index < 0)
+ return pd_index;
+
+ pd_dev = core->pmdomain_tbl->pd_devs[pd_index];
+
ret = iris_opp_set_rate(core->dev, ULONG_MAX);
if (ret)
return ret;
@@ -85,10 +118,17 @@ int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev)
return ret;
}
-int iris_disable_power_domains(struct iris_core *core, struct device *pd_dev)
+int iris_disable_power_domains(struct iris_core *core, enum platform_pm_domain_type pd_type)
{
+ int pd_index = iris_get_pd_index_by_type(core, pd_type);
+ struct device *pd_dev;
int ret;
+ if (pd_index < 0)
+ return pd_index;
+
+ pd_dev = core->pmdomain_tbl->pd_devs[pd_index];
+
ret = iris_opp_set_rate(core->dev, 0);
if (ret)
return ret;
diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/media/platform/qcom/iris/iris_resources.h
index 6bfbd2dc6db0..d5692e4694b1 100644
--- a/drivers/media/platform/qcom/iris/iris_resources.h
+++ b/drivers/media/platform/qcom/iris/iris_resources.h
@@ -9,11 +9,13 @@
struct iris_core;
int iris_opp_set_rate(struct device *dev, unsigned long freq);
-int iris_enable_power_domains(struct iris_core *core, struct device *pd_dev);
-int iris_disable_power_domains(struct iris_core *core, struct device *pd_dev);
+int iris_enable_power_domains(struct iris_core *core, enum platform_pm_domain_type pd_type);
+int iris_disable_power_domains(struct iris_core *core, enum platform_pm_domain_type pd_type);
int iris_unset_icc_bw(struct iris_core *core);
int iris_set_icc_bw(struct iris_core *core, unsigned long icc_bw);
int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk_type clk_type);
int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_type clk_type);
+int iris_genpd_set_hwmode(struct iris_core *core, enum platform_pm_domain_type pd_type,
+ bool hwmode);
#endif
diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/platform/qcom/iris/iris_vpu3x.c
index 1f0a3a47d87f..a9f43dbfc695 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu3x.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c
@@ -208,7 +208,7 @@ static int iris_vpu33_power_off_controller(struct iris_core *core)
iris_disable_unprepare_clock(core, IRIS_CTRL_CLK);
disable_power:
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN);
iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK);
return 0;
@@ -218,8 +218,7 @@ static int iris_vpu35_power_on_hw(struct iris_core *core)
{
int ret;
- ret = iris_enable_power_domains(core,
- core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
if (ret)
return ret;
@@ -235,7 +234,7 @@ static int iris_vpu35_power_on_hw(struct iris_core *core)
if (ret)
goto err_disable_hw_free_clk;
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN], true);
+ ret = iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, true);
if (ret)
goto err_disable_hw_clk;
@@ -248,7 +247,7 @@ static int iris_vpu35_power_on_hw(struct iris_core *core)
err_disable_axi_clk:
iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK);
err_disable_power:
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
return ret;
}
diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/platform/qcom/iris/iris_vpu4x.c
index 4082d331d2f3..7b8922d8aec7 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu4x.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c
@@ -27,28 +27,24 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core *core, bool hw_mode, u32
{
int ret;
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN],
- hw_mode);
+ ret = iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, hw_mode);
if (ret)
return ret;
if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) {
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs
- [IRIS_VPP0_HW_POWER_DOMAIN], hw_mode);
+ ret = iris_genpd_set_hwmode(core, IRIS_VPP0_HW_POWER_DOMAIN, hw_mode);
if (ret)
goto restore_hw_domain_mode;
}
if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) {
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs
- [IRIS_VPP1_HW_POWER_DOMAIN], hw_mode);
+ ret = iris_genpd_set_hwmode(core, IRIS_VPP1_HW_POWER_DOMAIN, hw_mode);
if (ret)
goto restore_vpp0_domain_mode;
}
if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) {
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs
- [IRIS_APV_HW_POWER_DOMAIN], hw_mode);
+ ret = iris_genpd_set_hwmode(core, IRIS_APV_HW_POWER_DOMAIN, hw_mode);
if (ret)
goto restore_vpp1_domain_mode;
}
@@ -57,14 +53,12 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core *core, bool hw_mode, u32
restore_vpp1_domain_mode:
if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT))
- dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VPP1_HW_POWER_DOMAIN],
- !hw_mode);
+ iris_genpd_set_hwmode(core, IRIS_VPP1_HW_POWER_DOMAIN, !hw_mode);
restore_vpp0_domain_mode:
if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT))
- dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VPP0_HW_POWER_DOMAIN],
- !hw_mode);
+ iris_genpd_set_hwmode(core, IRIS_VPP0_HW_POWER_DOMAIN, !hw_mode);
restore_hw_domain_mode:
- dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN], !hw_mode);
+ iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, !hw_mode);
return ret;
}
@@ -73,8 +67,7 @@ static int iris_vpu4x_power_on_apv(struct iris_core *core)
{
int ret;
- ret = iris_enable_power_domains(core,
- core->pmdomain_tbl->pd_devs[IRIS_APV_HW_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_APV_HW_POWER_DOMAIN);
if (ret)
return ret;
@@ -85,7 +78,7 @@ static int iris_vpu4x_power_on_apv(struct iris_core *core)
return 0;
disable_apv_hw_power_domain:
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_APV_HW_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_APV_HW_POWER_DOMAIN);
return ret;
}
@@ -140,7 +133,7 @@ static void iris_vpu4x_power_off_apv(struct iris_core *core)
disable_clocks_and_power:
iris_disable_unprepare_clock(core, IRIS_APV_HW_CLK);
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_APV_HW_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_APV_HW_POWER_DOMAIN);
}
static void iris_vpu4x_ahb_sync_reset_apv(struct iris_core *core)
@@ -227,21 +220,18 @@ static int iris_vpu4x_power_on_hardware(struct iris_core *core)
u32 efuse_value = readl(core->reg_base + WRAPPER_EFUSE_MONITOR);
int ret;
- ret = iris_enable_power_domains(core,
- core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
if (ret)
return ret;
if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) {
- ret = iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs
- [IRIS_VPP0_HW_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_VPP0_HW_POWER_DOMAIN);
if (ret)
goto disable_hw_power_domain;
}
if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) {
- ret = iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs
- [IRIS_VPP1_HW_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_VPP1_HW_POWER_DOMAIN);
if (ret)
goto disable_vpp0_power_domain;
}
@@ -273,14 +263,12 @@ static int iris_vpu4x_power_on_hardware(struct iris_core *core)
iris_vpu4x_disable_hardware_clocks(core, efuse_value);
disable_vpp1_power_domain:
if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT))
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs
- [IRIS_VPP1_HW_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VPP1_HW_POWER_DOMAIN);
disable_vpp0_power_domain:
if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT))
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs
- [IRIS_VPP0_HW_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VPP0_HW_POWER_DOMAIN);
disable_hw_power_domain:
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
return ret;
}
@@ -351,14 +339,12 @@ static void iris_vpu4x_power_off_hardware(struct iris_core *core)
iris_vpu4x_disable_hardware_clocks(core, efuse_value);
if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT))
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs
- [IRIS_VPP1_HW_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VPP1_HW_POWER_DOMAIN);
if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT))
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs
- [IRIS_VPP0_HW_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VPP0_HW_POWER_DOMAIN);
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
}
const struct vpu_ops iris_vpu4x_ops = {
diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/media/platform/qcom/iris/iris_vpu_common.c
index 006fd3ffc752..74b4dccd6a66 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu_common.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c
@@ -214,15 +214,15 @@ int iris_vpu_power_off_controller(struct iris_core *core)
iris_disable_unprepare_clock(core, IRIS_AHB_CLK);
iris_disable_unprepare_clock(core, IRIS_CTRL_CLK);
iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK);
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN);
return 0;
}
void iris_vpu_power_off_hw(struct iris_core *core)
{
- dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN], false);
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, false);
+ iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
iris_disable_unprepare_clock(core, IRIS_VCODEC_AHB_CLK);
iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK);
}
@@ -243,7 +243,7 @@ int iris_vpu_power_on_controller(struct iris_core *core)
u32 rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size;
int ret;
- ret = iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_CTRL_POWER_DOMAIN);
if (ret)
return ret;
@@ -270,7 +270,7 @@ int iris_vpu_power_on_controller(struct iris_core *core)
err_disable_axi_clock:
iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK);
err_disable_power:
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN);
return ret;
}
@@ -279,8 +279,7 @@ int iris_vpu_power_on_hw(struct iris_core *core)
{
int ret;
- ret = iris_enable_power_domains(core,
- core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
if (ret)
return ret;
@@ -292,7 +291,7 @@ int iris_vpu_power_on_hw(struct iris_core *core)
if (ret && ret != -ENOENT)
goto err_disable_hw_clock;
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN], true);
+ ret = iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, true);
if (ret)
goto err_disable_hw_ahb_clock;
@@ -303,7 +302,7 @@ int iris_vpu_power_on_hw(struct iris_core *core)
err_disable_hw_clock:
iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK);
err_disable_power:
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN);
return ret;
}
@@ -365,7 +364,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_core *core)
iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK);
iris_disable_unprepare_clock(core, IRIS_AXI_CTRL_CLK);
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN);
reset_control_bulk_reset(clk_rst_tbl_size, core->resets);
@@ -376,7 +375,7 @@ int iris_vpu35_vpu4x_power_on_controller(struct iris_core *core)
{
int ret;
- ret = iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]);
+ ret = iris_enable_power_domains(core, IRIS_CTRL_POWER_DOMAIN);
if (ret)
return ret;
@@ -399,7 +398,7 @@ int iris_vpu35_vpu4x_power_on_controller(struct iris_core *core)
err_disable_axi1_clk:
iris_disable_unprepare_clock(core, IRIS_AXI_CTRL_CLK);
err_disable_power:
- iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]);
+ iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN);
return ret;
}
--
2.34.1
next prev parent reply other threads:[~2026-04-23 13:31 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 13:29 [PATCH v2 00/13] media: iris: Add support for glymur platform Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 01/13] media: iris: Fix VM count passed to firmware Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 02/13] drivers: base: Add generic dma context bus Vishnu Reddy
2026-04-23 13:37 ` Greg Kroah-Hartman
2026-04-24 10:31 ` Vishnu Reddy
2026-04-24 11:13 ` Greg Kroah-Hartman
2026-04-24 11:45 ` Vishnu Reddy
2026-04-24 11:55 ` Greg Kroah-Hartman
2026-04-24 12:42 ` Vishnu Reddy
2026-04-24 13:34 ` Greg Kroah-Hartman
2026-04-24 16:11 ` Dmitry Baryshkov
2026-04-25 5:42 ` Greg Kroah-Hartman
2026-04-25 10:35 ` Dmitry Baryshkov
2026-04-24 16:40 ` Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 03/13] gpu: host1x: Migrate to " Vishnu Reddy
2026-04-23 13:40 ` Greg Kroah-Hartman
2026-04-23 13:29 ` [PATCH v2 04/13] dt-bindings: media: qcom,glymur-iris: Add glymur video codec Vishnu Reddy
2026-04-24 17:09 ` Krzysztof Kozlowski
2026-04-25 9:56 ` Vishnu Reddy
2026-04-25 10:40 ` Krzysztof Kozlowski
2026-04-25 16:23 ` Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 05/13] media: iris: Add context bank hooks for platform specific initialization Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 06/13] media: iris: Enable Secure PAS support with IOMMU managed by Linux Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 07/13] media: iris: Rename clock and power domain macros to use vcodec prefix Vishnu Reddy
2026-04-23 13:29 ` Vishnu Reddy [this message]
2026-04-23 13:29 ` [PATCH v2 09/13] media: iris: Add power sequence for Glymur Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 10/13] media: iris: Add support to select core for dual core platforms Vishnu Reddy
2026-04-23 13:29 ` [PATCH v2 11/13] media: iris: Select DMA_CONTEXT_BUS to create firmware device Vishnu Reddy
2026-04-23 13:38 ` Greg Kroah-Hartman
2026-04-26 12:16 ` Dmitry Baryshkov
2026-04-23 13:29 ` [PATCH v2 12/13] media: iris: Add platform data for glymur Vishnu Reddy
2026-04-26 12:24 ` Dmitry Baryshkov
2026-04-23 13:29 ` [PATCH v2 13/13] arm64: dts: qcom: glymur: Add iris video node Vishnu Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260423-glymur-v2-8-0296bccb9f4e@oss.qualcomm.com \
--to=busanna.reddy@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=bod@kernel.org \
--cc=conor+dt@kernel.org \
--cc=dakr@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mperttunen@nvidia.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=simona@ffwll.ch \
--cc=stefan.schmidt@linaro.org \
--cc=thierry.reding@kernel.org \
--cc=vikash.garodia@oss.qualcomm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox