Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752616AbbHRKLg (ORCPT ); Tue, 18 Aug 2015 06:11:36 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:39794 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751785AbbHRKLe (ORCPT ); Tue, 18 Aug 2015 06:11:34 -0400 X-AuditID: cbfee61b-f79706d000001b96-96-55d304ce3490 From: Bartlomiej Zolnierkiewicz To: Pi-Cheng Chen Cc: "Rafael J. Wysocki" , Viresh Kumar , Matthias Brugger , Mark Rutland , Michael Turquette , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-mediatek@lists.infradead.org Subject: Re: [RESEND PATCH 2/3 v6] cpufreq: mediatek: Add MT8173 cpufreq driver Date: Tue, 18 Aug 2015 12:09:54 +0200 Message-id: <18468574.WHJNqYO5N4@amdc1976> User-Agent: KMail/4.13.3 (Linux/3.13.0-57-generic; KDE/4.13.3; x86_64; ; ) In-reply-to: <1439803465-19683-3-git-send-email-pi-cheng.chen@linaro.org> References: <1439803465-19683-1-git-send-email-pi-cheng.chen@linaro.org> <1439803465-19683-3-git-send-email-pi-cheng.chen@linaro.org> MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeLIzCtJLcpLzFFi42I5/e+xgO45lsuhBoumslrMP3KO1eL9oWfM FpseX2O1uLxrDpvF5eaLjBafe48wWiy9fpHJoqnF2OLiKVeLY/MvMVqcOX2J1WLjVw8HHo81 89Ywery/0crusXPWXXaPO9f2sHlsXlLvcfvfY2aPLVfbWTw+b5IL4IjisklJzcksSy3St0vg yrjZdpW9oEe04sm8qUwNjN8Euhg5OCQETCQWnQ/rYuQEMsUkLtxbz9bFyMUhJLCUUWLp0ZdM EM5XRon509exgVSxCVhJTGxfxQhiiwjoSFxbOAesiFlgDrPE9NfXmEASwgL+Euv39LOD2CwC qhI7/20Ea+YV0JJ423KEBcQWFfCS+P6rgRnE5hTwlLj37y7UtnZGiQff50A1CEr8mHwPrIFZ QF5i3/6prBC2lsT6nceZJjAKzEJSNgtJ2SwkZQsYmVcxSqQWJBcUJ6XnGuWllusVJ+YWl+al 6yXn525iBMfNM+kdjId3uR9iFOBgVOLhvVBwKVSINbGsuDL3EKMEB7OSCK/oT6AQb0piZVVq UX58UWlOavEhRmkOFiVxXn2TTaFCAumJJanZqakFqUUwWSYOTqkGxpl2Jief3MrRLpZR3Xbs 7saKJ0F2ES/XbXBgedb93eeehNXzD11bU498X7z/0KVz+UEy916nb9va+8DfLmP68f0vov45 5ga9PSPMEX6mdgvLtd/2NnKX/h04ofcgrsjgxoxHfiJpBRNdfnKrh9byNBb9tulqjPnjt2LJ w45uEaPcqqvW7V0vo5RYijMSDbWYi4oTAY2v3jCXAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2867 Lines: 85 Hi, On Monday, August 17, 2015 05:24:24 PM Pi-Cheng Chen wrote: > Mediatek MT8173 is an ARMv8 based quad-core (2*Cortex-A53 and > 2*Cortex-A72) SoC with duall clusters. For each cluster, two voltage > inputs, Vproc and Vsram are supplied by two regulators. For the big > cluster, two regulators come from different PMICs. In this case, when > scaling voltage inputs of the cluster, the voltages of two regulator > inputs need to be controlled by software explicitly under the SoC > specific limitation: > > 100mV < Vsram - Vproc < 200mV > > which is called 'voltage tracking' mechanism. And when scaling the > frequency of cluster clock input, the input MUX need to be parented to > another "intermediate" stable PLL first and reparented to the original > PLL once the original PLL is stable at the target frequency. This patch > implements those mechanisms to enable CPU DVFS support for Mediatek > MT8173 SoC. > > Signed-off-by: Pi-Cheng Chen > Acked-by: Viresh Kumar > --- > drivers/cpufreq/Kconfig.arm | 7 + > drivers/cpufreq/Makefile | 1 + > drivers/cpufreq/mt8173-cpufreq.c | 524 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 532 insertions(+) > create mode 100644 drivers/cpufreq/mt8173-cpufreq.c [...] > +static struct platform_driver mt8173_cpufreq_platdrv = { > + .driver = { > + .name = "mt8173-cpufreq", > + }, > + .probe = mt8173_cpufreq_probe, > +}; > + > +static int mt8173_cpufreq_driver_init(void) > +{ > + struct platform_device *pdev; > + int err; > + > + err = platform_driver_register(&mt8173_cpufreq_platdrv); > + if (err) > + return err; > + > + /* > + * Since there's no place to hold device registration code and no > + * device tree based way to match cpufreq driver yet, both the driver > + * and the device registration codes are put here to handle defer > + * probing. > + */ > + pdev = platform_device_register_simple("mt8173-cpufreq", -1, NULL, 0); This is not very friendly for multiplatform support (mt8173_cpufreq_driver_init() can be called on other platforms, i.e. Samsung Exynos7 one if ARCH_EXYNOS7 is also enabled in the kernel config). Why can't it be fixed with checking Device Tree with of_machine_is_compatible("mediatek,mt8173") (assuming that it can be used on arm64 like on arm32)? > + if (IS_ERR(pdev)) { > + pr_err("failed to register mtk-cpufreq platform device\n"); > + return PTR_ERR(pdev); > + } > + > + return 0; > +} > +device_initcall(mt8173_cpufreq_driver_init); Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/