From 079e41dc71a1bb3a43a2442116e3f290e0c7e468 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Fri, 29 Apr 2022 13:55:56 +0200 Subject: [PATCH] mt76: mt7915: configure soc clocks in mt7986_wmac_init 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 Signed-off-by: Felix Fietkau --- mt7915/soc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mt7915/soc.c b/mt7915/soc.c index d465f8d8..06947508 100644 --- a/mt7915/soc.c +++ b/mt7915/soc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "mt7915.h" @@ -1116,6 +1117,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))