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: 9600049 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 999C3600CB for ; Thu, 2 Mar 2017 11:05:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 899E62841C for ; Thu, 2 Mar 2017 11:05:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E6AB28526; Thu, 2 Mar 2017 11:05:44 +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=unavailable 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 402D42841C for ; Thu, 2 Mar 2017 11:05:44 +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=Cn1XOwzAhx0r+btzWWdBw/jnCzT7QEIq4oBeIz5j9vg=; b=UtTmZ3jGnMwfnot8fPx5O96u1b m9fygPTjocq+ath2Agy/16ZF1zIoNN6Yrz52QTy4uSHP237L1xAnss0SBCTjioYnOek25ZUP9zppY HKLPqgSqh2C/WpOCLtr7uW72iKTY/r25zmx1oBtTpe6QzeHD0/KQkuXDWbczY4D6LxTqFFL6CjVQn HITb1qlk0TaR2mAA91QaoOdYcGuLBJLlIJSHg98LKy0urzNnGMVTWMLEpLUzl6X0GAPU5dLAcA8e/ hmUzX4X3UsVpCa/8eb2qsDaVxJNVaTrn2MKbBIoWaeuThZV4TETbolx0w0ef33wr6ZXoRA2mpSIMq 7YAW9vrA==; 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 1cjOYJ-0003Lp-IY; Thu, 02 Mar 2017 11:05:43 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjOX0-0001XV-FX for linux-arm-kernel@bombadil.infradead.org; Thu, 02 Mar 2017 11:04:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=cDMpdiVfkfsbgNwdwTlVLMOVs qxvIwR+kZ0r7ElMF3RBze5BX6mkkLzE4HZeOY4KnR6kBJDvIYjjOh+OJ4fheHbqaXJZAkx0msr0l1 3QleMZM6M7tS5tvgGsdAx5Iu3nBaJx/GltGea3ocw+LBZtkNVdL+2uy4GrHVWf4014AEbLvPcv5nK c+QhoUIRN3LJwPzeFgZDF+H7pGhwZz0iAfjOa8cT4HCU/Fr2B2v0m0RdrpfQveYuRJtHRaqgt+cu/ oqf4naj2faIE/CLmVrbYEjkfReGw2pLjXxcYP3LM2gDbxkxxYXDdmnYbzEIz4qV+TAsETgVUKIDDo scQ5YP2ag==; Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjOWw-0001p0-5Z for linux-arm-kernel@lists.infradead.org; Thu, 02 Mar 2017 11:04:20 +0000 Received: by mail-pf0-x22b.google.com with SMTP id e66so2815488pfe.1 for ; Thu, 02 Mar 2017 03:03:57 -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=uQx7kkuY4nIZrvrt7tYnnekK8YKCEsgVO6jTJt5iJiH2wHaIN7TXdkED+gSP3nhJPx Qo9Yu4yoQDq7uEqyVSQ6QwGBCosu137NmJ5eeOKj3Zz5ydJmIdfhzsJIAJqwMVZ9bUSh U5tnLFYuRugnAC+aU7N1QyXZlf3WUTlfvliOmnfZ5cSzaiP8V20VuCIKC2zt/ObuJwrd l2QfFgww3rRnKUGZdUXU1cWN5JNeEJ6FWeLP8CJqG9jRhQ04ZoTEpc04uoDC2lrPLb+p Gx0NtlWViqD3qp4TDaj7G5GarW8gydnMUFnHG3zOgb/yXRUvBsABXXHWRWDo4ia9WXNu mMMw== X-Gm-Message-State: AMke39kMDoqlilR4nUSQw63Uv/z9SsY8hkytVIkp4fKxXuLbPxYqZEI8c8v0uS5YpzfRmu4C 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_110418_379089_1A7C86E5 X-CRM114-Status: GOOD ( 18.18 ) 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: Nicolas Boichat , "open list:CPU FREQUENCY DRIVERS" , Viresh Kumar , "Rafael J. Wysocki" , open list , Daniel Kurtz , Yidi Lin , Matthias Brugger , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" 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 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;