ACPICA: Resources: Split interrupt share/wake bits into two fields.
authorBob Moore <robert.moore@intel.com>
Mon, 31 Dec 2012 00:07:31 +0000 (00:07 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Jan 2013 11:36:22 +0000 (12:36 +0100)
These two bits are merged at the external interface level for the
IRQ, Interrupt, and GpioInt resource descriptors. However, these
bits are logically independent and there is no need to keep them
merged internally. Therefore, this change splits the bits into
"sharable" and "wake capable" fields within the resource manager.
This simplifies drive code that needs to examine these bits.
Aaron Lu, Bob Moore.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/rsirq.c
drivers/acpi/acpica/rsserial.c
include/acpi/acrestyp.h

index f3733ee0cac8ac6d99dda298eface11fa67db405..9c1d74a8a6787a286cad476232d5d0f75ce406c3 100644 (file)
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsirq")
  * acpi_rs_get_irq
  *
  ******************************************************************************/
-struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
+struct acpi_rsconvert_info acpi_rs_get_irq[9] = {
        {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
         ACPI_RS_SIZE(struct acpi_resource_irq),
         ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)},
@@ -80,7 +80,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
 
        {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
 
-       /* Get flags: Triggering[0], Polarity[3], sharing_and_wake[4:5] */
+       /* Get flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
 
        {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
         AML_OFFSET(irq.flags),
@@ -90,9 +90,13 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
         AML_OFFSET(irq.flags),
         3},
 
-       {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
         AML_OFFSET(irq.flags),
-        4}
+        4},
+
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable),
+        AML_OFFSET(irq.flags),
+        5}
 };
 
 /*******************************************************************************
@@ -101,7 +105,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
  *
  ******************************************************************************/
 
-struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
+struct acpi_rsconvert_info acpi_rs_set_irq[14] = {
        /* Start with a default descriptor of length 3 */
 
        {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ,
@@ -114,7 +118,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
         AML_OFFSET(irq.irq_mask),
         ACPI_RS_OFFSET(data.irq.interrupt_count)},
 
-       /* Set flags: Triggering[0], Polarity[3], sharing_and_wake[4:5] */
+       /* Set flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
 
        {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
         AML_OFFSET(irq.flags),
@@ -124,10 +128,14 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
         AML_OFFSET(irq.flags),
         3},
 
-       {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
         AML_OFFSET(irq.flags),
         4},
 
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable),
+        AML_OFFSET(irq.flags),
+        5},
+
        /*
         * All done if the output descriptor length is required to be 3
         * (i.e., optimization to 2 bytes cannot be attempted)
@@ -181,7 +189,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
  *
  ******************************************************************************/
 
-struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
+struct acpi_rsconvert_info acpi_rs_convert_ext_irq[10] = {
        {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
         ACPI_RS_SIZE(struct acpi_resource_extended_irq),
         ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_irq)},
@@ -192,7 +200,7 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
 
        /*
         * Flags: Producer/Consumer[0], Triggering[1], Polarity[2],
-        *        sharing_and_wake[3:4]
+        *        Sharing[3], Wake[4]
         */
        {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.producer_consumer),
         AML_OFFSET(extended_irq.flags),
@@ -206,10 +214,14 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
         AML_OFFSET(extended_irq.flags),
         2},
 
-       {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
         AML_OFFSET(extended_irq.flags),
         3},
 
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.wake_capable),
+        AML_OFFSET(extended_irq.flags),
+        4},
+
        /* IRQ Table length (Byte4) */
 
        {ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count),
index 9aa5e689b4441cf244d4d08ce780f21e14bffa94..197bab0248e6b85aed31827d96984d50e07f0ddc 100644 (file)
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsserial")
  * acpi_rs_convert_gpio
  *
  ******************************************************************************/
-struct acpi_rsconvert_info acpi_rs_convert_gpio[17] = {
+struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = {
        {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
         ACPI_RS_SIZE(struct acpi_resource_gpio),
         ACPI_RSC_TABLE_SIZE(acpi_rs_convert_gpio)},
@@ -75,10 +75,14 @@ struct acpi_rsconvert_info acpi_rs_convert_gpio[17] = {
         AML_OFFSET(gpio.flags),
         0},
 
-       {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
         AML_OFFSET(gpio.int_flags),
         3},
 
+       {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.wake_capable),
+        AML_OFFSET(gpio.int_flags),
+        4},
+
        {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.io_restriction),
         AML_OFFSET(gpio.int_flags),
         0},
index 17f2d050604e3b546064ae0094bc4414fab44cff..b58c3cb6dc16ceecc8711772d59903a245449de9 100644 (file)
@@ -102,8 +102,11 @@ typedef u32 acpi_rsdesc_size;      /* Max Resource Descriptor size is (Length+3) = (6
 
 #define ACPI_EXCLUSIVE                  (u8) 0x00
 #define ACPI_SHARED                     (u8) 0x01
-#define ACPI_EXCLUSIVE_AND_WAKE         (u8) 0x02
-#define ACPI_SHARED_AND_WAKE            (u8) 0x03
+
+/* Wake */
+
+#define ACPI_NOT_WAKE_CAPABLE           (u8) 0x00
+#define ACPI_WAKE_CAPABLE               (u8) 0x01
 
 /*
  * DMA Attributes
@@ -171,6 +174,7 @@ struct acpi_resource_irq {
        u8 triggering;
        u8 polarity;
        u8 sharable;
+       u8 wake_capable;
        u8 interrupt_count;
        u8 interrupts[1];
 };
@@ -346,6 +350,7 @@ struct acpi_resource_extended_irq {
        u8 triggering;
        u8 polarity;
        u8 sharable;
+       u8 wake_capable;
        u8 interrupt_count;
        struct acpi_resource_source resource_source;
        u32 interrupts[1];
@@ -365,6 +370,7 @@ struct acpi_resource_gpio {
        u8 producer_consumer;   /* For values, see Producer/Consumer above */
        u8 pin_config;
        u8 sharable;            /* For values, see Interrupt Attributes above */
+       u8 wake_capable;        /* For values, see Interrupt Attributes above */
        u8 io_restriction;
        u8 triggering;          /* For values, see Interrupt Attributes above */
        u8 polarity;            /* For values, see Interrupt Attributes above */