summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel_pmc_ipc.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-04-16 11:15:49 +0300
committerLee Jones <lee.jones@linaro.org>2020-04-24 11:18:25 +0100
commitb8da68f44f6dec243a4e9685af0ca0cdc1cd939c (patch)
tree4267027a13a0d32aea6fe872beb7778d3049af0a /drivers/platform/x86/intel_pmc_ipc.c
parent781adff21c841196e846a5a88505f80d04b06016 (diff)
platform/x86: intel_pmc_ipc: Move PCI IDs to intel_scu_pcidrv.c
The PCI probe driver in intel_pmc_ipc.c is a duplicate of what we already have in intel_scu_pcidrv.c with the exception that the later also creates SCU specific devices. Move the PCI IDs from the intel_pmc_ipc.c to intel_scu.c and use driver_data to detect whether SCU devices need to be created or not. Also update Kconfig entry to mention all platforms supported by the Intel SCU PCI driver and change dependency from X86_INTEL_MID to PCI which is more generic. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/platform/x86/intel_pmc_ipc.c')
-rw-r--r--drivers/platform/x86/intel_pmc_ipc.c61
1 files changed, 1 insertions, 60 deletions
diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c
index e4110df24490..16ca4ee9cdd5 100644
--- a/drivers/platform/x86/intel_pmc_ipc.c
+++ b/drivers/platform/x86/intel_pmc_ipc.c
@@ -17,7 +17,6 @@
#include <linux/interrupt.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/module.h>
-#include <linux/pci.h>
#include <linux/platform_device.h>
#include <asm/intel_pmc_ipc.h>
@@ -194,50 +193,6 @@ static int update_no_reboot_bit(void *priv, bool set)
PMC_CFG_NO_REBOOT_MASK, value);
}
-static int ipc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
-{
- struct intel_pmc_ipc_dev *pmc = &ipcdev;
- struct intel_scu_ipc_data scu_data = {};
- struct intel_scu_ipc_dev *scu;
- int ret;
-
- /* Only one PMC is supported */
- if (pmc->dev)
- return -EBUSY;
-
- spin_lock_init(&ipcdev.gcr_lock);
-
- ret = pcim_enable_device(pdev);
- if (ret)
- return ret;
-
- scu_data.mem = pdev->resource[0];
-
- scu = devm_intel_scu_ipc_register(&pdev->dev, &scu_data);
- if (IS_ERR(scu))
- return PTR_ERR(scu);
-
- pmc->dev = &pdev->dev;
-
- pci_set_drvdata(pdev, pmc);
-
- return 0;
-}
-
-static const struct pci_device_id ipc_pci_ids[] = {
- {PCI_VDEVICE(INTEL, 0x0a94), 0},
- {PCI_VDEVICE(INTEL, 0x1a94), 0},
- {PCI_VDEVICE(INTEL, 0x5a94), 0},
- { 0,}
-};
-MODULE_DEVICE_TABLE(pci, ipc_pci_ids);
-
-static struct pci_driver ipc_pci_driver = {
- .name = "intel_pmc_ipc",
- .id_table = ipc_pci_ids,
- .probe = ipc_pci_probe,
-};
-
static ssize_t intel_pmc_ipc_simple_cmd_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
@@ -673,25 +628,11 @@ static struct platform_driver ipc_plat_driver = {
static int __init intel_pmc_ipc_init(void)
{
- int ret;
-
- ret = platform_driver_register(&ipc_plat_driver);
- if (ret) {
- pr_err("Failed to register PMC ipc platform driver\n");
- return ret;
- }
- ret = pci_register_driver(&ipc_pci_driver);
- if (ret) {
- pr_err("Failed to register PMC ipc pci driver\n");
- platform_driver_unregister(&ipc_plat_driver);
- return ret;
- }
- return ret;
+ return platform_driver_register(&ipc_plat_driver);
}
static void __exit intel_pmc_ipc_exit(void)
{
- pci_unregister_driver(&ipc_pci_driver);
platform_driver_unregister(&ipc_plat_driver);
}