WIP FPC-III support
[linux/fpc-iii.git] / drivers / platform / x86 / intel_scu_pcidrv.c
blob8c5fd8240da958395299fbf1783f16a5c332f30e
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * PCI driver for the Intel SCU.
5 * Copyright (C) 2008-2010, 2015, 2020 Intel Corporation
6 * Authors: Sreedhara DS (sreedhara.ds@intel.com)
7 * Mika Westerberg <mika.westerberg@linux.intel.com>
8 */
10 #include <linux/errno.h>
11 #include <linux/init.h>
12 #include <linux/pci.h>
14 #include <asm/intel-mid.h>
15 #include <asm/intel_scu_ipc.h>
17 static int intel_scu_pci_probe(struct pci_dev *pdev,
18 const struct pci_device_id *id)
20 void (*setup_fn)(void) = (void (*)(void))id->driver_data;
21 struct intel_scu_ipc_data scu_data = {};
22 struct intel_scu_ipc_dev *scu;
23 int ret;
25 ret = pcim_enable_device(pdev);
26 if (ret)
27 return ret;
29 scu_data.mem = pdev->resource[0];
30 scu_data.irq = pdev->irq;
32 scu = intel_scu_ipc_register(&pdev->dev, &scu_data);
33 if (IS_ERR(scu))
34 return PTR_ERR(scu);
36 if (setup_fn)
37 setup_fn();
38 return 0;
41 static void intel_mid_scu_setup(void)
43 intel_scu_devices_create();
46 static const struct pci_device_id pci_ids[] = {
47 { PCI_VDEVICE(INTEL, 0x080e),
48 .driver_data = (kernel_ulong_t)intel_mid_scu_setup },
49 { PCI_VDEVICE(INTEL, 0x08ea),
50 .driver_data = (kernel_ulong_t)intel_mid_scu_setup },
51 { PCI_VDEVICE(INTEL, 0x0a94) },
52 { PCI_VDEVICE(INTEL, 0x11a0),
53 .driver_data = (kernel_ulong_t)intel_mid_scu_setup },
54 { PCI_VDEVICE(INTEL, 0x1a94) },
55 { PCI_VDEVICE(INTEL, 0x5a94) },
59 static struct pci_driver intel_scu_pci_driver = {
60 .driver = {
61 .suppress_bind_attrs = true,
63 .name = "intel_scu",
64 .id_table = pci_ids,
65 .probe = intel_scu_pci_probe,
68 builtin_pci_driver(intel_scu_pci_driver);