2 * Intel(R) Trace Hub pci driver
4 * Copyright (C) 2014-2015 Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18 #include <linux/types.h>
19 #include <linux/module.h>
20 #include <linux/device.h>
21 #include <linux/sysfs.h>
22 #include <linux/pci.h>
26 #define DRIVER_NAME "intel_th_pci"
28 #define BAR_MASK (BIT(TH_MMIO_CONFIG) | BIT(TH_MMIO_SW))
30 static int intel_th_pci_probe(struct pci_dev *pdev,
31 const struct pci_device_id *id)
36 err = pcim_enable_device(pdev);
40 err = pcim_iomap_regions_request_all(pdev, BAR_MASK, DRIVER_NAME);
44 th = intel_th_alloc(&pdev->dev, pdev->resource,
45 DEVICE_COUNT_RESOURCE, pdev->irq);
52 static void intel_th_pci_remove(struct pci_dev *pdev)
54 struct intel_th *th = pci_get_drvdata(pdev);
59 static const struct pci_device_id intel_th_pci_id_table[] = {
61 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9d26),
62 .driver_data = (kernel_ulong_t)0,
65 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa126),
66 .driver_data = (kernel_ulong_t)0,
70 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a8e),
71 .driver_data = (kernel_ulong_t)0,
75 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0a80),
76 .driver_data = (kernel_ulong_t)0,
80 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1a8e),
81 .driver_data = (kernel_ulong_t)0,
85 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa2a6),
86 .driver_data = (kernel_ulong_t)0,
90 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa326),
91 .driver_data = (kernel_ulong_t)0,
95 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9da6),
96 .driver_data = (kernel_ulong_t)0,
100 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x318e),
101 .driver_data = (kernel_ulong_t)0,
106 MODULE_DEVICE_TABLE(pci, intel_th_pci_id_table);
108 static struct pci_driver intel_th_pci_driver = {
110 .id_table = intel_th_pci_id_table,
111 .probe = intel_th_pci_probe,
112 .remove = intel_th_pci_remove,
115 module_pci_driver(intel_th_pci_driver);
117 MODULE_LICENSE("GPL v2");
118 MODULE_DESCRIPTION("Intel(R) Trace Hub PCI controller driver");
119 MODULE_AUTHOR("Alexander Shishkin <alexander.shishkin@intel.com>");