From patchwork Fri Jun 16 11:41:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13282672 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 DBD67EB64D7 for ; Fri, 16 Jun 2023 11:44:04 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SeX3bvE8ysARkGcYHq6XXop7HEPGgD/NPvN+ztPatP4=; b=Z6zF+0Kwdf/4xS 2t1+u7XVq2ij3PcHk5DaTCOeAmQSmL1WGdtyQyDane7vbST7v3Gc9ZyzZVIYoiuPz6BKVwH2tC//k CY+qVh/8CGL7uoX4L/j8IfzGdTHui0purvUfWPpEkv2IhH+AkQVZ604t22wki49WCIS3fC68E8Ndh EvNIL0IA2XQJ6A8FfSMTkJrEFBvhZfP2+od9iLLUKyuOC0KQFxctiNI6+ptBowi9FTf7nSFxCBppq s49Sw5qMylQYU3Ha727zIso/5697WNW1Mf7zuMw0rTcLGWTXHkOgd/zmd0Tu5/HnR0IGT9Mi72L8u m6Gt3Gd5PPFIX/E09/xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA7ri-000RIE-2q; Fri, 16 Jun 2023 11:43:42 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA7rf-000PzP-19 for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 11:43:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qSQ36GOQMsCGqj5eIWmJSjK+G3EMBz7U7jaAgg3L9Mk=; b=sUaTSKJVyxnWldu2CKE5MVl0sC ZJ+3FsfNBgV7/GKDT7B46wpHZp0ih58nECqRJkE3Tsl6OFFfmZY/99D3NInSjbZ0Bq0AM3CMJfdWI c1r71AoJBKCE5sAzSPkMTI5Nse8VNSE00lOmAoLNeCK7IFJY+4i797paz2/b8n/ESj4CqtFssHvC2 HU4Q7OsXOeN+W9ZVHPJtPmUNZpS0p7IdXpEzCoyn/w3pBSrQTqhMrYYqPvWwFS4FI8vjZqhT6isf9 qCF1x+hP8PLK4ElEIYxv92wSVBktvQLWhH3A+2bq4T1nT5MXZRtkdIkFJVdFAsTq0KmTC/wDtQdLh VVZT2mCw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59816 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qA7pb-0004vB-Fr; Fri, 16 Jun 2023 12:41:31 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qA7pa-00EZw7-R9; Fri, 16 Jun 2023 12:41:30 +0100 From: "Russell King (Oracle)" To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Viresh Kumar Cc: Josua Mayer , "Rafael J. Wysocki" , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH] cpufreq: armada-8k: add ap807 support MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 16 Jun 2023 12:41:30 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_044339_664912_634F44BA X-CRM114-Status: GOOD ( 13.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for the Armada AP807 die to armada-8k. This uses a different compatible for the CPU clock which needs to be added to the cpufreq driver. This commit takes a different approach to the WindRiver patch "cpufreq: armada: enable ap807-cpu-clk" in that rather than calling of_find_compatible_node() for each compatible, we use a table of IDs instead. Signed-off-by: Russell King (Oracle) --- drivers/cpufreq/armada-8k-cpufreq.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c index b0fc5e84f857..8afefdea4d80 100644 --- a/drivers/cpufreq/armada-8k-cpufreq.c +++ b/drivers/cpufreq/armada-8k-cpufreq.c @@ -21,6 +21,13 @@ #include #include +static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = { + { .compatible = "marvell,ap806-cpu-clock" }, + { .compatible = "marvell,ap807-cpu-clock" }, + { }, +}; +MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match); + /* * Setup the opps list with the divider for the max frequency, that * will be filled at runtime. @@ -127,7 +134,8 @@ static int __init armada_8k_cpufreq_init(void) struct device_node *node; struct cpumask cpus; - node = of_find_compatible_node(NULL, NULL, "marvell,ap806-cpu-clock"); + node = of_find_matching_node_and_match(NULL, armada_8k_cpufreq_of_match, + NULL); if (!node || !of_device_is_available(node)) { of_node_put(node); return -ENODEV; @@ -204,12 +212,6 @@ static void __exit armada_8k_cpufreq_exit(void) } module_exit(armada_8k_cpufreq_exit); -static const struct of_device_id __maybe_unused armada_8k_cpufreq_of_match[] = { - { .compatible = "marvell,ap806-cpu-clock" }, - { }, -}; -MODULE_DEVICE_TABLE(of, armada_8k_cpufreq_of_match); - MODULE_AUTHOR("Gregory Clement "); MODULE_DESCRIPTION("Armada 8K cpufreq driver"); MODULE_LICENSE("GPL");