diff options
author | Len Brown <len.brown@intel.com> | 2007-02-03 01:38:16 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-03 01:38:16 -0500 |
commit | eee3c859c486d4f110f154807430eaf825ff4a3d (patch) | |
tree | 8b378d16103b3d77a673e26fab0a6812459bab77 /drivers/acpi/osl.c | |
parent | 547352660506ab99d6b0bad58dea495bf3718cee (diff) | |
parent | fb5c3e1b6d304bcf5f8d697471e36f2fa8d53f1c (diff) |
Pull motherboard into test branch
Conflicts:
drivers/acpi/motherboard.c
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index a28f5b8972b4..0f6f3bcbc8eb 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -76,6 +76,54 @@ static acpi_osd_handler acpi_irq_handler; | |||
76 | static void *acpi_irq_context; | 76 | static void *acpi_irq_context; |
77 | static struct workqueue_struct *kacpid_wq; | 77 | static struct workqueue_struct *kacpid_wq; |
78 | 78 | ||
79 | static void __init acpi_request_region (struct acpi_generic_address *addr, | ||
80 | unsigned int length, char *desc) | ||
81 | { | ||
82 | struct resource *res; | ||
83 | |||
84 | if (!addr->address || !length) | ||
85 | return; | ||
86 | |||
87 | if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_IO) | ||
88 | res = request_region(addr->address, length, desc); | ||
89 | else if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) | ||
90 | res = request_mem_region(addr->address, length, desc); | ||
91 | } | ||
92 | |||
93 | static int __init acpi_reserve_resources(void) | ||
94 | { | ||
95 | acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length, | ||
96 | "ACPI PM1a_EVT_BLK"); | ||
97 | |||
98 | acpi_request_region(&acpi_gbl_FADT.xpm1b_event_block, acpi_gbl_FADT.pm1_event_length, | ||
99 | "ACPI PM1b_EVT_BLK"); | ||
100 | |||
101 | acpi_request_region(&acpi_gbl_FADT.xpm1a_control_block, acpi_gbl_FADT.pm1_control_length, | ||
102 | "ACPI PM1a_CNT_BLK"); | ||
103 | |||
104 | acpi_request_region(&acpi_gbl_FADT.xpm1b_control_block, acpi_gbl_FADT.pm1_control_length, | ||
105 | "ACPI PM1b_CNT_BLK"); | ||
106 | |||
107 | if (acpi_gbl_FADT.pm_timer_length == 4) | ||
108 | acpi_request_region(&acpi_gbl_FADT.xpm_timer_block, 4, "ACPI PM_TMR"); | ||
109 | |||
110 | acpi_request_region(&acpi_gbl_FADT.xpm2_control_block, acpi_gbl_FADT.pm2_control_length, | ||
111 | "ACPI PM2_CNT_BLK"); | ||
112 | |||
113 | /* Length of GPE blocks must be a non-negative multiple of 2 */ | ||
114 | |||
115 | if (!(acpi_gbl_FADT.gpe0_block_length & 0x1)) | ||
116 | acpi_request_region(&acpi_gbl_FADT.xgpe0_block, | ||
117 | acpi_gbl_FADT.gpe0_block_length, "ACPI GPE0_BLK"); | ||
118 | |||
119 | if (!(acpi_gbl_FADT.gpe1_block_length & 0x1)) | ||
120 | acpi_request_region(&acpi_gbl_FADT.xgpe1_block, | ||
121 | acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK"); | ||
122 | |||
123 | return 0; | ||
124 | } | ||
125 | device_initcall(acpi_reserve_resources); | ||
126 | |||
79 | acpi_status acpi_os_initialize(void) | 127 | acpi_status acpi_os_initialize(void) |
80 | { | 128 | { |
81 | return AE_OK; | 129 | return AE_OK; |