From patchwork Wed Apr 18 15:56:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 10348641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A237260216 for ; Wed, 18 Apr 2018 16:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9192528390 for ; Wed, 18 Apr 2018 16:04:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8615C28686; Wed, 18 Apr 2018 16:04:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F2BE1285E0 for ; Wed, 18 Apr 2018 16:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZeMHliUsMn7Gorx12IqCPQoNy9SPcg+eEh7ldP8M8OY=; b=RzevGuYBnI63xvBeSj4GAYQKPu pyiBZ7ZgS/QCr2gFQGEFiNnUfC6yO7lXrp7dUH12lHaeiBgToJaUxvRaKZGg3W46xe9r9VSENeAG6 f2ZKRmqYgtexiOYbmCbmZVHfQhevGloEgkiaBI3gO+8esTtZ6tKMO4HvZ3I+IrSbb/7pCjdAFAyFk umplB35S5+7rJC0QjzTL3gnNxGMWxpGPX9mghyr1PUGdYFjh4ERQLLIZHAwFNM4WNYTjQwpNh4mgV UOp9Bvq++0MQizMGri2uIGVp1vIQ8x84ZhVuLoxDoOVEddIGaMI4/RLaqy9O0cs29m0cayRoV531q +RV0hLeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8pZ6-0000tV-EP; Wed, 18 Apr 2018 16:04:12 +0000 Received: from smtp-out-so.shaw.ca ([64.59.136.138]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8pSp-00054e-7a for linux-arm-kernel@lists.infradead.org; Wed, 18 Apr 2018 15:58:21 +0000 Received: from triton.mmayer.net ([96.48.174.102]) by shaw.ca with ESMTP id 8pSbf2BfoLkoz8pScfzTJS; Wed, 18 Apr 2018 09:57:31 -0600 X-Authority-Analysis: v=2.3 cv=OeS28CbY c=1 sm=1 tr=0 a=IfKG9KDHjPrX0SZ8gMoyrg==:117 a=IfKG9KDHjPrX0SZ8gMoyrg==:17 a=Kd1tUaAdevIA:10 a=pGLkceISAAAA:8 a=Q-fNiiVtAAAA:8 a=XW4pkaav5ZQx9IFfAeAA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 2CAE32046F159F; Wed, 18 Apr 2018 08:57:29 -0700 (PDT) From: Markus Mayer To: Viresh Kumar , "Rafael J. Wysocki" , Brian Norris , Gregory Fong , Florian Fainelli Subject: [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: prefer SCMI cpufreq if supported Date: Wed, 18 Apr 2018 08:56:43 -0700 Message-Id: <20180418155643.36464-3-code@mmayer.net> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180418155643.36464-1-code@mmayer.net> References: <20180418155643.36464-1-code@mmayer.net> X-CMAE-Envelope: MS4wfI7G2cWSXehu2rOtki/wOTMDEpmKOxM7RtnOULAht0YItSq65Wqsw+lz8c025yGGXNNIVOnoGBbzcDKYY8S3zdmoyy0fKlb5p1WTd/BrZ4JYXr0ZqbkX ou7vLufXngcH4rlm2bEDIZlR8zEfaeiquMxwHhfi63yBWZqho9PWt2bJ55lsZqJpFySqEyCdiNfoJqZXVz8K5ZJE/NimLXC9oi2IPCUiBqIW2l98NBkyyfpR 1wnPIkiStonciztMZRupmsAdV+cldr1bwUjN0aisV3h2mFY03RtBXzfUw25tc/4wBk1WaHyc0kPeLdmKvq38gVv96U4Dhet5MEj4DEnz6TBdrEPN40yPKdRd zzmTfW5v5CLjisbeEiJ33B4+MdHGh0s/iTdmjAmchst/sc7bOR3L4r4E4T0hm0FvaVClexawBm/qFHS62h8GWRUpX73qOZfA9EAwg3Wq7FaJC7ZtczEFZ+O3 GVdNyxg/1AAOnDj/yktO+mgVOBNaZHScxpVkL4owx951CgS7eu/zBeoyYUUAoe4zdxyqOkM1UdH3oW2H X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180418_085743_381104_F0D6362E X-CRM114-Status: GOOD ( 11.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Power Management List , Linux Kernel Mailing List , Jim Quinlan , Broadcom Kernel List , Markus Mayer , ARM Kernel List MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jim Quinlan If the SCMI cpufreq driver is supported, we bail, so that the new approach can be used. Signed-off-by: Jim Quinlan Signed-off-by: Markus Mayer --- drivers/cpufreq/brcmstb-avs-cpufreq.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c index b07559b9ed99..b4861a730162 100644 --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c @@ -164,6 +164,8 @@ #define BRCM_AVS_CPU_INTR "brcm,avs-cpu-l2-intr" #define BRCM_AVS_HOST_INTR "sw_intr" +#define ARM_SCMI_COMPAT "arm,scmi" + struct pmap { unsigned int mode; unsigned int p1; @@ -511,6 +513,20 @@ static int brcm_avs_prepare_init(struct platform_device *pdev) struct device *dev; int host_irq, ret; + /* + * If the SCMI cpufreq driver is supported, we bail, so that the more + * modern approach can be used. + */ + if (IS_ENABLED(CONFIG_ARM_SCMI_PROTOCOL)) { + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, ARM_SCMI_COMPAT); + if (np) { + of_node_put(np); + return -ENXIO; + } + } + dev = &pdev->dev; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv)