From patchwork Thu Jun 20 02:00:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacobe Zang X-Patchwork-Id: 806304 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2128.outbound.protection.outlook.com [40.107.215.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3F1A1DDEE; Thu, 20 Jun 2024 02:00:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.128 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718848842; cv=fail; b=GtDtwlMfTmbQ/D6/6AYwoOqRnKQpGoq4NvCaHsWkkuvu6SS1Kf8EZYhV1P6NQbdxiZHvb6HH00kyTz16T+268MPAu/uFj0XCi1UClbBMXqU4m2+V5ZAA3iRJeksTYDqXmBZ6jSOf1AJoH3oV7ZrnOyjSkhHQek/4nbYFSPpLeYs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718848842; c=relaxed/simple; bh=5SjvhV8LsLkXpc92LgrhOzzGVhdGbQw8CnCP6pHW+3w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=MAnpmUqNKoO90OCXwH4CZk6JLxJM+zor2AvGj3ecfgbT87K65snGEugyrKGMRKd2pRnCvE6mlpXzz8oOJ931l/xpdsu3UOt9Ptb6svqpBkmJk5NCpwBhlto89phkDo3LX1uAHCNeooIAoIhTQkFkNdhrYdDkdV8a14XPFMz+NJE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wesion.com; spf=pass smtp.mailfrom=wesion.com; arc=fail smtp.client-ip=40.107.215.128 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wesion.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wesion.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjAtLp4ogYh9Av550FuUSPy48Q+fPNi38asCXdkT6qWlga+eqV1FH0qXvlJWb7vB095FnBfqTw57o7jJwK7ys07bbSquT9Mwn1lVhk8z+asm11YiYVdYIlWX/wYWL7SzO+hB30WtU/yNHBV57Q2euOMDRFwTcI5FRt4CG9eHw228uTm7I82dR2HW1y1aoHj4dX094hFPw50qY1vhnotnofX7+/AV2KkZahH33hJHdO4V4H1uPOynbPYsrg4aViB1+5FyB8Jx/YBqJgSaGK4NrqE/RKXjMAxkTwAJBfpwMY8HEpHMm6Ud2P1cf182I+SFXSGG6sdej2w+AaUqqfVXmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ZkVurDLG07C+m6bhwpnrsDKZOwn11qTfnd6KEOFHxhw=; b=RkZNrbrFVvn3WjtXjGnlzkeQ7lxdI1udI5mWD5Q7zJMQc0JAdj/AoVGe2LTDc0G6naqWvBZsf0lBj2iAzSpj6aJR4eBItyLFajwb9VUeWuQ2BGMExwx+HZlc67hb9/CvHSXxcNGarMfGQklQxhanee9USL2qKHubQjGp7zENQCW4Dnhz7YYFcrz8s1vE5bRIyZZzDXPddX2yo7BUkGAS+OY3KIt7Is9Nk3b5a4q6SfLqqwW5IZDWzPg1Q7tNPaF41a1z+DPC6LDtRKju45TX0ddl/cTpbv5PLUh0lml7P/3s1vkm++DbiSgWSbOHkYh+4gcdAUWsXV0G6KNIsIwwpw== 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 JH0PR03MB7323.apcprd03.prod.outlook.com (2603:1096:990:11::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Thu, 20 Jun 2024 02:00:33 +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.7677.029; Thu, 20 Jun 2024 02:00:33 +0000 From: Jacobe Zang To: arend.vanspriel@broadcom.com Cc: kvalo@kernel.org, duoming@zju.edu.cn, bhelgaas@google.com, minipli@grsecurity.net, linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, megi@xff.cz, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, nick@khadas.com, efectn@protonmail.com, jagan@edgeble.ai, dsimic@manjaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jacobe Zang Subject: [PATCH v1 2/3] net: wireless: brcmfmac: Add optional 32k clock enable support Date: Thu, 20 Jun 2024 10:00:14 +0800 Message-Id: <20240620020015.4021696-3-jacobe.zang@wesion.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620020015.4021696-1-jacobe.zang@wesion.com> References: <20240620020015.4021696-1-jacobe.zang@wesion.com> X-ClientProxiedBy: SG2PR04CA0185.apcprd04.prod.outlook.com (2603:1096:4:14::23) To TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR03MB7001:EE_|JH0PR03MB7323:EE_ X-MS-Office365-Filtering-Correlation-Id: 543bd33e-76a7-44ce-607f-08dc90ccc51e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|1800799021|52116011|366013|376011|7416011|38350700011; X-Microsoft-Antispam-Message-Info: Kd1HIC62lZCb8yMBfnmviq2h9u8AtfuunTq60eRrLguJk2Y+MCF7WoKg0gVnO6P7oJ/ruyuShzxkNHZHae23ehBD3B95BnvS1W7omHO+wCxw0I12cbGpmBre21CGKDmF2UEKjJAlCRbTJ9jLxd2qcbVa2bDkNm9vU2skCIXmnGxeAzARMzMkwucdkLYFveQv5CJbCcAjv5zHHZr0iMMbdacQ16Ng86LHUXtwi12/Q77XWUyHT6ALeC49E1qnRvO5lYVtKgndj4z2xvH1ewa5SJEtT3ButiIQ6ba/Ra1ZstzWkWdDPm2UcOMnkUjQz33blaTgR1hxWy4MQaMjtm/kO/LBnr2Fg98zl3XuaTueC4c8eD1fxbNdRElZ3TaKt0aQA3YeGzstU7GJ4QDYl9aoqJg4BnJNu0PRbrl92j/vigD+GCpKNss0mrmOA2TLo4BKCB9f7F6OWwvfEpKJQdJ/TBAP4COn2yIK9XTlDc83dgxTNrA1M5rzUfi2rB7kA3trVXfd4XDain7yANtaVo6W95zkW2SMVR9FeEepkhtkkGuG2/r124bWxTcC+s3x1H9HZMrocAU6idM/cBbC6ypyvcd/r4WH12ph3srh2d9zZgQKrFlP/Bn/BF9TFtNUcXSK3QBuq022rrHyt4wwCNLxS5JMjCU96E1oLPb6HXK99f1gE2fLic6q0mLEMlY4xC94fV8LGIRvJpy3sNwVtvtljTy6bGpi/EXfUxdwZ01K7oam3XSP8Gng8nJQCWUDspfpVIKwyvCjACGHAaiofTgtflsGj1pmsARpyrXI3+BK9jQpd+yFcrDG4RRwywFtS8hS8Cj8fBS7ABml6e5VLblSL53fOOOotrPOxa+c1novOJJ1YhKqH6PlzxrSyp4sTtJZFlNm6PYGyl8b9Ot1M4CyoIn+eY8P85oLgn3fO3fV5Y/tlnrmkxrQ9FuoU25dCiwbiOuFr/PvRRJ/P6v/ISlkoUG+bxj23FNqdOgX8PlE31WoYIZXKQDiai4dOj05SkyhcgWpYgpsMKaNGAIHv7phhfx2c2NvEXHFWrmEP6M68NIRWqJYIlLWhDWXn9lDMHNd/i48d2+lEMOOyK+uPbCEy+jn6li2/ycjXNh8OhGHK6fcH65XhtVzdMvypvwse82qPxbBvS/Z0DriBWvfSgQAkppNTeBHpVStKtH8w9KRd7tFS6suqipZi1eF9xyKGotd8Gv076KDVdUkS3RVB7lJHCHJV2r0JHtNfmVhBu/lbaSQRvro7scN38PVS8AuAiL8p7GiPCMw3qnsMDamXNVBPs7y+Tk+Yq54puZf0ynPjiuP4Cfu9Tk4u2cwtIAcIseWMVvrvx1ctDfDpVFoDdJCLuGEc4TLfn8JppowHLtbNjI= 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:(13230037)(1800799021)(52116011)(366013)(376011)(7416011)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yTsCvNPjMBDLAxliKcWzFromRPDT3rtSy6C8zKLQmJK1xMvhRbsksR/kl3blxryVufDPnN0UCFo/2Tmv7y4htqjnqw3qVFnAIZe8Vs8k1CsOeNy4rjlzrErUM78ZyHfTXJU6Fm1hGckdFH2v7Ubq+K2eET6Q82DC2yr/laIt0Ov6AFzcvxUgeog5euvB6jvDAPIHnVd7fYlHquUzc3o4hNXEe+Y/WT+2NAhUCgow0y25io41vv0oKc0+NncFvKSBP7O9hpkCcTG3l64LPLF9j9zNSCvUA/OZ2seQwNSXgZGMXboOV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IgWon1kcM+MN2NIeimWBC7Q3YG6JJrgM8BKtPHfYcVlT/R5pCYcfv66wYvZxHFhl2pADUy/mPtm1aEtv3KtwQtqCC0Kb9FJE2BVDXflOXMD3VKBzV2inSCTVHzUsPOnD0HRf/2u1kLyKyzv7fmS8VRUHJVLNDDH8bTkUaUdW7xi1kojNqu1Jd5YQgpGZXH3DavNA3GZ0ooJWzi7vag2vBrOow X-OriginatorOrg: wesion.com X-MS-Exchange-CrossTenant-Network-Message-Id: 543bd33e-76a7-44ce-607f-08dc90ccc51e X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB7001.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2024 02:00:33.5745 (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: Plwdek2JhgaZRn8R9ndd32MvoodXSXkvdFdWYoMlVe4ed4VARqC01dNu5kK6u0rbvOVPDW3tnP2LNTciknoFQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR03MB7323 WiFi modules often require 32kHz clock to function. Add support to enable the clock to PCIe driver. Signed-off-by: Jacobe Zang --- .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 06698a714b523..f241e1757d7e3 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -3,6 +3,7 @@ * Copyright (c) 2014 Broadcom Corporation */ +#include #include #include #include @@ -2411,6 +2412,7 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct brcmf_pciedev *pcie_bus_dev; struct brcmf_core *core; struct brcmf_bus *bus; + struct clk *clk; if (!id) { id = pci_match_id(brcmf_pcie_devid_table, pdev); @@ -2422,6 +2424,14 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device); + clk = devm_clk_get_optional_enabled(&pdev->dev, "32k"); + if (IS_ERR(clk)) + return PTR_ERR(clk); + if (clk) { + dev_info(&pdev->dev, "enabling 32kHz clock\n"); + clk_set_rate(clk, 32768); + } + ret = -ENOMEM; devinfo = kzalloc(sizeof(*devinfo), GFP_KERNEL); if (devinfo == NULL)