hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/acpi/pci_link.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * pci_link.c - ACPI PCI Interrupt Link Device Driver ($Revision: 34 $)
34 *
....@@ -5,22 +6,8 @@
56 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
67 * Copyright (C) 2002 Dominik Brodowski <devel@brodo.de>
78 *
8
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or (at
13
- * your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful, but
16
- * WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
20
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
- *
22
- * TBD:
23
- * 1. Support more than one IRQ resource entry per link device (index).
9
+ * TBD:
10
+ * 1. Support more than one IRQ resource entry per link device (index).
2411 * 2. Implement start/stop mechanism and use ACPI Bus Driver facilities
2512 * for IRQ management (e.g. start()->_SRS).
2613 */
....@@ -44,8 +31,6 @@
4431 ACPI_MODULE_NAME("pci_link");
4532 #define ACPI_PCI_LINK_CLASS "pci_irq_routing"
4633 #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link"
47
-#define ACPI_PCI_LINK_FILE_INFO "info"
48
-#define ACPI_PCI_LINK_FILE_STATUS "state"
4934 #define ACPI_PCI_LINK_MAX_POSSIBLE 16
5035
5136 static int acpi_pci_link_add(struct acpi_device *device,
....@@ -264,8 +249,8 @@
264249 }
265250 }
266251
267
- /*
268
- * Query and parse _CRS to get the current IRQ assignment.
252
+ /*
253
+ * Query and parse _CRS to get the current IRQ assignment.
269254 */
270255
271256 status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS,
....@@ -317,10 +302,10 @@
317302 resource->res.data.irq.polarity =
318303 link->irq.polarity;
319304 if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
320
- resource->res.data.irq.sharable =
305
+ resource->res.data.irq.shareable =
321306 ACPI_EXCLUSIVE;
322307 else
323
- resource->res.data.irq.sharable = ACPI_SHARED;
308
+ resource->res.data.irq.shareable = ACPI_SHARED;
324309 resource->res.data.irq.interrupt_count = 1;
325310 resource->res.data.irq.interrupts[0] = irq;
326311 break;
....@@ -335,10 +320,10 @@
335320 resource->res.data.extended_irq.polarity =
336321 link->irq.polarity;
337322 if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
338
- resource->res.data.irq.sharable =
323
+ resource->res.data.extended_irq.shareable =
339324 ACPI_EXCLUSIVE;
340325 else
341
- resource->res.data.irq.sharable = ACPI_SHARED;
326
+ resource->res.data.extended_irq.shareable = ACPI_SHARED;
342327 resource->res.data.extended_irq.interrupt_count = 1;
343328 resource->res.data.extended_irq.interrupts[0] = irq;
344329 /* ignore resource_source, it's optional */
....@@ -411,7 +396,7 @@
411396 /*
412397 * "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt
413398 * Link Devices to move the PIRQs around to minimize sharing.
414
- *
399
+ *
415400 * "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs
416401 * that the BIOS has already set to active. This is necessary because
417402 * ACPI has no automatic means of knowing what ISA IRQs are used. Note that
....@@ -429,7 +414,7 @@
429414 *
430415 * Note that PCI IRQ routers have a list of possible IRQs,
431416 * which may not include the IRQs this table says are available.
432
- *
417
+ *
433418 * Since this heuristic can't tell the difference between a link
434419 * that no device will attach to, vs. a link which may be shared
435420 * by multiple active devices -- it is not optimal.
....@@ -674,7 +659,7 @@
674659 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
675660 "Link %s is referenced\n",
676661 acpi_device_bid(link->device)));
677
- return (link->irq.active);
662
+ return link->irq.active;
678663 }
679664
680665 /*
....@@ -725,7 +710,7 @@
725710 acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL);
726711
727712 mutex_unlock(&acpi_link_lock);
728
- return (link->irq.active);
713
+ return link->irq.active;
729714 }
730715
731716 /* --------------------------------------------------------------------------