From patchwork Fri Mar 12 00:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 398479 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp765161jai; Thu, 11 Mar 2021 16:33:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQ50d03sz9yoD6WCISxkoBj9EbYaXEF4QbG4VLbHTwEVE2BkMDWX4FQUR175c+ejCyavcR X-Received: by 2002:a05:6402:5203:: with SMTP id s3mr11379818edd.79.1615509192770; Thu, 11 Mar 2021 16:33:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615509192; cv=none; d=google.com; s=arc-20160816; b=c3i9XIeSSpr4QUXoE4d7IN3OapDuTFK+0iBOAZI+dN0oGnS19aMowIESAevkpGBnzB b0X64NnhzVAv6sG//mibxhrIImOpjwvnPypUFpZu9KVccG1s874ZvWH7to+6PbBwBCWB ncwjSIGDxxgOqy1RTf7zhAnvu57YzZKaaFf1qA+BTZc7UHLgfbiifHBIPXfkWctJZ1mu K4meQOPzZ5hEJTMnvdvyigAZhTlhfK/swEeuSX4W/06Se+BZHca7hLsoUI6MklwUTvfk CbFwyubuHCz7aggV4g6NJryYkysGMlJvkOX9D41fcE2Vn6ej+Vvfw6SDHWD8l/UiqMCo w9Ng== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6wVekdiQ/YA8nS7fIn/RALJfKdTTK3aVMvAOi2iip9U=; b=oPKNQjluNnk5lx2iMSGPLv4wR/H8PyrNgWaSUooRapKjqdH8x9ROIw2fX5nC0XXIYB VelsyZdY1Hjm5oKcuKdeW29Hzx1h2IS+QnScqFSljTKKQSCFMOr5R9TW22Nwf/aat5je k96q5N11mBNLgcHo5d34IDNh9o8imeC/M1uOt0Po2yVw9IkiFlNu7FKF1lEmngA5ZNHE OC/ewhDwLS+E1sozGpa99TkNzplIL7wI+wWTQkMgOJqLXEJmu9o49SuWUGtSiLZUjMNm sT0r/w9sV5WslUiu3iBXF2Ku+5E5u7QHN0c35+hStdBbD0oVbfxggc3q5JnRsHtSVsnd mlPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pQemKSOE; 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 r21si2991882edy.321.2021.03.11.16.33.12; Thu, 11 Mar 2021 16:33:12 -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=pQemKSOE; 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 S231360AbhCLAch (ORCPT + 6 others); Thu, 11 Mar 2021 19:32:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231364AbhCLAcT (ORCPT ); Thu, 11 Mar 2021 19:32:19 -0500 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D6E8C061574 for ; Thu, 11 Mar 2021 16:32:19 -0800 (PST) Received: by mail-oo1-xc35.google.com with SMTP id j10-20020a4ad18a0000b02901b677a0ba98so1131732oor.1 for ; Thu, 11 Mar 2021 16:32:19 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=6wVekdiQ/YA8nS7fIn/RALJfKdTTK3aVMvAOi2iip9U=; b=pQemKSOE2hWkcq5S0NsPmn6nU08qCVCXLnEJAtAtWJVAePAKnrQyWP9/amyIGzQ+Fc lQrm5qOh0SQC/I5AgFw6fS36FUwIevc62X/V6SMIkPC+yX8PdjEvIhTyA+u3WFppiYNq pUl56X1em620q7eaTmMrb1TC9swVGLqukK04XKHGrGzJbRCUm7jV+NfbuaZHHQrMscXQ VD7Fi9B+lDo+N3rsPL47gWwqqKN/ihGkrR4Zv0/UuYGXzTi3ayyKWM1naKrt0eu5y277 iueFGHixkgH+lEJE2c8FEvt3AecU8dGDBAkviowSiVbkzJ0byYMR6keTva6DmHkbnEgU pKcA== 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:mime-version:content-transfer-encoding; bh=6wVekdiQ/YA8nS7fIn/RALJfKdTTK3aVMvAOi2iip9U=; b=BL2i4uyVznvr1z2zGY2XcD1/vTIqay/JqXnlxDVDQT8Yiu1Rzopub48oXNYwGPErwc KLa9nfqmTUyXQGjPwk1/pFQap40rnmtxQLsaXoAaYYyhXiQxXRrcslnz/1/yY8fw4X4C BU2OyV97vHtwCcKCtoRqTFz9odROa+WodaAUblWYjaL8dJM4jgSCfrYh9hnzDWIZVEDi pkUlfO5MLNQPrV1D/TsNIX0He0wZzfVxOcHvCMRL1UQpCmgfs+O/0LfjO7QBktLxOK5G maNWJljKpx7D4LNWDXzr6q6HAhHZnFIEFPfFmGvnSAjzP4UOa/FssPnl+clCSOTk6RqR 3Vkw== X-Gm-Message-State: AOAM532L1AtQU8/PpevY+L4tRc8buMetnjxP/KR1JifTxiiJbB4Qimef UMZD6Z3DfKKQ9qdPhUwIqUs8YA== X-Received: by 2002:a4a:96b3:: with SMTP id s48mr1254406ooi.11.1615509138437; Thu, 11 Mar 2021 16:32:18 -0800 (PST) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id l190sm670835oig.39.2021.03.11.16.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 16:32:18 -0800 (PST) From: Bjorn Andersson To: Andy Gross , Bjorn Andersson , Rob Herring , Bryan O'Donoghue Cc: Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 4/5] soc: qcom: wcnss_ctrl: Allow reading firmware-name from DT Date: Thu, 11 Mar 2021 16:33:17 -0800 Message-Id: <20210312003318.3273536-5-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312003318.3273536-1-bjorn.andersson@linaro.org> References: <20210312003318.3273536-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The WLAN NV firmware blob differs between platforms, and possibly devices, so add support in the wcnss_ctrl driver for reading the path of this file from DT in order to allow these files to live in a generic file system (or linux-firmware). The new property is optional and the code falls back to the old filename if the property isn't specified. Signed-off-by: Bjorn Andersson --- drivers/soc/qcom/wcnss_ctrl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.29.2 Tested-by: Bryan O'Donoghue diff --git a/drivers/soc/qcom/wcnss_ctrl.c b/drivers/soc/qcom/wcnss_ctrl.c index 358526b9de06..2a06d631e415 100644 --- a/drivers/soc/qcom/wcnss_ctrl.c +++ b/drivers/soc/qcom/wcnss_ctrl.c @@ -200,6 +200,7 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc) struct wcnss_download_nv_req *req; const struct firmware *fw; struct device *dev = wcnss->dev; + const char *nvbin = NVBIN_FILE; const void *data; ssize_t left; int ret; @@ -208,10 +209,13 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc) if (!req) return -ENOMEM; - ret = request_firmware(&fw, NVBIN_FILE, dev); + ret = of_property_read_string(dev->of_node, "firmware-name", &nvbin); + if (ret < 0 && ret != -EINVAL) + goto free_req; + + ret = request_firmware(&fw, nvbin, dev); if (ret < 0) { - dev_err(dev, "Failed to load nv file %s: %d\n", - NVBIN_FILE, ret); + dev_err(dev, "Failed to load nv file %s: %d\n", nvbin, ret); goto free_req; }