Add set_current_resources() which will be used to configure device resources

from settings retrieved through get_{current|possible}_resources().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41382 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2011-05-08 12:13:55 +00:00
parent 6baeabf916
commit ce57718d12
4 changed files with 16 additions and 0 deletions

View File

@ -242,6 +242,8 @@ struct acpi_module_info {
acpi_data *retBuffer);
status_t (*get_possible_resources)(acpi_handle busDeviceHandle,
acpi_data *retBuffer);
status_t (*set_current_resources)(acpi_handle busDeviceHandle,
acpi_data *buffer);
/* Power state setting */

View File

@ -625,6 +625,14 @@ get_possible_resources(acpi_handle busDeviceHandle, acpi_data *retBuffer)
}
status_t
set_current_resources(acpi_handle busDeviceHandle, acpi_data *buffer)
{
return AcpiSetCurrentResources(busDeviceHandle, (ACPI_BUFFER*)buffer)
== AE_OK ? B_OK : B_ERROR;
}
status_t
prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size)
{
@ -741,6 +749,7 @@ struct acpi_module_info gACPIModule = {
get_irq_routing_table,
get_current_resources,
get_possible_resources,
set_current_resources,
prepare_sleep_state,
enter_sleep_state,
reboot

View File

@ -216,6 +216,7 @@ static struct acpi_root_info sACPIRootModule = {
get_irq_routing_table,
get_current_resources,
get_possible_resources,
set_current_resources,
prepare_sleep_state,
enter_sleep_state,
reboot

View File

@ -125,6 +125,8 @@ typedef struct acpi_root_info {
acpi_data *retBuffer);
status_t (*get_possible_resources)(acpi_handle busDeviceHandle,
acpi_data *retBuffer);
status_t (*set_current_resources)(acpi_handle busDeviceHandle,
acpi_data *buffer);
/* Power state setting */
@ -200,6 +202,8 @@ status_t get_current_resources(acpi_handle busDeviceHandle,
acpi_data* returnValue);
status_t get_possible_resources(acpi_handle busDeviceHandle,
acpi_data* returnValue);
status_t set_current_resources(acpi_handle busDeviceHandle,
acpi_data* buffer);
status_t prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size);
status_t enter_sleep_state(uint8 state);