aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/pmc_atom.c
diff options
context:
space:
mode:
authorDavid Müller <dave.mueller@gmx.ch>2019-04-08 09:33:54 -0400
committerStephen Boyd <sboyd@kernel.org>2019-04-10 18:54:12 -0400
commit7c2e07130090ae001a97a6b65597830d6815e93e (patch)
tree49390d3305bda6d110ad8a71a871d36bc43192b3 /drivers/platform/x86/pmc_atom.c
parent9f842abde84d4232d7a1951952dc148bd83f9ada (diff)
clk: x86: Add system specific quirk to mark clocks as critical
Since commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL"), the pmc_plt_clocks of the Bay Trail SoC are unconditionally gated off. Unfortunately this will break systems where these clocks are used for external purposes beyond the kernel's knowledge. Fix it by implementing a system specific quirk to mark the necessary pmc_plt_clks as critical. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Signed-off-by: David Müller <dave.mueller@gmx.ch> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/platform/x86/pmc_atom.c')
-rw-r--r--drivers/platform/x86/pmc_atom.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
index 8f018b3f3cd4..eaec2d306481 100644
--- a/drivers/platform/x86/pmc_atom.c
+++ b/drivers/platform/x86/pmc_atom.c
@@ -17,6 +17,7 @@
17 17
18#include <linux/debugfs.h> 18#include <linux/debugfs.h>
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/dmi.h>
20#include <linux/init.h> 21#include <linux/init.h>
21#include <linux/io.h> 22#include <linux/io.h>
22#include <linux/platform_data/x86/clk-pmc-atom.h> 23#include <linux/platform_data/x86/clk-pmc-atom.h>
@@ -391,11 +392,27 @@ static int pmc_dbgfs_register(struct pmc_dev *pmc)
391} 392}
392#endif /* CONFIG_DEBUG_FS */ 393#endif /* CONFIG_DEBUG_FS */
393 394
395/*
396 * Some systems need one or more of their pmc_plt_clks to be
397 * marked as critical.
398 */
399static const struct dmi_system_id critclk_systems[] __initconst = {
400 {
401 .ident = "MPL CEC1x",
402 .matches = {
403 DMI_MATCH(DMI_SYS_VENDOR, "MPL AG"),
404 DMI_MATCH(DMI_PRODUCT_NAME, "CEC10 Family"),
405 },
406 },
407 { /*sentinel*/ }
408};
409
394static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap, 410static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap,
395 const struct pmc_data *pmc_data) 411 const struct pmc_data *pmc_data)
396{ 412{
397 struct platform_device *clkdev; 413 struct platform_device *clkdev;
398 struct pmc_clk_data *clk_data; 414 struct pmc_clk_data *clk_data;
415 const struct dmi_system_id *d = dmi_first_match(critclk_systems);
399 416
400 clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); 417 clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
401 if (!clk_data) 418 if (!clk_data)
@@ -403,6 +420,10 @@ static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap,
403 420
404 clk_data->base = pmc_regmap; /* offset is added by client */ 421 clk_data->base = pmc_regmap; /* offset is added by client */
405 clk_data->clks = pmc_data->clks; 422 clk_data->clks = pmc_data->clks;
423 if (d) {
424 clk_data->critical = true;
425 pr_info("%s critclks quirk enabled\n", d->ident);
426 }
406 427
407 clkdev = platform_device_register_data(&pdev->dev, "clk-pmc-atom", 428 clkdev = platform_device_register_data(&pdev->dev, "clk-pmc-atom",
408 PLATFORM_DEVID_NONE, 429 PLATFORM_DEVID_NONE,