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: 9599899 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 2318360453 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 F206E27F7F for ; Thu, 2 Mar 2017 10:37:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4FA3284F4; Thu, 2 Mar 2017 10:37:05 +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 5F46D27F7F 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=RXBa6w+mLjVOYcZByyr1RAlbpPPArrwTYdgP8eL3cj8=; b=BgT 63oUN9vgNNYHa1Rq1296mHg236rwTqNPIlkP3+OMfsS/x/T+V7MaP81dZtrz5DA71HGZshf6ZH9la AUpl5O77yNXGYsuePDbn1YKYGsKh4GXuAGEEtcjRmD1g32+JmzWbQoXwOPqfQFWlgNOIAEQqwlXso SCmIU1X5ieWMjy83TtcF41n6wgekQ0BhHpgDyu/CInuh1JRCXhGGSx2nwghhTCjzuSbBp4dLbX+4E pRqqUdvEcbFUfU3EVj95XsUYjVxwkRE9FiYRFutEI70v8Uwn5SWQp3Ll0L7CFnUb9uICWqtM1U6Lr hn98y4nDs1b3wKamJJJcOZxuNWA2JMQ==; 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 1cjO6a-0004Qa-IK; Thu, 02 Mar 2017 10:37:04 +0000 Received: from mail-pf0-x232.google.com ([2607:f8b0:400e:c00::232]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjO6U-0004OR-Ou for linux-mediatek@lists.infradead.org; Thu, 02 Mar 2017 10:37:03 +0000 Received: by mail-pf0-x232.google.com with SMTP id e66so2606398pfe.1 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=N4rAJ27DMJKjfh1q0/SKQ0Xx+yRelw5r68tQK2iyzBjdCQWsKQjDhbe+cd8CVL+oWo 7XbaFflmN9WuZJP5s7DCx2hk8vKrBi3Keox4fdv4XgFPXpn7KBefhRZUZkkdhzEcRflI 8o6TFzRi53OBaGVJ92/bzOOaRdUGHZVpc0fZenejFCINF8gnzhCNFbebQ1Z3J+FLkXhe t7W8ROe9LyzTSrRZik+GD+aAcBLEJVP1OcjQdnsnKOa7GqR5kxt1F+DfROI/llxVUYQF 3VckH7z1PRBz7aJCcGjcgoAlGnQhKJcd6JNhGQe1QX7D1jtReOwo/ZGMnAASJlMa+iuF yZDA== X-Gm-Message-State: AMke39k0W1kowG2M0bZACWYDfaQIIJPKKlk78mpraDEEKJ5enrlCoP+4hQUDX+KEnv0n5XhT 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_394778_C12780DB X-CRM114-Status: GOOD ( 14.04 ) 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 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)