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-mid.h>
15 #include <asm/intel_scu_ipc.h>
16 
17 static int intel_scu_pci_probe(struct pci_dev *pdev,
18 			       const struct pci_device_id *id)
19 {
20 	struct intel_scu_ipc_data scu_data = {};
21 	struct intel_scu_ipc_dev *scu;
22 	int ret;
23 
24 	ret = pcim_enable_device(pdev);
25 	if (ret)
26 		return ret;
27 
28 	scu_data.mem = pdev->resource[0];
29 	scu_data.irq = pdev->irq;
30 
31 	scu = intel_scu_ipc_register(&pdev->dev, &scu_data);
32 	return PTR_ERR_OR_ZERO(scu);
33 }
34 
35 static const struct pci_device_id pci_ids[] = {
36 	{ PCI_VDEVICE(INTEL, 0x080e) },
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