Commit 750e0f57 authored by Rajneesh Bhardwaj's avatar Rajneesh Bhardwaj Committed by Andy Shevchenko

platform/x86: intel_pmc_core: Refactor debugfs entries

When on a platform if we can't show MPHY and PLL status, don't even bother
to create a debugfs entry as it will fail anyway. In fact unless OEM builds
a special BIOS for test, it will fail on every production system.

This will help to add future platform support where we can't support these
entries.
Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarRajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 7dc5ff66
...@@ -407,43 +407,33 @@ static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev) ...@@ -407,43 +407,33 @@ static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
{ {
struct dentry *dir, *file; struct dentry *dir;
dir = debugfs_create_dir("pmc_core", NULL); dir = debugfs_create_dir("pmc_core", NULL);
if (!dir) if (!dir)
return -ENOMEM; return -ENOMEM;
pmcdev->dbgfs_dir = dir; pmcdev->dbgfs_dir = dir;
file = debugfs_create_file("slp_s0_residency_usec", 0444,
dir, pmcdev, &pmc_core_dev_state);
if (!file)
goto err;
file = debugfs_create_file("pch_ip_power_gating_status", 0444,
dir, pmcdev, &pmc_core_ppfear_ops);
if (!file)
goto err;
file = debugfs_create_file("mphy_core_lanes_power_gating_status", 0444,
dir, pmcdev, &pmc_core_mphy_pg_ops);
if (!file)
goto err;
file = debugfs_create_file("pll_status", 0444, dir, pmcdev,
&pmc_core_pll_ops);
if (!file)
goto err;
file = debugfs_create_file("ltr_ignore", 0644, dir, pmcdev, debugfs_create_file("slp_s0_residency_usec", 0444, dir, pmcdev,
&pmc_core_dev_state);
debugfs_create_file("pch_ip_power_gating_status", 0444, dir, pmcdev,
&pmc_core_ppfear_ops);
debugfs_create_file("ltr_ignore", 0644, dir, pmcdev,
&pmc_core_ltr_ignore_ops); &pmc_core_ltr_ignore_ops);
if (!file) if (pmcdev->map->pll_sts)
goto err; debugfs_create_file("pll_status", 0444, dir, pmcdev,
&pmc_core_pll_ops);
if (pmcdev->map->mphy_sts)
debugfs_create_file("mphy_core_lanes_power_gating_status",
0444, dir, pmcdev,
&pmc_core_mphy_pg_ops);
return 0; return 0;
err:
pmc_core_dbgfs_unregister(pmcdev);
return -ENODEV;
} }
#else #else
static inline int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) static inline int pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment