From patchwork Tue Jul 30 03:30:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacobe Zang X-Patchwork-Id: 13746493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36BAAC3DA49 for ; Tue, 30 Jul 2024 03:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BNw4+9wMALkMe2deE0BqYDVQYYpEm+KMXNx0Jvp82MM=; b=RSSwtRn2Wb4Jv8 zoPwr9g/NWFmwgF5ufieX/Mo2qS1xbVzWdEyqCJJ1dFGL2I4qlCzRO79YRHIG8zRaQYhP2prR3axF FIB77cFzTY4L2vKIaNJ9kFElVl7xgUrzKyKpCCHoE+qLwvJ0tQ3XIgAlsDe/Uug2YHH/smVVHx+c6 dnqEsqOZw+uM6q8gXvAMdQeGqp2vOdyOKMgObtKPXVyDYL/bF0B7PCAQKPf91UaFIKd6psnZpbYWI yZEL8RrWP9BsLNIIWhpUKcj3IRoa+oIJ2/LbwSMimIitJK2SduyE7wTA/ICzd5uMhCBG09xZjUhsK JpabZOno/ZJ0NzDHATDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYdbn-0000000DUXk-3sza; Tue, 30 Jul 2024 03:33:07 +0000 Received: from mail-eastasiaazlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c400::2] helo=HK3PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYdaE-0000000DTwO-0znK; Tue, 30 Jul 2024 03:31:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cetq/FNQv3oN1QPUM9dKQp1TJifRxt+cSZcpMdZBkbuNuGlp9F1KU8ti049KoBaraiNp75ZprQ0Rp34gx+1fbt0qpNXF0aI8zh9BPk97MtKw7lIkMFGALfKMfung2vR6sMWtyKABshcrdrS0se0vBSzTRx9wGfAXkXrCg1OKCVig/cdBLBn4YnKX6KPZoHUjNXchzCLdQnwN6fMLdCZrWCY9IjI/1O9EEx7BaLEQkHAb/wuLVh7ReB2Cl3hXEioxTXCkQ4u+2MRQ6IIfNsYmeEZurKVhjwYmRMFcjfgUG8zUYknPGaEQf9/GZJLagExG6tlj5psYp5KLntuu913Heg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Rspe/NDPnfZ6Do/p42MpgllFIGSSJ0/L4KOhKjDQjM8=; b=CQUh2RlgiCgqLMc3wAI/m0sR8b5jQf0hCyMRXVW1AzYtlq9I4VAXLxWOxvr7MVl3sCFtQ6yJbVhPi0P2IsVY1rkWbeSuKCCiRzGnvGiWAdQJErvcClBtkPw15HaOUUgj6Cj4pG6/qKpQ6KWWNP94Sm9INDODkc7ldJqa287WHrZynOe7fQ/uQoa5Ufikt8USG947r7JDaKCAoUmFEHEkAnva1EMg6vQdq2iOg2pYazH1eBQ/AFnl1sOIpajhYulv/2bEssD6uXpnDsm4bJredUp/NG98kjXGfN2h5Sq0I7P3435q9j2iKvnMmgxHpCeZ8tQGluTlr1CFjT1HhCzmlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wesion.com; dmarc=pass action=none header.from=wesion.com; dkim=pass header.d=wesion.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wesion.com; Received: from TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) by TYSPR03MB7705.apcprd03.prod.outlook.com (2603:1096:400:40e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Tue, 30 Jul 2024 03:31:21 +0000 Received: from TYZPR03MB7001.apcprd03.prod.outlook.com ([fe80::78dd:5e68:1a9c:36c0]) by TYZPR03MB7001.apcprd03.prod.outlook.com ([fe80::78dd:5e68:1a9c:36c0%6]) with mapi id 15.20.7784.020; Tue, 30 Jul 2024 03:31:21 +0000 From: Jacobe Zang To: robh@kernel.org, krzk+dt@kernel.org, heiko@sntech.de, kvalo@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, conor+dt@kernel.org Cc: efectn@protonmail.com, dsimic@manjaro.org, jagan@edgeble.ai, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, arend@broadcom.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, megi@xff.cz, duoming@zju.edu.cn, bhelgaas@google.com, minipli@grsecurity.net, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, nick@khadas.com, Jacobe Zang Subject: [PATCH v5 4/5] wifi: brcmfmac: Add optional lpo clock enable support Date: Tue, 30 Jul 2024 11:30:52 +0800 Message-Id: <20240730033053.4092132-5-jacobe.zang@wesion.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240730033053.4092132-1-jacobe.zang@wesion.com> References: <20240730033053.4092132-1-jacobe.zang@wesion.com> X-ClientProxiedBy: SG2PR03CA0122.apcprd03.prod.outlook.com (2603:1096:4:91::26) To TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR03MB7001:EE_|TYSPR03MB7705:EE_ X-MS-Office365-Filtering-Correlation-Id: 410c6696-5990-4dfd-dd96-08dcb04814cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|7416014|38350700014; X-Microsoft-Antispam-Message-Info: gwOg3Mjunr+TE2KrNtslpxxMSG1izSvaOHVG++iw6C1Vtr80HPSmb32wIrJkdfHQJOGSeelCDl/EoE4gwdat8SZjWrQDtTO4hj6ShQ+2prWptKcM9x/EZnky4YixbYjs1F5vFEcZt6jhuscs1GrTAtRI4lTEesj8bQ8rRE/xcYy91to+Ndo9r7a4R+R8P78WMKQkkapmHZtlWnm3SQe/lEK1aryQjwirOZ64kqYq8AOAwzTAaU+OE/uajDnt22r5oAQEfRBgj7yBoq1sIW+BzGfEdMqL16NRo92zJotHiO79ni1jvyzn3zjSoVtJ3wusrimBJw6wWPE5TQNPKj4cfcfS/z1ko+tSYz2rSoRHPDiFrv1Ywvpoq+wxAm99TI1p1oukxr3Vo+1K9phmMbCMvFIONtpQB3l90GPxe7+xsv4/iNeRFdfIlj17dOUzs8YEkYNFw3AbbpQpim7I0jsBepU49cr1GUUffp1V8iCN3Nga6QUttDLpu8S6VMYUppdasoZGNGYx42fMRi0O9n7lzxH8jR22VLaR0/X2uypH1sj+wDYvHo7Xs++iQ3h5U/EHwY/om49CjQDEZTxeau1RWKx+Uvs7QTnHopXWusLCmxi4TJUM1gxO3RNQnzk/vwplf505YiTqWtowewhtxj2IVCixluX/rlgfKpcYckYMZxOxXpwKfpZf2BikZ5iHhCjqWbPQSUS9jIk3anEfmJYIE88AY1rl6kdNEQZJyskYy5hb1w7IzmN3yPmu7WwpeqPQ57e5QBZnkR0m1ITPUVPv1n6OF2aOVN1k9F8zYgOJjYXbxI1vP2chbOcfJ0uVJ+J1UxLeL8wx64GR1Fcrh43lg7jxKPN7eVdQ42QdDi5NYHr5P78WfKafuSTMDv2fxriUv6hfV3jyBMYXILdQs6JN7j616TqeJyEXTW2glItLncT1IXEHHsVaRdilyVf/sl/BH4edL9IShFvnMF+PQtlwwkXdiH8401TBqDKAyiVj2vWSzcZ//7d0iK92ywkls5BBNmBuL9wWKL3EOx3tmV3iXrb4k/Mn5Emq7Vu80nqlJhgD0ebst5jsczlWkpbm3PSNBa0kKqX/G3qXZ1nigkuY/W2weohIekkyIBxUYOOVeMntaDlrEIRtnLuKBeHoXpGkfnadjRz2G5WBBqRsQup7DbIJ1NsyKIMX72kO0hrX34iMZAEAbwZZbor4mn7jyC+wzFmZcqn18Q5t5F3MTq37fY7yUs7yz2yoHPrFwB2k25vTo/w5nKETqW+Fv8dSMuFfI5Sa5R99rNACxCv30YUoNacszsAa+IcgrR9VqOeZ0Y5vaduzJxcykdjBjgAVkSPDz+gf7Urs9rcOHpSsPXwfLiUyTRF84wsxeqa4KSaAzLkM968kfSNwE9QzoPMzc5v+MxCLSQ8rlR0QDjj3TKWfLg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR03MB7001.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0GVZM/kSW1NhxEpFecNhyiRobXEQrlUDzpXoNKuCzQDyJXyoSnoUlhEhGjxIRDm8/wMi6IlwEkaLpRksFy/gt4tFgYZZ5c5DL5Vh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6wvFuGUc8QfC5qOnoF0R7L8ZBq3wsQebehelcHt6oSi8DJe8FTGewleGsUXaNldTBQq+VRMmNwd8DPFXybEc3jAvg3+iJ7Oirf3hr4dasUTOUwepFtZ217Ktuz2IIGw3dYvnoPE+vv9Tmg7Jpm7KbCiyrO7bwFGDHf6CPuSndT2yTt2DwBA94yLhdQ6IXvUyeJ2hxLlg/ZpPFZFvRcyIfmu6nhf3AoPSXjoB4ABW8g86dCAtvlGlRY+vo6+b/+g6L6ggHIv2V8KU+TK/U9FSCCW8GpqkdeRnU5qqiHscC/dzszJRmM1tprCxXpctvC8rQwIDpZ6Hod8bnWDLuJq3NmyJV8mTwAGMGd9gC4p79IZtWQK6dZI1SqdxzLY0YtCyh16D2MLS1pwwuTD X-OriginatorOrg: wesion.com X-MS-Exchange-CrossTenant-Network-Message-Id: 410c6696-5990-4dfd-dd96-08dcb04814cc X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB7001.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 03:31:21.4401 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 2dc3bd76-7ac2-4780-a5b7-6c6cc6b5af9b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iJoxW3Z+iR53aW0CuwmSCwm5lTHt92aoIMRx1VSg5ztPv6tASCOp81CxifTjJ2gLIMO3IP6Sno9Z3iLgw7XzOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR03MB7705 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_203130_300794_3F62D93E X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org WiFi modules often require 32kHz clock to function. Add support to enable the clock to PCIe driver. Co-developed-by: Ondrej Jirman Signed-off-by: Ondrej Jirman Signed-off-by: Jacobe Zang --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index e406e11481a62..6246e3fd7399f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "debug.h" @@ -70,6 +71,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, { struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio; struct device_node *root, *np = dev->of_node; + struct clk *clk; const char *prop; int irq; int err; @@ -113,6 +115,12 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, of_node_put(root); } + clk = devm_clk_get_optional_enabled(dev, "lpo"); + if (!IS_ERR_OR_NULL(clk)) { + brcmf_dbg(INFO, "enabling 32kHz clock\n"); + clk_set_rate(clk, 32768); + } + if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac")) return;