From patchwork Fri Apr 29 11:55:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12831918 X-Patchwork-Delegate: nbd@nbd.name 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F262C433F5 for ; Fri, 29 Apr 2022 11:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358777AbiD2L72 (ORCPT ); Fri, 29 Apr 2022 07:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358762AbiD2L7Z (ORCPT ); Fri, 29 Apr 2022 07:59:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AE36C7E85 for ; Fri, 29 Apr 2022 04:56:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D1085B832D9 for ; Fri, 29 Apr 2022 11:56:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3286DC385A7; Fri, 29 Apr 2022 11:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651233364; bh=KWWxD1p0Cqv2iwPkipTUDx9uVglSHLkK+nUJh50EX4c=; h=From:To:Cc:Subject:Date:From; b=vKU5ewHgQgdr8+GqvygZzmHHVvOujjS9wibB86XlLVszfGVhDA1BvaYfTnvhv/YYd nd8yunhuH+VZvRyEQu+W831TttUFhanlxEM7x95pE2zh8J8XUVKnFF4xTsf1jEnuPB o2/ZqoN3z/jPrJsCIpLvwC2mKpK5EbynrREYruZaPzI+O2iZYNsldgEDvlqMfIG7ME RBJqjVu1X7A24s1i9wqJR+7r1kjzgFtTFKZeAhwAMOrhY3P4lZFclxZoku4Fk73ZVL 0PbihAcMrIASIluKmBoVZ6OIbGth+XYVDInwIJe85Z3PCvtk/JwfnW0ZQ8e6RTG1qF +95IqRVdsIryA== From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, evelyn.tsai@mediatek.com, chui-hao.chiu@mediatek.com Subject: [PATCH] mt76: mt7915: configure soc clocks in mt7986_wmac_init Date: Fri, 29 Apr 2022 13:55:56 +0200 Message-Id: <012ecb7435a23b1e15d27a40147d85a851b45e63.1651233185.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Configure mt7986 wmac soc clocks in mt7986_wmac_init routine. Tested-by: Peter Chiu Co-developed-by: Peter Chiu Signed-off-by: Peter Chiu Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c index 04e62d569599..a24bcdcd2f06 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "mt7915.h" @@ -1117,6 +1118,19 @@ static int mt7986_wmac_init(struct mt7915_dev *dev) { struct device *pdev = dev->mt76.dev; struct platform_device *pfdev = to_platform_device(pdev); + struct clk *mcu_clk, *ap_conn_clk; + + mcu_clk = devm_clk_get(pdev, "mcu"); + if (IS_ERR(mcu_clk)) + dev_err(pdev, "mcu clock not found\n"); + else if (clk_prepare_enable(mcu_clk)) + dev_err(pdev, "mcu clock configuration failed\n"); + + ap_conn_clk = devm_clk_get(pdev, "ap2conn"); + if (IS_ERR(ap_conn_clk)) + dev_err(pdev, "ap2conn clock not found\n"); + else if (clk_prepare_enable(ap_conn_clk)) + dev_err(pdev, "ap2conn clock configuration failed\n"); dev->dcm = devm_platform_ioremap_resource(pfdev, 1); if (IS_ERR(dev->dcm))