From patchwork Thu Mar 2 11:03:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 9600047 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 E4FC2600CB for ; Thu, 2 Mar 2017 11:05:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D49052841C for ; Thu, 2 Mar 2017 11:05:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C74D928526; Thu, 2 Mar 2017 11:05:41 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 40E872841C for ; Thu, 2 Mar 2017 11:05:41 +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=A7YmYKxsu7E/ar5oHGP2KgQmRYb9pqqouZF/5/NMzCI=; b=paC/KOBgmKQwqjnCB8xlbI+Q/i IAq7dxSiKEmL02m7TtiLkwF+WRpW+StkoW8NLDBwr/4QlOCvtOOipv0kFwkK1jGsYyBOTgTWKCzHN toGmed4k43s2a5PFomI5Aamb6Ifjzs5i1HFFoEsoxCaWkjucBlWahU2l3kTdjiVUDkc8cPZwTp+3t 3szh1qjJodvcPNk8+VBTYmxK/63eRwOFXkji5HE9Sg6BEGNXGtNssjGNVjeuW+oddMGeJKSqviaKa cdgjKsMiGVDOm1cdcSLfU4kBeLUtddCfq8uOXXIlpo1Dr3fylcyVeZ9SKMqLXb21pzp+Y73Q/rUcs 6c+8wD2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cjOYG-0003Jm-E1; Thu, 02 Mar 2017 11:05:40 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjOWx-0001V6-RE for linux-mediatek@bombadil.infradead.org; Thu, 02 Mar 2017 11:04:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3tFz6WDmU+9DJ9zPFpfzzo/se66tOf43ZYaD1Jo+srw=; b=eVlRj5lK2S1EPBzjjovo6WxQf wzZ4t4ltyG0h1ZD2OC/IJMVYGPGz+2s2x4QXc5pDUvbSJeBLzEX4j0oIec3GCP8RMA2LJKxmecZjW NFI1Z1XX+ec9iUelnnkUldLzMZzw14uKndJHv6U0ndxzYnrT+29Vkc2XD9HLTZQeI2Cyrwr3ND8Xi ULaksysR5b8M0VPUd5yTPXxIABGfQJAYf895L8vrboWNX4KU1uQ48/uSQtOh84Y1Bede3Hyt7bc32 61/eehyqzXr7CR7swqx9Cb9xPK5H4/zZ7opUuvtKn5eYsZMqeEYFLmtg9Rod2fnGa+q0rsfxE+jor ySJIqtbFg==; Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjOWw-0008S6-5N for linux-mediatek@lists.infradead.org; Thu, 02 Mar 2017 11:04:18 +0000 Received: by mail-pf0-x230.google.com with SMTP id j5so21397792pfb.2 for ; Thu, 02 Mar 2017 03:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3tFz6WDmU+9DJ9zPFpfzzo/se66tOf43ZYaD1Jo+srw=; b=bEB14Df1mwpFLYwR+Zntig9dQ63GNqAFBsawLPNYQh4PDnTxz/nHsb6i5a6RQtt7K+ ciUabMmke5+K65EAFGoPrJvIA4DKztNRTzhIvPfwQcuoK/6tIGCcy1zv3YM1Y3C48KK1 D5KbZ8IcM/jKa9ZkWVKu1BiSvv88ji2nPreg0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3tFz6WDmU+9DJ9zPFpfzzo/se66tOf43ZYaD1Jo+srw=; b=lp2vjmm2oybtTUgyULpT5lVvFOAspnIuPI5bL/z2VpUHm8Uhv3+dNZFqgurC9/DXIf 8v6/OfjU0GPJ9beGsYEZcZ/Vp9F8IxSWhVOH+xgowpiGYAQO2U3BL7COcRv/fhrAS2+T SPeU3TxEh0D/eavdbf4ecNd06PNtFEgAha+aUn5fw3TuTk+KcKpvDxwo1LTBc0ogXHRa tN++ZwciQDkLvaAHM+qvZlNITa3Gs1nqAlg7nQBXh10Lqz6YPZ0xQAqdFNDI0lqirATq iZIRKvZAX1bdE0T89fGT4ryE+cH6vLGYjziaKKxZVNKL43rpalE1bJNDu1AmEKOA046i 6Fvw== X-Gm-Message-State: AMke39lHweS7PlbBMDiefasZYaQkjSkEZUAX0JwM0A3QsYgxakPGWVCziFqNBBY8JP+fRsmP X-Received: by 10.99.121.78 with SMTP id u75mr14788748pgc.202.1488452635809; Thu, 02 Mar 2017 03:03:55 -0800 (PST) Received: from djkurtz-z840.tpe.corp.google.com ([172.30.210.11]) by smtp.gmail.com with ESMTPSA id 129sm16433846pgj.59.2017.03.02.03.03.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Mar 2017 03:03:55 -0800 (PST) From: Daniel Kurtz To: Subject: [PATCH 2/2 v2] cpufreq: mediatek: Add support for MT8176 and MT817x Date: Thu, 2 Mar 2017 19:03:45 +0800 Message-Id: <20170302110345.184924-2-djkurtz@chromium.org> X-Mailer: git-send-email 2.12.0.rc1.440.g5b76565f74-goog In-Reply-To: <20170302110345.184924-1-djkurtz@chromium.org> References: <20170302110345.184924-1-djkurtz@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170302_060418_305285_E80D0B08 X-CRM114-Status: GOOD ( 15.70 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Boichat , "open list:CPU FREQUENCY DRIVERS" , Viresh Kumar , "Rafael J. Wysocki" , open list , Yidi Lin , Matthias Brugger , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Mediatek MT8173 is just one of several SOCs from the same MT817x family, including the 6-core (4-little/2-big) MT8176. The mt8173-cpufreq driver supports all of these SOCs, however, machines using them may use a different machine compatible. Since this driver checks explicitly for the machine compatible string, add support for the whole family. Signed-off-by: Daniel Kurtz Acked-by: Viresh Kumar --- This patch is based on the compatibles added by the MT8176 series: https://patchwork.kernel.org/patch/9573209/ https://patchwork.kernel.org/patch/9573213/ v2: - use of_match_node (Thanks, Viresh!) drivers/cpufreq/mt8173-cpufreq.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c index 72bc1192bd30..fd1886faf33a 100644 --- a/drivers/cpufreq/mt8173-cpufreq.c +++ b/drivers/cpufreq/mt8173-cpufreq.c @@ -573,14 +573,33 @@ static struct platform_driver mt8173_cpufreq_platdrv = { .probe = mt8173_cpufreq_probe, }; +/* List of machines supported by this driver */ +static const struct of_device_id mt8173_cpufreq_machines[] __initconst = { + { .compatible = "mediatek,mt817x", }, + { .compatible = "mediatek,mt8173", }, + { .compatible = "mediatek,mt8176", }, + + { } +}; + static int __init mt8173_cpufreq_driver_init(void) { + struct device_node *np; + const struct of_device_id *match; struct platform_device *pdev; int err; - if (!of_machine_is_compatible("mediatek,mt8173")) + np = of_find_node_by_path("/"); + if (!np) return -ENODEV; + match = of_match_node(mt8173_cpufreq_machines, np); + of_node_put(np); + if (!match) { + pr_warn("Machine is not compatible with mt8173-cpufreq\n"); + return -ENODEV; + } + err = platform_driver_register(&mt8173_cpufreq_platdrv); if (err) return err;