Lines Matching refs:handle

135 static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,  in acpi_bus_offline()  argument
143 if (acpi_bus_get_device(handle, &device)) in acpi_bus_offline()
180 static acpi_status acpi_bus_online(acpi_handle handle, u32 lvl, void *data, in acpi_bus_online() argument
186 if (acpi_bus_get_device(handle, &device)) in acpi_bus_online()
204 acpi_handle handle = device->handle; in acpi_scan_try_to_offline() local
217 status = acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_scan_try_to_offline()
222 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_scan_try_to_offline()
226 acpi_bus_offline(handle, 0, (void *)false, (void **)&errdev); in acpi_scan_try_to_offline()
229 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_scan_try_to_offline()
233 acpi_bus_offline(handle, 0, (void *)true, in acpi_scan_try_to_offline()
238 acpi_bus_online(handle, 0, NULL, NULL); in acpi_scan_try_to_offline()
239 acpi_walk_namespace(ACPI_TYPE_ANY, handle, in acpi_scan_try_to_offline()
250 acpi_handle handle = device->handle; in acpi_scan_hot_remove() local
263 acpi_handle_debug(handle, "Ejecting\n"); in acpi_scan_hot_remove()
267 acpi_evaluate_lck(handle, 0); in acpi_scan_hot_remove()
271 status = acpi_evaluate_ej0(handle); in acpi_scan_hot_remove()
281 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); in acpi_scan_hot_remove()
283 acpi_handle_warn(handle, in acpi_scan_hot_remove()
286 acpi_handle_warn(handle, in acpi_scan_hot_remove()
321 error = acpi_bus_scan(adev->handle); in acpi_scan_device_check()
350 error = acpi_bus_scan(adev->handle); in acpi_scan_bus_check()
376 acpi_evaluate_ost(adev->handle, ACPI_NOTIFY_EJECT_REQUEST, in acpi_generic_hotplug_event()
396 if (adev->handle == INVALID_ACPI_HANDLE) in acpi_device_hotplug()
434 acpi_evaluate_ost(adev->handle, src, ost_code, NULL); in acpi_device_hotplug()
547 static void acpi_scan_drop_device(acpi_handle handle, void *context) in acpi_scan_drop_device() argument
569 adev->handle = INVALID_ACPI_HANDLE; in acpi_scan_drop_device()
574 static struct acpi_device *handle_to_device(acpi_handle handle, in handle_to_device() argument
580 status = acpi_get_data_full(handle, acpi_scan_drop_device, in handle_to_device()
583 acpi_handle_debug(handle, "No context!\n"); in handle_to_device()
589 int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) in acpi_bus_get_device() argument
594 *device = handle_to_device(handle, NULL); in acpi_bus_get_device()
607 struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle) in acpi_bus_get_acpi_device() argument
609 return handle_to_device(handle, get_acpi_device); in acpi_bus_get_acpi_device()
642 acpi_handle handle = adev->handle; in acpi_tie_acpi_dev() local
645 if (!handle) in acpi_tie_acpi_dev()
648 status = acpi_attach_data(handle, acpi_scan_drop_device, adev); in acpi_tie_acpi_dev()
650 acpi_handle_err(handle, "Unable to attach device data\n"); in acpi_tie_acpi_dev()
746 acpi_detach_data(device->handle, acpi_scan_drop_device); in __acpi_device_add()
800 static struct acpi_device *acpi_bus_get_parent(acpi_handle handle) in acpi_bus_get_parent() argument
810 if (!handle) in acpi_bus_get_parent()
814 status = acpi_get_parent(handle, &handle); in acpi_bus_get_parent()
817 } while (acpi_bus_get_device(handle, &device)); in acpi_bus_get_parent()
822 acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd) in acpi_bus_get_ejd() argument
829 status = acpi_get_handle(handle, "_EJD", &tmp); in acpi_bus_get_ejd()
833 status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer); in acpi_bus_get_ejd()
846 acpi_handle handle = dev->handle; in acpi_bus_extract_wakeup_device_power_package() local
857 status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer); in acpi_bus_extract_wakeup_device_power_package()
859 acpi_handle_info(handle, "_PRW evaluation failed: %s\n", in acpi_bus_extract_wakeup_device_power_package()
881 element->package.elements[0].reference.handle; in acpi_bus_extract_wakeup_device_power_package()
907 acpi_handle_warn(handle, "Retrieving current states " in acpi_bus_extract_wakeup_device_power_package()
913 acpi_handle_warn(handle, "Overriding _PRW sleep state " in acpi_bus_extract_wakeup_device_power_package()
950 status = acpi_setup_gpe_for_wake(device->handle, wakeup->gpe_device, in acpi_wakeup_gpe_init()
960 if (!acpi_has_method(device->handle, "_PRW")) in acpi_bus_get_wakeup_device_flags()
993 status = acpi_evaluate_object(device->handle, pathname, NULL, &buffer); in acpi_bus_init_power_state()
1007 if (acpi_has_method(device->handle, pathname)) in acpi_bus_init_power_state()
1024 if (!acpi_has_method(device->handle, "_PS0") && in acpi_bus_get_power_flags()
1025 !acpi_has_method(device->handle, "_PR0")) in acpi_bus_get_power_flags()
1033 if (acpi_has_method(device->handle, "_PSC")) in acpi_bus_get_power_flags()
1036 if (acpi_has_method(device->handle, "_IRC")) in acpi_bus_get_power_flags()
1039 if (acpi_has_method(device->handle, "_DSW")) in acpi_bus_get_power_flags()
1042 acpi_evaluate_integer(device->handle, "_DSC", NULL, &dsc); in acpi_bus_get_power_flags()
1080 if (acpi_has_method(device->handle, "_STA")) in acpi_bus_get_flags()
1084 if (acpi_has_method(device->handle, "_RMV")) in acpi_bus_get_flags()
1088 if (acpi_has_method(device->handle, "_EJD") || in acpi_bus_get_flags()
1089 acpi_has_method(device->handle, "_EJ0")) in acpi_bus_get_flags()
1121 acpi_get_name(device->handle, ACPI_SINGLE_NAME, &buffer); in acpi_device_get_busid()
1140 bool acpi_ata_match(acpi_handle handle) in acpi_ata_match() argument
1142 return acpi_has_method(handle, "_GTF") || in acpi_ata_match()
1143 acpi_has_method(handle, "_GTM") || in acpi_ata_match()
1144 acpi_has_method(handle, "_STM") || in acpi_ata_match()
1145 acpi_has_method(handle, "_SDD"); in acpi_ata_match()
1154 bool acpi_bay_match(acpi_handle handle) in acpi_bay_match() argument
1158 if (!acpi_has_method(handle, "_EJ0")) in acpi_bay_match()
1160 if (acpi_ata_match(handle)) in acpi_bay_match()
1162 if (ACPI_FAILURE(acpi_get_parent(handle, &phandle))) in acpi_bay_match()
1181 acpi_handle handle = adev->handle; in is_ejectable_bay() local
1183 if (acpi_has_method(handle, "_EJ0") && acpi_device_is_battery(adev)) in is_ejectable_bay()
1186 return acpi_bay_match(handle); in is_ejectable_bay()
1192 bool acpi_dock_match(acpi_handle handle) in acpi_dock_match() argument
1194 return acpi_has_method(handle, "_DCK"); in acpi_dock_match()
1198 acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, in acpi_backlight_cap_match() argument
1203 if (acpi_has_method(handle, "_BCM") && in acpi_backlight_cap_match()
1204 acpi_has_method(handle, "_BCL")) { in acpi_backlight_cap_match()
1205 acpi_handle_debug(handle, "Found generic backlight support\n"); in acpi_backlight_cap_match()
1221 long acpi_is_video_device(acpi_handle handle) in acpi_is_video_device() argument
1226 if (acpi_has_method(handle, "_DOD") || acpi_has_method(handle, "_DOS")) in acpi_is_video_device()
1230 if (acpi_has_method(handle, "_ROM")) in acpi_is_video_device()
1234 if (acpi_has_method(handle, "_VPO") && in acpi_is_video_device()
1235 acpi_has_method(handle, "_GPD") && in acpi_is_video_device()
1236 acpi_has_method(handle, "_SPD")) in acpi_is_video_device()
1241 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, in acpi_is_video_device()
1284 static bool acpi_ibm_smbus_match(acpi_handle handle) in acpi_ibm_smbus_match() argument
1293 if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &path)) || in acpi_ibm_smbus_match()
1298 if (acpi_has_method(handle, "SBI") && in acpi_ibm_smbus_match()
1299 acpi_has_method(handle, "SBR") && in acpi_ibm_smbus_match()
1300 acpi_has_method(handle, "SBW")) in acpi_ibm_smbus_match()
1306 static bool acpi_object_is_system_bus(acpi_handle handle) in acpi_object_is_system_bus() argument
1311 tmp == handle) in acpi_object_is_system_bus()
1314 tmp == handle) in acpi_object_is_system_bus()
1320 static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, in acpi_set_pnp_ids() argument
1329 if (handle == ACPI_ROOT_OBJECT) { in acpi_set_pnp_ids()
1334 acpi_get_object_info(handle, &info); in acpi_set_pnp_ids()
1365 if (acpi_is_video_device(handle)) in acpi_set_pnp_ids()
1367 else if (acpi_bay_match(handle)) in acpi_set_pnp_ids()
1369 else if (acpi_dock_match(handle)) in acpi_set_pnp_ids()
1371 else if (acpi_ibm_smbus_match(handle)) in acpi_set_pnp_ids()
1374 acpi_object_is_system_bus(handle)) { in acpi_set_pnp_ids()
1487 if (adev && acpi_has_method(adev->handle, METHOD_NAME__DMA)) in acpi_dma_get_range()
1496 if (!acpi_has_method(adev->handle, METHOD_NAME__CRS)) { in acpi_dma_get_range()
1497 acpi_handle_warn(adev->handle, "_DMA is valid only if _CRS is present\n"); in acpi_dma_get_range()
1651 status = acpi_evaluate_integer(adev->handle, "_CCA", in acpi_init_coherency()
1663 acpi_handle_debug(adev->handle, in acpi_init_coherency()
1737 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, in acpi_init_device_object() argument
1742 device->handle = handle; in acpi_init_device_object()
1743 device->parent = acpi_bus_get_parent(handle); in acpi_init_device_object()
1747 acpi_set_pnp_ids(handle, &device->pnp, type); in acpi_init_device_object()
1765 if (dep->consumer == adev->handle) in acpi_scan_dep_init()
1783 acpi_handle handle, int type, bool dep_init) in acpi_add_single_object() argument
1793 acpi_init_device_object(device, handle, type); in acpi_add_single_object()
1833 acpi_handle_debug(handle, "Added as %s, parent %s\n", in acpi_add_single_object()
1852 static bool acpi_device_should_be_hidden(acpi_handle handle) in acpi_device_should_be_hidden() argument
1858 if (!(spcr_uart_addr && acpi_has_method(handle, METHOD_NAME__CRS))) in acpi_device_should_be_hidden()
1865 status = acpi_walk_resources(handle, METHOD_NAME__CRS, in acpi_device_should_be_hidden()
1870 acpi_handle_info(handle, "The UART device @%pa in SPCR table will be hidden\n", in acpi_device_should_be_hidden()
1929 if (acpi_dock_match(adev->handle) || is_ejectable_bay(adev)) { in acpi_scan_init_hotplug()
1944 static u32 acpi_scan_check_dep(acpi_handle handle, bool check_dep) in acpi_scan_check_dep() argument
1957 if (!check_dep || !acpi_has_method(handle, "_DEP") || in acpi_scan_check_dep()
1958 !acpi_has_method(handle, "_HID")) in acpi_scan_check_dep()
1961 status = acpi_evaluate_reference(handle, "_DEP", NULL, &dep_devices); in acpi_scan_check_dep()
1963 acpi_handle_debug(handle, "Failed to evaluate _DEP.\n"); in acpi_scan_check_dep()
1974 acpi_handle_debug(handle, "Error reading _DEP device info\n"); in acpi_scan_check_dep()
1991 dep->consumer = handle; in acpi_scan_check_dep()
2003 static acpi_status acpi_bus_check_add(acpi_handle handle, bool check_dep, in acpi_bus_check_add() argument
2010 acpi_bus_get_device(handle, &device); in acpi_bus_check_add()
2014 if (ACPI_FAILURE(acpi_get_type(handle, &acpi_type))) in acpi_bus_check_add()
2019 if (acpi_device_should_be_hidden(handle)) in acpi_bus_check_add()
2023 if (acpi_scan_check_dep(handle, check_dep) > 0) { in acpi_bus_check_add()
2042 acpi_add_power_resource(handle); in acpi_bus_check_add()
2052 acpi_add_single_object(&device, handle, type, !check_dep); in acpi_bus_check_add()
2065 static acpi_status acpi_bus_check_add_1(acpi_handle handle, u32 lvl_not_used, in acpi_bus_check_add_1() argument
2068 return acpi_bus_check_add(handle, true, (struct acpi_device **)ret_p); in acpi_bus_check_add_1()
2071 static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, in acpi_bus_check_add_2() argument
2074 return acpi_bus_check_add(handle, false, (struct acpi_device **)ret_p); in acpi_bus_check_add_2()
2154 if (ACPI_SUCCESS(acpi_bus_get_ejd(device->handle, &ejd))) in acpi_bus_attach()
2289 static int acpi_walk_dep_device_list(acpi_handle handle, in acpi_walk_dep_device_list() argument
2298 if (dep->supplier == handle) { in acpi_walk_dep_device_list()
2317 acpi_walk_dep_device_list(supplier->handle, acpi_scan_clear_dep, NULL); in acpi_dev_clear_dependencies()
2335 acpi_walk_dep_device_list(supplier->handle, in acpi_dev_get_first_consumer_dev()
2356 int acpi_bus_scan(acpi_handle handle) in acpi_bus_scan() argument
2364 if (ACPI_SUCCESS(acpi_bus_check_add(handle, true, &device))) in acpi_bus_scan()
2365 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_bus_scan()
2381 if (ACPI_SUCCESS(acpi_bus_check_add(handle, false, &device))) in acpi_bus_scan()
2382 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_bus_scan()
2559 acpi_detach_data(acpi_root->handle, in acpi_scan_init()