linux/scripts/mod
Suthikulpanit, Suravee 26095a01d3 ACPI / scan: Add support for ACPI _CLS device matching
Device drivers typically use ACPI _HIDs/_CIDs listed in struct device_driver
acpi_match_table to match devices. However, for generic drivers, we do not
want to list _HID for all supported devices. Also, certain classes of devices
do not have _CID (e.g. SATA, USB). Instead, we can leverage ACPI _CLS,
which specifies PCI-defined class code (i.e. base-class, subclass and
programming interface). This patch adds support for matching ACPI devices using
the _CLS method.

To support loadable module, current design uses _HID or _CID to match device's
modalias. With the new way of matching with _CLS this would requires modification
to the current ACPI modalias key to include _CLS. This patch appends PCI-defined
class-code to the existing ACPI modalias as following.

    acpi:<HID>:<CID1>:<CID2>:..:<CIDn>:<bbsspp>:
E.g:
    # cat /sys/devices/platform/AMDI0600:00/modalias
    acpi:AMDI0600:010601:

where bb is th base-class code, ss is te sub-class code, and pp is the
programming interface code

Since there would not be _HID/_CID in the ACPI matching table of the driver,
this patch adds a field to acpi_device_id to specify the matching _CLS.

    static const struct acpi_device_id ahci_acpi_match[] = {
        { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
        {},
    };

In this case, the corresponded entry in modules.alias file would be:

    alias acpi*:010601:* ahci_platform

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-07-07 01:55:20 +02:00
..
.gitignore kbuild: trivial - remove trailing empty lines 2014-06-10 00:04:06 +02:00
devicetable-offsets.c ACPI / scan: Add support for ACPI _CLS device matching 2015-07-07 01:55:20 +02:00
empty.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file2alias.c ACPI / scan: Add support for ACPI _CLS device matching 2015-07-07 01:55:20 +02:00
Makefile improve modalias building 2013-06-28 00:48:16 +02:00
mk_elfconfig.c kbuild: trivial - remove trailing empty lines 2014-06-10 00:04:06 +02:00
modpost.c modpost: don't emit section mismatch warnings for compiler optimizations 2015-04-22 17:31:34 +09:30
modpost.h Kbuild, lto: Drop .number postfixes in modpost 2014-02-13 20:24:58 -08:00
sumversion.c kbuild: trivial - use tabs for code indent where possible 2014-06-10 14:00:53 +02:00