video: driver: check for regulator support before initializing

Upstream doesn't support regulators, while downstream kernel does.
So add a condition to check for regulator support before init.

Change-Id: Icab8aec20796546a33ac571963f871d146970002
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
This commit is contained in:
Dikshita Agarwal
2022-11-04 11:50:55 +05:30
parent 166330d8a9
commit 1ac85a3237
2 changed files with 11 additions and 0 deletions

View File

@@ -229,6 +229,11 @@ static inline bool is_mmrm_supported(struct msm_vidc_core *core)
return !!core->platform->data.supports_mmrm;
}
static inline bool is_regulator_supported(struct msm_vidc_core *core)
{
return !!core->platform->data.regulator_tbl_size;
}
int msm_vidc_init_platform(struct platform_device *pdev);
int msm_vidc_deinit_platform(struct platform_device *pdev);

View File

@@ -234,6 +234,12 @@ static int __init_regulators(struct msm_vidc_core *core)
}
regulators = &core->resource->regulator_set;
/* skip init if regulators not supported */
if (!is_regulator_supported(core)) {
d_vpr_h("%s: regulators are not available in database\n", __func__);
return 0;
}
regulator_tbl = core->platform->data.regulator_tbl;
regulator_count = core->platform->data.regulator_tbl_size;