Resources: Split interrupt share/wake bits into two fields.

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.
This commit is contained in:
Robert Moore 2012-12-07 09:51:18 -08:00
parent 709f8bd702
commit e529dbfebc
3 changed files with 36 additions and 14 deletions

View File

@ -129,7 +129,7 @@
*
******************************************************************************/
ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] =
ACPI_RSCONVERT_INFO AcpiRsGetIrq[9] =
{
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
ACPI_RS_SIZE (ACPI_RESOURCE_IRQ),
@ -157,7 +157,7 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] =
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
/* Get flags: Triggering[0], Polarity[3], SharingAndWake[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),
@ -167,9 +167,13 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[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.WakeCapable),
AML_OFFSET (Irq.Flags),
5}
};
@ -179,7 +183,7 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] =
*
******************************************************************************/
ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] =
ACPI_RSCONVERT_INFO AcpiRsSetIrq[14] =
{
/* Start with a default descriptor of length 3 */
@ -193,7 +197,7 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] =
AML_OFFSET (Irq.IrqMask),
ACPI_RS_OFFSET (Data.Irq.InterruptCount)},
/* Set flags: Triggering[0], Polarity[3], SharingAndWake[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),
@ -203,10 +207,14 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[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.WakeCapable),
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)
@ -261,7 +269,7 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] =
*
******************************************************************************/
ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] =
ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[10] =
{
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ),
@ -273,7 +281,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] =
/*
* Flags: Producer/Consumer[0], Triggering[1], Polarity[2],
* SharingAndWake[3:4]
* Sharing[3], Wake[4]
*/
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.ProducerConsumer),
AML_OFFSET (ExtendedIrq.Flags),
@ -287,10 +295,14 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] =
AML_OFFSET (ExtendedIrq.Flags),
2},
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Sharable),
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Sharable),
AML_OFFSET (ExtendedIrq.Flags),
3},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.WakeCapable),
AML_OFFSET (ExtendedIrq.Flags),
4},
/* IRQ Table length (Byte4) */
{ACPI_RSC_COUNT, ACPI_RS_OFFSET (Data.ExtendedIrq.InterruptCount),

View File

@ -129,7 +129,7 @@
*
******************************************************************************/
ACPI_RSCONVERT_INFO AcpiRsConvertGpio[17] =
ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] =
{
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
@ -152,10 +152,14 @@ ACPI_RSCONVERT_INFO AcpiRsConvertGpio[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.IntFlags),
3},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.WakeCapable),
AML_OFFSET (Gpio.IntFlags),
4},
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction),
AML_OFFSET (Gpio.IntFlags),
0},

View File

@ -175,8 +175,11 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr
#define ACPI_EXCLUSIVE (UINT8) 0x00
#define ACPI_SHARED (UINT8) 0x01
#define ACPI_EXCLUSIVE_AND_WAKE (UINT8) 0x02
#define ACPI_SHARED_AND_WAKE (UINT8) 0x03
/* Wake */
#define ACPI_NOT_WAKE_CAPABLE (UINT8) 0x00
#define ACPI_WAKE_CAPABLE (UINT8) 0x01
/*
* DMA Attributes
@ -249,6 +252,7 @@ typedef struct acpi_resource_irq
UINT8 Triggering;
UINT8 Polarity;
UINT8 Sharable;
UINT8 WakeCapable;
UINT8 InterruptCount;
UINT8 Interrupts[1];
@ -474,6 +478,7 @@ typedef struct acpi_resource_extended_irq
UINT8 Triggering;
UINT8 Polarity;
UINT8 Sharable;
UINT8 WakeCapable;
UINT8 InterruptCount;
ACPI_RESOURCE_SOURCE ResourceSource;
UINT32 Interrupts[1];
@ -497,6 +502,7 @@ typedef struct acpi_resource_gpio
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
UINT8 PinConfig;
UINT8 Sharable; /* For values, see Interrupt Attributes above */
UINT8 WakeCapable; /* For values, see Interrupt Attributes above */
UINT8 IoRestriction;
UINT8 Triggering; /* For values, see Interrupt Attributes above */
UINT8 Polarity; /* For values, see Interrupt Attributes above */