From patchwork Thu Mar 2 10:36:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 9599901 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 46C9860522 for ; Thu, 2 Mar 2017 10:37:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21D3327F7F for ; Thu, 2 Mar 2017 10:37:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15822283AC; Thu, 2 Mar 2017 10:37:06 +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 B87B228113 for ; Thu, 2 Mar 2017 10:37:05 +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: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:In-Reply-To: References:List-Owner; bh=RzVvyKwCvhkFbZEO4l3ZLHxZxr180YHUhlLuXnhcZn8=; b=t8C sOCIwLhQd/RXWWEmDKXvQitRR6IBtY8rfzfJPLy4BBGW4pkm2n6HMDuMGgRKoc7K9v7+ym7Go7X2y eZp5LvPuORe4+8Y3tSNsdaMZo3GzznnZ38IKAjsl182CZhh7NpOdns5wC0lh9m8glY10grGQZtl4R yGwbHuuBF69mX8sR5ZsmB8eJdZo4CqmDwYMs+bZtaO5GMOgE16NfaPYC1XyNYk1zHWrvfrd6t8sW3 V36iFiLcuHMXH90PCzUM8qGYH0Dv6zZWDQh80JpUSOyYbTT84hljud9Vw7tCcBSkXFNdStvOiVAPd XTanQXFj8TP5GMJr3JaPBxpPeyWGVkg==; 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 1cjO6b-0004R6-Gl; Thu, 02 Mar 2017 10:37:05 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjO6X-0004OQ-7p for linux-arm-kernel@lists.infradead.org; Thu, 02 Mar 2017 10:37:03 +0000 Received: by mail-pf0-x22a.google.com with SMTP id j5so21184740pfb.2 for ; Thu, 02 Mar 2017 02:36:38 -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; bh=/F5UHiJxhaa8zwzB10SfagGUtO2hpo1zp5oh15sB+Jo=; b=JnLcKSD7R+j60x2USPfhLyOyZkqZsqzF7oMFdQcJ+8jnqxSvEjUUI4PH0E77fEXeUW J0IBgvPc79FaJkDqLBK1gcAFtfMB5eVE9ApqogFygsCKoo9bvZ34TIeERJb1xKVNUcNS 3fkR4jko/zK+sQTIQR2p2gmFdZkIPEdC4b8Ew= 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; bh=/F5UHiJxhaa8zwzB10SfagGUtO2hpo1zp5oh15sB+Jo=; b=YYCq1Y9La+KlXOR7Fv77oxsdJHqi8JAusQvSgxtQet7GZVQbPzMYrzxaAoamA1uNte PcOvANybTs0v+9LfxcuMWAPWxhdHSLV+UzuPvkP4pw6eHg19FXUtxA9tnixSoFjzeNp6 OZ4+czLshSwe1gcEMrHFy4s5zFP0EGEj0PkPkFuPSViuI8PU9QlnT35ZZDfzl02UfK4m NEWS86Rm/KQDGaa83eVcg9BHPbGuqEtdgsqNyKnHgUPAljEV/o2kGRlzaHdRFKJosZXH 1v7KRCiWRM9QfEWV7joYPfJHaKWtOJA2dJlhua8ujVe/qMA0rP6rkpgmPlMmGU47UKVZ pAsQ== X-Gm-Message-State: AMke39nJgAgQITUm/C2iewiBzr5ITvEZbPTMgjfrM+z2JzQlszlcbIq09PQVDhCJzbnO6MJ5 X-Received: by 10.99.136.74 with SMTP id l71mr14596801pgd.143.1488450997536; Thu, 02 Mar 2017 02:36:37 -0800 (PST) Received: from djkurtz-z840.tpe.corp.google.com ([172.30.210.11]) by smtp.gmail.com with ESMTPSA id s3sm16257055pgn.55.2017.03.02.02.36.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Mar 2017 02:36:36 -0800 (PST) From: Daniel Kurtz To: Subject: [PATCH] cpufreq: mt8173: Add support for MT8176 and MT817x compatibles Date: Thu, 2 Mar 2017 18:36:26 +0800 Message-Id: <20170302103626.69195-1-djkurtz@chromium.org> X-Mailer: git-send-email 2.12.0.rc1.440.g5b76565f74-goog X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170302_023701_394836_2DB3B942 X-CRM114-Status: GOOD ( 15.39 ) 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 on 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 --- This patch is based on the compatibles added by the MT8176 series: https://patchwork.kernel.org/patch/9573209/ https://patchwork.kernel.org/patch/9573213/ drivers/cpufreq/mt8173-cpufreq.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c index ab25b1235a5e..07f7aac56f31 100644 --- a/drivers/cpufreq/mt8173-cpufreq.c +++ b/drivers/cpufreq/mt8173-cpufreq.c @@ -573,13 +573,34 @@ static struct platform_driver mt8173_cpufreq_platdrv = { .probe = mt8173_cpufreq_probe, }; +/* List of machine compatible strings supported by this driver */ +static const char *mt8173_cpufreq_machines[] = { + "mediatek,mt817x", + "mediatek,mt8173", + "mediatek,mt8176", +}; + +static int mt8173_cpufreq_is_compatible(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(mt8173_cpufreq_machines); i++) + if (of_machine_is_compatible(mt8173_cpufreq_machines[i])) + return 0; + + return -ENODEV; +} + static int mt8173_cpufreq_driver_init(void) { struct platform_device *pdev; int err; - if (!of_machine_is_compatible("mediatek,mt8173")) - return -ENODEV; + err = mt8173_cpufreq_is_compatible(); + if (err) { + pr_err("Machine is not compatible with 'mediatek,mt8173'\n"); + return err; + } err = platform_driver_register(&mt8173_cpufreq_platdrv); if (err)