From patchwork Tue Jan 26 08:42:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 370640 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp5161893jam; Tue, 26 Jan 2021 09:09:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz60frmo3uks98HhoK9VUiAH7qNG7nLkyAgtHlkuW1cuGbKmd/+hW0GE30hQr45ZwU+5KmK X-Received: by 2002:a17:906:af89:: with SMTP id mj9mr3939933ejb.528.1611680963537; Tue, 26 Jan 2021 09:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611680963; cv=none; d=google.com; s=arc-20160816; b=F3u7M5dpBYqZmhAvDi/+d2ifqZDEhXMIgiiv+lUknTjayJmIoLp9Q3MQ4Dg/9NgEwD x4j6Sw5YzgruSOwZSeYsaHV+uzm4mR+1X52RS2IImXiEZXSKYg0i2iUSxn4UCwF0VgMw YclFqH6ieN6PAz3pVodjvMX/SRi2RgSvnbyI8P6Br+B3YzBIYJwho2L1eBU5EbfpeYEW JSafznN3EeP+eth49Rh18USUhf8Dghy8Ev5GbeAS5i2kzD4IZQz//ngUL32Oba1ZgZkN ToIwscbcMhEknPLk13lWMb8OHlur/uORumNNsm7EQhZw05WbxLkGyUhT0sg+eAt4vxpd 00Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=t2z1NGbSv+92Iq3y3cHfX8r3rHSgzWMGOLngnUuImF8=; b=Kp2X4kQjUss8AZOoKz7qcbWuzCaYAAsKxC8CtBoW3J6qaGAi8S1x65Szv087Kyjgs/ Eo29s/RVDUuEqfCPTl3OjEXM2zVYzVrxSzjQvEglvBo5DClqEhDVDXNc1XyLeO02sOQn dZp1leM2JOX5VLunu5XXP1KPyg2SHr06WWnQ0mJd/TJhSmzpGvq7uwsa7fdcdc30iTvT vdMJORKgFKFkC8izLOmbgGltw80+TMf8pM2ria5KcX2PW+p75Yuvg5hyvBcfcc/UQzoL 5Zh7YLCP+q492S/ID+gaghOzvZ5lgrswwuQKHeijuxpr8/NMs7YC1TptMriole/m+Whn Fxzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HqvMQYpb; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b20si7375598ejk.726.2021.01.26.09.09.23; Tue, 26 Jan 2021 09:09:23 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HqvMQYpb; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390238AbhAZRH5 (ORCPT + 6 others); Tue, 26 Jan 2021 12:07:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390407AbhAZInt (ORCPT ); Tue, 26 Jan 2021 03:43:49 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2E26C061756 for ; Tue, 26 Jan 2021 00:43:08 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id bx12so18722938edb.8 for ; Tue, 26 Jan 2021 00:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=t2z1NGbSv+92Iq3y3cHfX8r3rHSgzWMGOLngnUuImF8=; b=HqvMQYpbjsMs5FO0qw8p+bYpP7RjH7vBlf6l0HF5VNPGglgnOsbLVfBqJljbCsIasF NaYGE3B0ARKF9zXOk8iR5t9vxzgRRMOUE7jeQ4cqURu19xi64IpFfjsjuzIBdl51A+hC kmyXKCuwFkg/seQLV8IzyJL2tsx1vEJpZJMh5o2b5n2r1ko4f3p5zXbHSOPZiwd68r+Y EuLylY5VI4sLkTuc+4qAJhM/6vvPKW0T8NjQmIhBfqQ8EzuNyprvsXrov4AKw2qPm1ZO eWgrDM2jc3tKXYPKcV11SGdwMUuRoBXLTR/iSN8Xl6lBGJSYDPLMJUv6bQ+lcwKpb08+ VXEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=t2z1NGbSv+92Iq3y3cHfX8r3rHSgzWMGOLngnUuImF8=; b=j1+KFcaZ/BnK1iBFaaEr2rzw1E0bumarSTqQx2/ClKhm8Fhe1LAb2ZdpBZcQa99OHs 5qnK17nwlZAKF8NVivV/l0A3H9i0KNp8/+agiqWXasa1BoXnRdcz4/Lc7dsZVtuPu3dC Fc49QaTVTCTYHhlGEFjlV2NqXjUjny6zeOl2u0cqCPQbiHHSiSxgdHDaInHIXrXkrUOx Zp/4xd3iO4v6d7jgQrPKkmbGuR9K+jm2bBTmakBpRZqgI1I+b4UvG+4wZ78tN7XVGXam LXpX735E29dFEyZk/xHoWo7FtVgFoNqr+Lwwmw1+SNNh/BMhzWpCG/jRxkHXofHx9cHk FQLw== X-Gm-Message-State: AOAM530yhDee7/w7SnXgy4LSYj1Sxf4io/Jpotuy6LpSKYDnNfy64NwA /Rr8buGgGZkNK4SwIJMwexchzw== X-Received: by 2002:aa7:cc98:: with SMTP id p24mr3854242edt.126.1611650587275; Tue, 26 Jan 2021 00:43:07 -0800 (PST) Received: from localhost.localdomain (hst-221-9.medicom.bg. [84.238.221.9]) by smtp.gmail.com with ESMTPSA id i4sm9511524eje.90.2021.01.26.00.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 00:43:06 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Bjorn Andersson , Hans Verkuil , AngeloGioacchino Del Regno , Stanimir Varbanov Subject: [PATCH] venus: core: Parse firmware-name DT property Date: Tue, 26 Jan 2021 10:42:52 +0200 Message-Id: <20210126084252.238078-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- drivers/media/platform/qcom/venus/firmware.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index d03e2dd5808c..56c8fb5a019b 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;