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: 10348651 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 9289A60365 for ; Wed, 18 Apr 2018 16:05:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85393204C3 for ; Wed, 18 Apr 2018 16:05:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7798C28705; Wed, 18 Apr 2018 16:05:54 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CCCA204C3 for ; Wed, 18 Apr 2018 16:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753012AbeDRQFl (ORCPT ); Wed, 18 Apr 2018 12:05:41 -0400 Received: from smtp-out-so.shaw.ca ([64.59.136.137]:38314 "EHLO smtp-out-so.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999AbeDRQFj (ORCPT ); Wed, 18 Apr 2018 12:05:39 -0400 X-Greylist: delayed 487 seconds by postgrey-1.27 at vger.kernel.org; Wed, 18 Apr 2018 12:05:39 EDT 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 Cc: Jim Quinlan , Broadcom Kernel List , Power Management List , ARM Kernel List , Linux Kernel Mailing List , Markus Mayer 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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)