[PATCH v2 0/4] PCI: Add pci_power_t helper functions

From: Habil Eren Türker

Date: Thu Nov 19 2026 - 09:36:05 EST


This series introduces helper functions for accessing PCI power
states in the Power Management Control/Status register and
converts existing PMCSR accesses to use these helpers.

The helpers provide typed access to the PCI power state field,
including extraction, setting, and comparison operations.
The series also updates the Apple Airport reset quirk to use
the new comparison helper.

**Scope**

This series focuses on operations involving raw PCI PMCSR
values. Comparisons between values already typed as
`pci_power_t` are intentionally left unchanged, as they do
not involve raw register values.

If there is interest in introducing a separate set of
helpers for comparisons between `pci_power_t` values, I can
prepare that as a follow-up series.

The changes follow the discussion with Andy Shevchenko and
Bjorn Helgaas in response to the original Apple Airport quirk
patch.

Changes in v2:
- Add helpers for comparing PCI power states.
- Convert PCI core and quirk code to use the new helpers.
- Address review feedback.

This series is based on the discussion following the original
Apple Airport quirk patch:
https://lore.kernel.org/lkml/20261118161559.63617-1-habilerenturker@xxxxxxxxxxx/

LLM assistance was used for editing the cover letter and commit
descriptions. All changes were reviewed by the submitter.

Habil Eren Türker (4):
PCI: Add pci_power_t helper functions
PCI: Convert pci.c to pci_power_t helpers
PCI: Convert quirks.c to pci_power_t helpers
x86/quirks: Use pci_power_eq() in apple_airport_reset()

arch/x86/kernel/early-quirks.c | 6 +++---
drivers/pci/pci.c | 26 +++++++++++---------------
drivers/pci/quirks.c | 2 +-
include/linux/pci.h | 28 ++++++++++++++++++++++++++++
4 files changed, 43 insertions(+), 19 deletions(-)


base-commit: c054fccfff7ba1ad9d8913921f5a952bb32513cd
--
2.47.3