Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1684360pxj; Wed, 19 May 2021 11:24:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq4GUvaha4IUMy5BZksD9JjcgIa3Xef3yJs9B39Zx78LSwFeGxQHhO/3Ui0HWiRrdWidhR X-Received: by 2002:aa7:dc12:: with SMTP id b18mr425957edu.52.1621448693131; Wed, 19 May 2021 11:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621448693; cv=none; d=google.com; s=arc-20160816; b=hBHEoWks5baJGXryPd7ruju3a0sPT59a2TuzgxV49cC6a/sgZdTLU4yBik2Tbc++vH RmK9OlAZVy2Gl4hNYPnqc48Bnri0EsrQs0aU+FyV5cZjsttuQrWt5Kn3Tp3QHMrxbC9x D0Xfyaup/fbrnMHtgsuUiujpoYSLt1rChDoAWhb58OAIWfKtHsmREhrQfdg+pLBAvpW+ nwnXADA2oWO76ffsFVvbv69rbuBCiS3Ct+yP2zfBCuAmBUiZ04W9rJeBFYgbuU0iNXkg 1ZqqjcXJplB7aR/OUsY93TnTqg47KuWuP95NOo+ZQ/kmHPbvbtALoWGuiWSfnjw47am6 NnXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=QG6yYsg8OINjYqO6wbOaVsf5Q4Ip6CWGl3bfE4JccGw=; b=MBBByJnkBm+sixH2xjk4qYuuUJpNsGCpHpRCyD7aHbet3No/qdMHUFH24UVfZ/ZvtG KFRB+FYRuqZnVRcwpT+XqG73CuBkvfpeuE36il7zRnx1jwJVSPbUblOlVJ9B22ofdPJE yWM2sft3sJVONHTVMLmkCSVbl7GfdoSAGU7zYJMdBwX0s3HDDZV8SwxHzhJnOPH0obTn 8VI5pDdsQPsUe3h7tFNxTsBFkB4cjqW/J9FeoHU3oo2Xt8+4KHK+DmI89+Qar+j72KFi gGj5pO0atemIfZMDvhcgvOq2OhE31DroUx0ecslNYXHsunkf0+Qqlp6Fb0FhA0xwKsYQ G0qQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp6si384530ejc.243.2021.05.19.11.24.29; Wed, 19 May 2021 11:24:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350894AbhERQhI (ORCPT + 99 others); Tue, 18 May 2021 12:37:08 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:37168 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350835AbhERQgq (ORCPT ); Tue, 18 May 2021 12:36:46 -0400 Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 18 May 2021 09:35:28 -0700 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 18 May 2021 09:35:26 -0700 X-QCInternal: smtphost Received: from gubbaven-linux.qualcomm.com ([10.206.64.32]) by ironmsg02-blr.qualcomm.com with ESMTP; 18 May 2021 22:04:49 +0530 Received: by gubbaven-linux.qualcomm.com (Postfix, from userid 2365015) id 8108D22176; Tue, 18 May 2021 22:04:48 +0530 (IST) From: Venkata Lakshmi Narayana Gubba To: marcel@holtmann.org, johan.hedberg@gmail.com, devicetree@vger.kernel.org Cc: mka@chromium.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org, bgodavar@codeaurora.org, rjliao@codeaurora.org, hbandi@codeaurora.org, abhishekpandit@chromium.org, Venkata Lakshmi Narayana Gubba Subject: [PATCH v4 3/5] Bluetooth: btqca: Moved extracting rom version info to common place Date: Tue, 18 May 2021 22:04:44 +0530 Message-Id: <1621355686-29550-4-git-send-email-gubbaven@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621355686-29550-1-git-send-email-gubbaven@codeaurora.org> References: <1621355686-29550-1-git-send-email-gubbaven@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Moved extracting rom version info to common place as this code is common in all if else ladder in qca_uart_setup. Signed-off-by: Venkata Lakshmi Narayana Gubba --- drivers/bluetooth/btqca.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index 3210283..be04d74 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -546,24 +546,20 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, config.user_baud_rate = baudrate; + /* Firmware files to download are based on ROM version. + * ROM version is derived from last two bytes of soc_ver. + */ + rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | (soc_ver & 0x0000000f); + /* Download rampatch file */ config.type = TLV_TYPE_PATCH; if (qca_is_wcn399x(soc_type)) { - /* Firmware files to download are based on ROM version. - * ROM version is derived from last two bytes of soc_ver. - */ - rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | - (soc_ver & 0x0000000f); snprintf(config.fwname, sizeof(config.fwname), "qca/crbtfw%02x.tlv", rom_ver); } else if (soc_type == QCA_QCA6390) { - rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | - (soc_ver & 0x0000000f); snprintf(config.fwname, sizeof(config.fwname), "qca/htbtfw%02x.tlv", rom_ver); } else if (soc_type == QCA_WCN6750) { - rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | - (soc_ver & 0x0000000f); /* Choose mbn file by default.If mbn file is not found * then choose tlv file */ -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation