aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanimir Varbanov <stanimir.varbanov@linaro.org>2021-01-26 10:42:52 +0200
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2021-03-10 16:25:37 +0000
commit0d0f76097b1d280ba0a722e3fa615f09be3884a6 (patch)
treeccb4cfdbf7b8a9a003c274cc75d7825146aa9533
parented53fb2c1b2e10ff2e40b43524f3d0e3ad6b6c27 (diff)
On production devices the firmware could be located on different places, this path could be provided by special firmware-name DT property. Here we check for existence of such DT property and if it exist take the firmware path from there. Otherwise, if the property is missing we fallback to the predefined path from driver resource structure. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-By: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-rw-r--r--drivers/media/platform/qcom/venus/firmware.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index 89defc21ea81..2b1d95ecd381 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -187,6 +187,7 @@ int venus_boot(struct venus_core *core)
{
struct device *dev = core->dev;
const struct venus_resources *res = core->res;
+ const char *fwpath = NULL;
phys_addr_t mem_phys;
size_t mem_size;
int ret;
@@ -195,7 +196,12 @@ int venus_boot(struct venus_core *core)
(core->use_tz && !qcom_scm_is_available()))
return -EPROBE_DEFER;
- ret = venus_load_fw(core, core->res->fwname, &mem_phys, &mem_size);
+ ret = of_property_read_string_index(dev->of_node, "firmware-name", 0,
+ &fwpath);
+ if (ret)
+ fwpath = core->res->fwname;
+
+ ret = venus_load_fw(core, fwpath, &mem_phys, &mem_size);
if (ret) {
dev_err(dev, "fail to load video firmware\n");
return -EINVAL;