Hi Tianyu, On Wed, 22 Aug 2012 15:05:38 +0800 Lan Tianyu <tianyu.lan@xxxxxxxxx> wrote: > On 2012年08月22日 14:24, Feng Tang wrote: > > This patch is on top of the ACPICA 20120816 release, which implemented > > a native way to decode PLD buffer, so use it instead of leting upper > > level users do the decoding. > > > > Signed-off-by: Feng Tang <feng.tang@xxxxxxxxx> > > Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx> > > --- > > drivers/acpi/utils.c | 11 +++++++---- > > include/acpi/acpi_bus.h | 31 +------------------------------ > > 2 files changed, 8 insertions(+), 34 deletions(-) > > > > diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c > > index 3e87c9c..e697bf2 100644 > > --- a/drivers/acpi/utils.c > > +++ b/drivers/acpi/utils.c > > @@ -384,7 +384,7 @@ acpi_evaluate_reference(acpi_handle handle, > > EXPORT_SYMBOL(acpi_evaluate_reference); > > > > acpi_status > > -acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld) > > +acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld) > Sorry. I have not found the definition of struct acpi_pld_info or is > there something I have missed? The definition is in the ACPICA 20120816 patch sets I just posted to linux-acpi list. Let me copy it here + +/* + * Note: C bitfields are not used for this reason: + * + * "Bitfields are great and easy to read, but unfortunately the C language + * does not specify the layout of bitfields in memory, which means they are + * essentially useless for dealing with packed data in on-disk formats or + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, + * this decision was a design error in C. Ritchie could have picked an order + * and stuck with it." Norman Ramsey. + * See http://stackoverflow.com/a/1053662/41661 + */ + +/* + * Formatted _PLD return value. The minimum size is a package containing + * one buffer. + * Revision 1: Buffer is 16 bytes (128 bits) + * Revision 2: Buffer is 20 bytes (160 bits) + * + * Note: This structure is returned from the acpi_decode_pld_buffer + * interface. + */ +struct acpi_pld_info { + u8 revision; + u8 ignore_color; + u32 color; + u16 width; + u16 height; + u8 user_visible; + u8 dock; + u8 lid; + u8 panel; + u8 vertical_position; + u8 horizontal_position; + u8 shape; + u8 group_orientation; + u8 group_token; + u8 group_position; + u8 bay; + u8 ejectable; + u8 ospm_eject_required; + u8 cabinet_number; + u8 card_cage_number; + u8 reference; + u8 rotation; + u8 order; + u8 reserved; + u16 vertical_offset; + u16 horizontal_offset; +}; + +/* -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html