Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3369550rdg; Tue, 17 Oct 2023 12:28:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+/9IUZigWg+kKwBzHUc1n7Rzc8xqo/btcTiyFMxTdPmxNYH0c3w00HHXCJhgXwrfLDfol X-Received: by 2002:a05:6a00:148e:b0:6b2:5b5:4f12 with SMTP id v14-20020a056a00148e00b006b205b54f12mr3345795pfu.14.1697570887288; Tue, 17 Oct 2023 12:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697570887; cv=none; d=google.com; s=arc-20160816; b=QNkHoXD1vPQRXCPAlKPKrqUb90kG7241TBT01u++IUjRcuXCyKDmQ0Bswx02s7+nTl fr0I4Yjwsly3MCp7yC7GfvP3bG+Gilc6ogLcfzlYQ1dmESrzkyA9stuxGY0VfEUYMnIq i4cf5epGi54XUPgslCRnDY1R1aczzj3uI4SzrS71/GDeSUtVqi2gSQE6Pm/0Py3CIhpZ 9foa9ETrOaGZcx1UjMxEQLt22z5FtW92MtVbOQEqKz9nH7VPpd4C/J9qptTwc3fUjibj wZoYR0mA/cGcVZUzxGqpGt0F1ksD201//7nW4cyTP4H9mXPWlsLHkQzqk4AsRZVpYRUg V4xg== 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:to:from :dkim-signature; bh=+0xHAajk9RnoZnMNxnlpPx/L53pYS94eDmnmY1A3Dok=; fh=RU/yUUaKKFh3rc/HtcjFaUjlbCuX5eKd8IdkxbaL3k4=; b=HSEoLO17P78tNRI/ArQVvLbkP/6Zyk6yA0w01NbPk3LqhGS6QiBN8KJPUgPcCDhVtW czxwNBNzY+4rlWLgPm6WETXbwyyWlBGEhWnr4XqJ4G1mBBzaWYB7rxvHRq3R4BLkmzSx kipytfRHbJneCu/6tw178sI0KKeWe6TdYHRy3ObAQ0O0tefN9I+uyWqmypa9JE0lVUYU FNIqu1uLuhu2XHXkRd9Z+CCEcj4jjiu+TDtJww26baWUN+vUt6iXljMJDxNBNzVWnLgR A7pOKPy6PkEu7KJXjApKRhryCorD6WGyqg/b8gF0uBz9lvCsnMKbEBhuEZ04M9owgo6A gh+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EN8fPfmv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id f3-20020a056a00228300b006be3a6e8bc6si2354944pfe.283.2023.10.17.12.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:28:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EN8fPfmv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-wireless-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 groat.vger.email (Postfix) with ESMTP id 8230580BB50A; Tue, 17 Oct 2023 12:28:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344191AbjJQT14 (ORCPT + 52 others); Tue, 17 Oct 2023 15:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344188AbjJQT1z (ORCPT ); Tue, 17 Oct 2023 15:27:55 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F20EDF1; Tue, 17 Oct 2023 12:27:52 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4064867903cso66256265e9.2; Tue, 17 Oct 2023 12:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697570871; x=1698175671; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+0xHAajk9RnoZnMNxnlpPx/L53pYS94eDmnmY1A3Dok=; b=EN8fPfmvI0AcO1iYEp9D1Ub6rqBvhphV9l8FPRNFmpLI2ThoNyERs9Q9lCSZZWp/kn lNHiDBIi4gXpAAYPd6byKm+Z8JGZy0o0XdixLDoVsbiHVDQEpjfVQ7qhgvG4UP3z8CUm 2I11cWNMhQ2idwDgQajJMFePOwDJcoKM3AdvXjrFM525SV65kIhEy/hkp7UwM7xP0E3I MS0znQjdwvRTXMHY3VYh1zX+NKmzZdz8YoCoVfP3mEhVN+spmfgJ6cvZwVW1DpZGrzDX ygVhOjV0MMgmvfp7pd22fVjkf5CpfY2gA+E4RUL3xGNTp6vbxZFOUzbjWnNoL3AyXdGM FV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697570871; x=1698175671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+0xHAajk9RnoZnMNxnlpPx/L53pYS94eDmnmY1A3Dok=; b=uw7jHx8MZ9eISXR2CrXRAyCJujJ+ODogRG2h3Ede7n4Sm9n8V/W9i4BwAxLW9utLcY /OIv/1sdTkb/h0M77dz+gsay3jmquA4z0flwZt2rXyax9IsSJF3oJ+e52XL8TALfjxuG 6iA6qoUM14hzeAA0gkgkizFTIM4soqAu1HgI8vCeHSdV6rb7dS92vD2lKrIatgiJRVeI x6Ojb9D6a7a5FS/mfx0GsPJpsonk3bspUtzNnU/sLooyBD+xNFZcMw3A8zLdSxGtq7XP wrFXXZoh+4ZqRo8shWWqsueBNocMVfXqmCkHxwhxNFhux2qN1FmH4E5DYAD4sKjjFwGD jitA== X-Gm-Message-State: AOJu0Yw/JobiCm61sNzw3VCQFBI/xOBwQB4gaht/5kItgttklhepQpI1 HfqcIfEXU0IVSghVyUM0mgM= X-Received: by 2002:a5d:5947:0:b0:32d:9e4f:7190 with SMTP id e7-20020a5d5947000000b0032d9e4f7190mr2723978wri.60.1697570871353; Tue, 17 Oct 2023 12:27:51 -0700 (PDT) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id o2-20020adfeac2000000b0032cc35c2ef7sm435897wrn.29.2023.10.17.12.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:27:51 -0700 (PDT) From: Christian Marangi To: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , Matthias Brugger , AngeloGioacchino Del Regno , Christian Marangi , Simon Horman , Alexander Couzens , Nicolas Cavallari , Daniel Golle , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [net-next RFC PATCH 3/6] wifi: mt76: limit support of precal loading for mt7915 to MTD only Date: Tue, 17 Oct 2023 21:05:07 +0200 Message-Id: <20231017190510.27163-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231017190510.27163-1-ansuelsmth@gmail.com> References: <20231017190510.27163-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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 17 Oct 2023 12:28:01 -0700 (PDT) Limit support for precal loading for mt7915 only to MTD. Passing data from DT doesn't support offset and NVMEM require a different cell name and doesn't support offset hence only MTD way is actually supported. Rename mt76_get_of_eeprom_from_mtd to mt76_get_of_data_from_mtd as it is now used for a more generic purpose and export it. Signed-off-by: Christian Marangi --- drivers/net/wireless/mediatek/mt76/eeprom.c | 5 +++-- drivers/net/wireless/mediatek/mt76/mt76.h | 1 + drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index 1de3c734e136..817074a5d2fc 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -28,7 +28,7 @@ static int mt76_get_of_eeprom_data(struct mt76_dev *dev, void *eep, int len) return 0; } -static int mt76_get_of_epprom_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len) +int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len) { #ifdef CONFIG_MTD struct device_node *np = dev->dev->of_node; @@ -105,6 +105,7 @@ static int mt76_get_of_epprom_from_mtd(struct mt76_dev *dev, void *eep, int offs return -ENOENT; #endif } +EXPORT_SYMBOL_GPL(mt76_get_of_data_from_mtd); static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int len) { @@ -149,7 +150,7 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len) if (!ret) return 0; - ret = mt76_get_of_epprom_from_mtd(dev, eep, offset, len); + ret = mt76_get_of_data_from_mtd(dev, eep, offset, len); if (!ret) return 0; diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index e8757865a3d0..f6c850557447 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -1095,6 +1095,7 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str, int mt76_eeprom_init(struct mt76_dev *dev, int len); void mt76_eeprom_override(struct mt76_phy *phy); +int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len); int mt76_get_of_eeprom(struct mt76_dev *dev, void *data, int offset, int len); struct mt76_queue * diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c index 76be7308460b..5228f710b3da 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c @@ -25,7 +25,7 @@ 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_eeprom(mdev, dev->cal, offs, val); + return mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val); } static int mt7915_check_eeprom(struct mt7915_dev *dev) -- 2.40.1