From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: rjw@rjwysocki.net, mika.westerberg@linux.intel.com,
lv.zheng@intel.com, hpa@linux.intel.com
Cc: lenb@kernel.org, hdegoede@redhat.com, tj@kernel.org,
arnd@arndb.de, mjg59@srcf.ucam.org, gregkh@linuxfoundation.org,
hanjun.guo@linaro.org, al.stone@linaro.org,
graeme.gregory@linaro.org, leo.duran@amd.com,
linux-ide@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org
Subject: Re: [V4 PATCH 1/2] ACPI / scan: Add support for ACPI _CLS device matching
Date: Fri, 6 Mar 2015 10:31:59 -0600 [thread overview]
Message-ID: <54F9D67F.9040306@amd.com> (raw)
In-Reply-To: <1425284840-9233-2-git-send-email-Suravee.Suthikulpanit@amd.com>
On 3/2/2015 2:27 AM, Suravee Suthikulpanit wrote:
> 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[] = {
> { "", 0, PCI_CLASS_STORAGE_SATA_AHCI },
> {},
> };
>
> In this case, the corresponded entry in modules.alias file would be:
>
> alias acpi*:010601:* ahci_platform
>
> Signed-off-by: Suravee Suthikulpanit<Suravee.Suthikulpanit@amd.com>
> ---
> drivers/acpi/acpica/acutils.h | 3 ++
> drivers/acpi/acpica/nsxfname.c | 20 +++++++++--
> drivers/acpi/acpica/utids.c | 71 +++++++++++++++++++++++++++++++++++++++
> drivers/acpi/scan.c | 17 ++++++++--
> include/acpi/acnames.h | 1 +
> include/acpi/actypes.h | 4 ++-
> include/linux/mod_devicetable.h | 1 +
> scripts/mod/devicetable-offsets.c | 1 +
> scripts/mod/file2alias.c | 13 +++++--
> 9 files changed, 123 insertions(+), 8 deletions(-)
>
> [....]
>
> diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
> index b034f10..50d8019 100644
> --- a/include/acpi/actypes.h
> +++ b/include/acpi/actypes.h
> @@ -1148,7 +1148,7 @@ struct acpi_device_info {
> u32 name; /* ACPI object Name */
> acpi_object_type type; /* ACPI object Type */
> u8 param_count; /* If a method, required parameter count */
> - u8 valid; /* Indicates which optional fields are valid */
> + u16 valid; /* Indicates which optional fields are valid */
> u8 flags; /* Miscellaneous info */
> u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
> u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */
> @@ -1158,6 +1158,7 @@ struct acpi_device_info {
> struct acpi_pnp_device_id unique_id; /* _UID value */
> struct acpi_pnp_device_id subsystem_id; /* _SUB value */
> struct acpi_pnp_device_id_list compatible_id_list; /* _CID list <must be last> */
> + struct acpi_pnp_device_id cls; /* _CLS value */
> };
Please disregard this patch. I found out a mistake on my part here. I
have sent out V5 here (https://lkml.org/lkml/2015/3/6/24)
Thank you,
Suravee
next prev parent reply other threads:[~2015-03-06 16:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 8:27 [V4 PATCH 0/2] Introduce ACPI support for ahci_platform driver Suravee Suthikulpanit
2015-03-02 8:27 ` [V4 PATCH 1/2] ACPI / scan: Add support for ACPI _CLS device matching Suravee Suthikulpanit
2015-03-06 16:31 ` Suravee Suthikulanit [this message]
2015-03-02 8:27 ` [V4 PATCH 2/2] ata: ahci_platform: Add ACPI _CLS matching Suravee Suthikulpanit
2015-03-02 16:41 ` Tejun Heo
2015-03-02 16:52 ` Suthikulpanit, Suravee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F9D67F.9040306@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=al.stone@linaro.org \
--cc=arnd@arndb.de \
--cc=graeme.gregory@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hanjun.guo@linaro.org \
--cc=hdegoede@redhat.com \
--cc=hpa@linux.intel.com \
--cc=lenb@kernel.org \
--cc=leo.duran@amd.com \
--cc=linaro-acpi@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=mjg59@srcf.ucam.org \
--cc=rjw@rjwysocki.net \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).