xref: /linux/drivers/platform/x86/intel_scu_pcidrv.c (revision 4b660dbd9ee2059850fd30e0df420ca7a38a1856)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * PCI driver for the Intel SCU.
4  *
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  */
9 
10 #include <linux/errno.h>
11 #include <linux/init.h>
12 #include <linux/pci.h>
13 
14 #include <asm/intel_scu_ipc.h>
15 
16 static int intel_scu_pci_probe(struct pci_dev *pdev,
17 			       const struct pci_device_id *id)
18 {
19 	struct intel_scu_ipc_data scu_data = {};
20 	struct intel_scu_ipc_dev *scu;
21 	int ret;
22 
23 	ret = pcim_enable_device(pdev);
24 	if (ret)
25 		return ret;
26 
27 	scu_data.mem = pdev->resource[0];
28 	scu_data.irq = pdev->irq;
29 
30 	scu = intel_scu_ipc_register(&pdev->dev, &scu_data);
31 	return PTR_ERR_OR_ZERO(scu);
32 }
33 
34 static const struct pci_device_id pci_ids[] = {
35 	{ PCI_VDEVICE(INTEL, 0x080e) },
36 	{ PCI_VDEVICE(INTEL, 0x082a) },
37 	{ PCI_VDEVICE(INTEL, 0x08ea) },
38 	{ PCI_VDEVICE(INTEL, 0x0a94) },
39 	{ PCI_VDEVICE(INTEL, 0x11a0) },
40 	{ PCI_VDEVICE(INTEL, 0x1a94) },
41 	{ PCI_VDEVICE(INTEL, 0x5a94) },
42 	{}
43 };
44 
45 static struct pci_driver intel_scu_pci_driver = {
46 	.driver = {
47 		.suppress_bind_attrs = true,
48 	},
49 	.name = "intel_scu",
50 	.id_table = pci_ids,
51 	.probe = intel_scu_pci_probe,
52 };
53 
54 builtin_pci_driver(intel_scu_pci_driver);
55