Message ID | 20231018130942.31187-6-ansuelsmth@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4779537vqb; Wed, 18 Oct 2023 06:11:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGb6OVZW343A5SHGpJ3iZnoRWfZqLa58Lq+qnVg8N5RQT6PSC3qtcVnGaxNsAa9rl5gWUaw X-Received: by 2002:a05:6359:288d:b0:166:d9dc:5f5f with SMTP id qa13-20020a056359288d00b00166d9dc5f5fmr4426475rwb.3.1697634693164; Wed, 18 Oct 2023 06:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697634693; cv=none; d=google.com; s=arc-20160816; b=jTxenJochYY4SppXpgY8QYCQBNQy8yyzYG8XJL/q1g2nAIoaScVKjlz0g1pcZTM12O sL46wVLnOzF71QrUCTDm8y1lJHEi3BpbBqo8n+lKr/2jQS8JNHjyXVsyEZafZRW/tAdM etkEEmvMZh4zrnbKyHMReIbAfCLlcwGiT4kY42nc4dB75+LZXZlx8t1sfGxLksl3RDqR o7LZOEtSQGyXqV3EdmAdrJDVhGc9XvqKIQyfYHKU8BOrtH8bLumdGG6xElKb35jJ0k// 3o90sVUoEIjqNY1U6wCFcs77ej/neRVmdCnVv6ZRI59QtxiaRXnGR+PfNE1LjVAPXZrW HlPw== 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=DGsOIe2+gPILwGffb1seZvDCNStpRAryY2lIF4RhpfU=; fh=wUxsfnWOAqY0bhDc0RLOk0fDRLF7+tX65/A8fqnljbM=; b=pEMWj2DT7sOhT7gsRstx0g2q3krYxi1bI1C/6syOT1feI2ifQfxbec1XhiXZSr1/66 shmA+KndBy1bIJdIUXDL1oEbDYWCJl/l4RbAF2+X6d0UmKIy02X59RMG9MwgaY9A4Eft Ue2G9zfYcsprzYH83MoLqhnL9X/hrW/BGbGxr1Yc3up7/Yu63CZkkRREOm6W1ZrawbO1 A36dnhmvA+LGEtFdCw8oTiDYywSW9jk66B0h8yg7XRiYmyjTPXXriR8yeHLmIq0agpvm rfs0VVtRlaCy7cL4kY5RSGQzZekfrHeiBcmHFLye0MHPRrx9XG/PO9F1mAkJhQjGb8Nd xXVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P12hSEyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id p30-20020a63741e000000b005b804d972a2si2100891pgc.490.2023.10.18.06.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 06:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P12hSEyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CB203807601B; Wed, 18 Oct 2023 06:11:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231652AbjJRNLR (ORCPT <rfc822;zwp10758@gmail.com> + 23 others); Wed, 18 Oct 2023 09:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231486AbjJRNKw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Oct 2023 09:10:52 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8EE121; Wed, 18 Oct 2023 06:10:49 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40839807e82so6244565e9.0; Wed, 18 Oct 2023 06:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697634648; x=1698239448; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DGsOIe2+gPILwGffb1seZvDCNStpRAryY2lIF4RhpfU=; b=P12hSEyKzWUjCTpsnuYPfSMIaiBzDveTQlI055qzkKokR+prIbcWABw5lld2BLtmYy /kVZp0DgfFhhd214UHSlmGZNX4ivk/s+ffwZHekKmOWU2BKVNwJrMXQ40ffvFBDKjiQs NJ1qkLjBjqGqqIFjJ1Webo6CBlu045v3pdaiCR4dlVui2lelATmhifQ+utdQqyHy+ejz YzSDFoWlS+k2RsLVy3bh1tgrDfhtsp8TSb3j6Nf0pERG23cQtRlWmKAB5kjT6tt4cpSO uNiUoF+ebxRrUM1pLXtarSH932O1QdGMVMPte2nhgPnNoFVAcADlqqocaCld75EHJyCw WNBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697634648; x=1698239448; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DGsOIe2+gPILwGffb1seZvDCNStpRAryY2lIF4RhpfU=; b=KRFMWbPJxSlSsF+TSd63B+S2KRzdHQUpC64+Ja1oUMFSc94wJ22kgMIx5tnUwDI4h6 pdalNdH/DVlzUityngV+8B5NitbA9RLdq5gtC0tGJaff28H+m3rqqtrOdyCo1RTtODSN IMJdSkX1vS1iMtLKH+RPXwcjoQMudw4IaaGe/VNMJsw+CdrndZWjg+WQGC2jZ8mYca6r aCzLZ4uXSeyBI7jhguOQK+8YLK0IUI6kiCkpC7tDlZj+4VGqk/rZc1RuVpeYxZra6MUB OOGpCN+s36dA1cxNOr5NpdNoarrxmMElAq5kn3wrUt78lozN/4GkcQxNsKqr7XaTramJ psww== X-Gm-Message-State: AOJu0YwI/PTeTHzcTqqE9hGe8zyA9a1Z09e/m3kZ7iujg3uGH6LoyHY6 xSTR2A4E/RnodGv4c3M5RI4= X-Received: by 2002:a05:600c:4ecb:b0:3fe:1fd9:bedf with SMTP id g11-20020a05600c4ecb00b003fe1fd9bedfmr4798254wmq.11.1697634647542; Wed, 18 Oct 2023 06:10:47 -0700 (PDT) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id u6-20020a05600c138600b004064288597bsm1677426wmf.30.2023.10.18.06.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 06:10:47 -0700 (PDT) From: Christian Marangi <ansuelsmth@gmail.com> To: Felix Fietkau <nbd@nbd.name>, Lorenzo Bianconi <lorenzo@kernel.org>, Ryder Lee <ryder.lee@mediatek.com>, Shayne Chen <shayne.chen@mediatek.com>, Sean Wang <sean.wang@mediatek.com>, Kalle Valo <kvalo@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Christian Marangi <ansuelsmth@gmail.com>, Alexander Couzens <lynxis@fe80.eu>, Nicolas Cavallari <nicolas.cavallari@green-communications.fr>, Daniel Golle <daniel@makrotopia.org>, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Shiji Yang <yangshiji66@outlook.com> Subject: [PATCH v2 6/6] wifi: mt76: permit to load precal from NVMEM cell for mt7915 Date: Wed, 18 Oct 2023 15:09:42 +0200 Message-Id: <20231018130942.31187-6-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231018130942.31187-1-ansuelsmth@gmail.com> References: <20231018130942.31187-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 18 Oct 2023 06:11:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780098996436870523 X-GMAIL-MSGID: 1780098996436870523 |
Series |
[v2,1/6] wifi: mt76: fix broken precal loading from MTD for mt7915
|
|
Commit Message
Christian Marangi
Oct. 18, 2023, 1:09 p.m. UTC
Permit to load precal from NVMEM cell for mt7915. The NVMEM cell must be named "precal" to be correctly loaded. NVMEM cell must already account the correct offset and be placed after the EEPROM as the function expect the data right from the start. Tested-by: Shiji Yang <yangshiji66@outlook.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> --- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c index 5228f710b3da..3bb2643d1b26 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c @@ -11,6 +11,7 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev) u8 *eeprom = mdev->eeprom.data; u32 val = eeprom[MT_EE_DO_PRE_CAL]; u32 offs; + int ret; if (!dev->flash_mode) return 0; @@ -25,7 +26,11 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev) offs = is_mt7915(&dev->mt76) ? MT_EE_PRECAL : MT_EE_PRECAL_V2; - return mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val); + ret = mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val); + if (!ret) + return ret; + + return mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal", val); } static int mt7915_check_eeprom(struct mt7915_dev *dev)