aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rsirq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/resources/rsirq.c')
-rw-r--r--drivers/acpi/resources/rsirq.c45
1 files changed, 40 insertions, 5 deletions
diff --git a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c
index 5657f7b95039..a8805efc0366 100644
--- a/drivers/acpi/resources/rsirq.c
+++ b/drivers/acpi/resources/rsirq.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("rsirq")
52 * acpi_rs_get_irq 52 * acpi_rs_get_irq
53 * 53 *
54 ******************************************************************************/ 54 ******************************************************************************/
55struct acpi_rsconvert_info acpi_rs_get_irq[7] = { 55struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
56 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ, 56 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
57 ACPI_RS_SIZE(struct acpi_resource_irq), 57 ACPI_RS_SIZE(struct acpi_resource_irq),
58 ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)}, 58 ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)},
@@ -69,6 +69,12 @@ struct acpi_rsconvert_info acpi_rs_get_irq[7] = {
69 ACPI_EDGE_SENSITIVE, 69 ACPI_EDGE_SENSITIVE,
70 1}, 70 1},
71 71
72 /* Get the descriptor length (2 or 3 for IRQ descriptor) */
73
74 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.descriptor_length),
75 AML_OFFSET(irq.descriptor_type),
76 0},
77
72 /* All done if no flag byte present in descriptor */ 78 /* All done if no flag byte present in descriptor */
73 79
74 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3}, 80 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
@@ -94,7 +100,9 @@ struct acpi_rsconvert_info acpi_rs_get_irq[7] = {
94 * 100 *
95 ******************************************************************************/ 101 ******************************************************************************/
96 102
97struct acpi_rsconvert_info acpi_rs_set_irq[9] = { 103struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
104 /* Start with a default descriptor of length 3 */
105
98 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ, 106 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ,
99 sizeof(struct aml_resource_irq), 107 sizeof(struct aml_resource_irq),
100 ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)}, 108 ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)},
@@ -105,7 +113,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
105 AML_OFFSET(irq.irq_mask), 113 AML_OFFSET(irq.irq_mask),
106 ACPI_RS_OFFSET(data.irq.interrupt_count)}, 114 ACPI_RS_OFFSET(data.irq.interrupt_count)},
107 115
108 /* Set the flags byte by default */ 116 /* Set the flags byte */
109 117
110 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering), 118 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
111 AML_OFFSET(irq.flags), 119 AML_OFFSET(irq.flags),
@@ -118,6 +126,33 @@ struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
118 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), 126 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
119 AML_OFFSET(irq.flags), 127 AML_OFFSET(irq.flags),
120 4}, 128 4},
129
130 /*
131 * All done if the output descriptor length is required to be 3
132 * (i.e., optimization to 2 bytes cannot be attempted)
133 */
134 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
135 ACPI_RS_OFFSET(data.irq.descriptor_length),
136 3},
137
138 /* Set length to 2 bytes (no flags byte) */
139
140 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)},
141
142 /*
143 * All done if the output descriptor length is required to be 2.
144 *
145 * TBD: Perhaps we should check for error if input flags are not
146 * compatible with a 2-byte descriptor.
147 */
148 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
149 ACPI_RS_OFFSET(data.irq.descriptor_length),
150 2},
151
152 /* Reset length to 3 bytes (descriptor with flags byte) */
153
154 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)},
155
121 /* 156 /*
122 * Check if the flags byte is necessary. Not needed if the flags are: 157 * Check if the flags byte is necessary. Not needed if the flags are:
123 * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE 158 * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE
@@ -134,7 +169,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
134 ACPI_RS_OFFSET(data.irq.sharable), 169 ACPI_RS_OFFSET(data.irq.sharable),
135 ACPI_EXCLUSIVE}, 170 ACPI_EXCLUSIVE},
136 171
137 /* irq_no_flags() descriptor can be used */ 172 /* We can optimize to a 2-byte irq_no_flags() descriptor */
138 173
139 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)} 174 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)}
140}; 175};