From patchwork Thu Jun 15 16:31:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 105669 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp888319qgd; Thu, 15 Jun 2017 09:33:32 -0700 (PDT) X-Received: by 10.84.210.105 with SMTP id z96mr7156280plh.219.1497544412339; Thu, 15 Jun 2017 09:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497544412; cv=none; d=google.com; s=arc-20160816; b=Z14WAb2nusH3zwPS9LcxM+dgVy42t7S5M6aCMQbgfFhCq+D38jo5bZQG/uxCxKtndI Z9gjBOPy00x31z9YidLgu9632c+Eqhd5+H9XmRHc96ZISirYQ9kDyMC0+TAzPBEBdey0 GUDBSQKELjMg1slSVHkDO1WB2rrfOf0dsxzsjc2plSA3KimzOF4HEz4/eMwvuMU5egjL BW2G2R+KUIUhaSzU0NUbQdvfrZAGhinFAuBNZho41JDj9H9VDrlumFpUHDDY/MxkUbal Cob1Clq8KaeYp2rsL+zGzUjn3kjSLhcBm2YeKLfQAumaTeBWYwJBNXtEwYYMe4rrmSTW 4tFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=umPh9HDesYKRHBpMw8ASBx6hGWhiuypqV/sX9z1+gxw=; b=s9EyiKI+GvevQVycyQkbA+hBU+42XlZ4yTGWiG7vkch4OOYeUpzWouwTS0fvLpMyrL 7pN/AYGO1qIgD2I+/OewCU+OWXVMywyAlaM6SKY0GUp18lamahNbE+/JHROZ6g+MIqqL vJyDUD467+BRh5FMCr5hYjvCsdKRFgmyahHHhCfGHqiPGMxhprZJAWIM0ygJVwXRQjJV QOL09YhlkS9XkzP+aaw36+JQR2icyyadAi4APEEyxWdjylGljcn1gmWDsxcygzTWqVQ3 4qztXm46TccE9TZoPn3ownvi2dIZMZQx49e9+FMGx5TXk0B1A4WEwamY2VXs0Zr/C/SK w0rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Ef3+A7Re; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id p5si397449pfl.413.2017.06.15.09.33.32; Thu, 15 Jun 2017 09:33:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=Ef3+A7Re; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752687AbdFOQda (ORCPT + 25 others); Thu, 15 Jun 2017 12:33:30 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:35153 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbdFOQdX (ORCPT ); Thu, 15 Jun 2017 12:33:23 -0400 Received: by mail-wr0-f172.google.com with SMTP id q97so25311747wrb.2 for ; Thu, 15 Jun 2017 09:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=umPh9HDesYKRHBpMw8ASBx6hGWhiuypqV/sX9z1+gxw=; b=Ef3+A7ReoBi/6DtO+CHSrx0WotcdKCsEegFxNqnhJ7qCjN2E1hfY+U5em5OjbhwsFF p816OMjkj8OqqyDwzZIpnGY0Cydwu+Yxql1Bx7L+W+NcL3RVLEhR9dt8HOYYPwOyH7bM ZrgdRGpojtAFyZ50qkgOQPs67JePslb9LbYVE= 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:in-reply-to :references; bh=umPh9HDesYKRHBpMw8ASBx6hGWhiuypqV/sX9z1+gxw=; b=M5r4IdcModViJ1MUILLzK4ZLdVKx5GDWYkL84M1n+6PObza6cMrbTcITkXGPDHkM5A 0vB+//A0E/Yb8EWxyrpzTUGkhxZD1XKDxQ0uE5bP2X/XmItRkQ00Wmf5CM93a9MBiB36 ncJvVYmvmzs348W1B7k8YnPtzfJUvYAVPr5yqnln+EekyN4NzQlH+xKOgHTCNPt5TxDb nmoziPm0rPpvh/iAY+ANBDrrcVdw7cqqwQjT03w5yZ5vaEvklUUYNtFqGv7OMtAIQ6lS VV4Iv5CDT4e9UIGO0YICAJ7IQO5YGR0HIsFIKUrg9koQ1iTHC+hAbBlzcdWmYPzZH9+X RufA== X-Gm-Message-State: AKS2vOxOTRcEi1+kDwOHZSu2VAEbj2EqgG0MUE1WMMZVkUZMTQvLI5tJ bNvSPA8pFo4cK2uYTv2KDw== X-Received: by 10.223.133.240 with SMTP id 45mr4391057wru.51.1497544401553; Thu, 15 Jun 2017 09:33:21 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id m73sm541890wmi.25.2017.06.15.09.33.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:21 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH v11 18/19] media: venus: update firmware path with linux-firmware place Date: Thu, 15 Jun 2017 19:31:59 +0300 Message-Id: <1497544320-2269-19-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes firmware name and path part of venus_resources structure and initialize it properly depending on the SoC and firmware version. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.c | 6 ++++-- drivers/media/platform/qcom/venus/core.h | 1 + drivers/media/platform/qcom/venus/firmware.c | 9 ++++----- drivers/media/platform/qcom/venus/firmware.h | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 48391d87d5c3..776d2bae6979 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -84,7 +84,7 @@ static void venus_sys_error_handler(struct work_struct *work) pm_runtime_get_sync(core->dev); - ret |= venus_boot(core->dev, &core->dev_fw); + ret |= venus_boot(core->dev, &core->dev_fw, core->res->fwname); ret |= hfi_core_resume(core, true); @@ -207,7 +207,7 @@ static int venus_probe(struct platform_device *pdev) if (ret < 0) goto err_runtime_disable; - ret = venus_boot(dev, &core->dev_fw); + ret = venus_boot(dev, &core->dev_fw, core->res->fwname); if (ret) goto err_runtime_disable; @@ -335,6 +335,7 @@ static const struct venus_resources msm8916_res = { .vmem_size = 0, .vmem_addr = 0, .dma_mask = 0xddc00000 - 1, + .fwname = "qcom/venus-1.8/venus.mdt", }; static const struct freq_tbl msm8996_freq_table[] = { @@ -363,6 +364,7 @@ static const struct venus_resources msm8996_res = { .vmem_size = 0, .vmem_addr = 0, .dma_mask = 0xddc00000 - 1, + .fwname = "qcom/venus-4.2/venus.mdt", }; static const struct of_device_id venus_dt_match[] = { diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 2f8492090224..e542700eee32 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -48,6 +48,7 @@ struct venus_resources { unsigned int vmem_id; u32 vmem_size; u32 vmem_addr; + const char *fwname; }; struct venus_format { diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 365e64010920..1b1a4f355918 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -23,7 +23,6 @@ #include "firmware.h" -#define VENUS_FIRMWARE_NAME "venus.mdt" #define VENUS_PAS_ID 9 #define VENUS_FW_MEM_SIZE SZ_8M @@ -32,7 +31,7 @@ static void device_release_dummy(struct device *dev) of_reserved_mem_device_release(dev); } -int venus_boot(struct device *parent, struct device *fw_dev) +int venus_boot(struct device *parent, struct device *fw_dev, const char *fwname) { const struct firmware *mdt; phys_addr_t mem_phys; @@ -67,7 +66,7 @@ int venus_boot(struct device *parent, struct device *fw_dev) goto err_unreg_device; } - ret = request_firmware(&mdt, VENUS_FIRMWARE_NAME, fw_dev); + ret = request_firmware(&mdt, fwname, fw_dev); if (ret < 0) goto err_unreg_device; @@ -78,8 +77,8 @@ int venus_boot(struct device *parent, struct device *fw_dev) goto err_unreg_device; } - ret = qcom_mdt_load(fw_dev, mdt, VENUS_FIRMWARE_NAME, VENUS_PAS_ID, - mem_va, mem_phys, mem_size); + ret = qcom_mdt_load(fw_dev, mdt, fwname, VENUS_PAS_ID, mem_va, mem_phys, + mem_size); release_firmware(mdt); diff --git a/drivers/media/platform/qcom/venus/firmware.h b/drivers/media/platform/qcom/venus/firmware.h index 782e64ae291a..f81a98979798 100644 --- a/drivers/media/platform/qcom/venus/firmware.h +++ b/drivers/media/platform/qcom/venus/firmware.h @@ -16,7 +16,8 @@ struct device; -int venus_boot(struct device *parent, struct device *fw_dev); +int venus_boot(struct device *parent, struct device *fw_dev, + const char *fwname); int venus_shutdown(struct device *fw_dev); #endif