Lines Matching refs:handle

134 static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,  in acpi_bus_offline()  argument
137 struct acpi_device *device = acpi_fetch_acpi_dev(handle); in acpi_bus_offline()
179 static acpi_status acpi_bus_online(acpi_handle handle, u32 lvl, void *data, in acpi_bus_online() argument
182 struct acpi_device *device = acpi_fetch_acpi_dev(handle); in acpi_bus_online()
203 acpi_handle handle = device->handle; in acpi_scan_try_to_offline() local
216 status = acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_scan_try_to_offline()
221 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_scan_try_to_offline()
225 acpi_bus_offline(handle, 0, (void *)false, (void **)&errdev); in acpi_scan_try_to_offline()
228 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_scan_try_to_offline()
232 acpi_bus_offline(handle, 0, (void *)true, in acpi_scan_try_to_offline()
237 acpi_bus_online(handle, 0, NULL, NULL); in acpi_scan_try_to_offline()
238 acpi_walk_namespace(ACPI_TYPE_ANY, handle, in acpi_scan_try_to_offline()
249 acpi_handle handle = device->handle; in acpi_scan_hot_remove() local
262 acpi_handle_debug(handle, "Ejecting\n"); in acpi_scan_hot_remove()
266 acpi_evaluate_lck(handle, 0); in acpi_scan_hot_remove()
270 status = acpi_evaluate_ej0(handle); in acpi_scan_hot_remove()
280 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); in acpi_scan_hot_remove()
282 acpi_handle_warn(handle, in acpi_scan_hot_remove()
285 acpi_handle_warn(handle, in acpi_scan_hot_remove()
320 error = acpi_bus_scan(adev->handle); in acpi_scan_device_check()
348 error = acpi_bus_scan(adev->handle); in acpi_scan_bus_check()
369 acpi_evaluate_ost(adev->handle, ACPI_NOTIFY_EJECT_REQUEST, in acpi_generic_hotplug_event()
389 if (adev->handle == INVALID_ACPI_HANDLE) in acpi_device_hotplug()
427 acpi_evaluate_ost(adev->handle, src, ost_code, NULL); in acpi_device_hotplug()
540 static void acpi_scan_drop_device(acpi_handle handle, void *context) in acpi_scan_drop_device() argument
562 adev->handle = INVALID_ACPI_HANDLE; in acpi_scan_drop_device()
567 static struct acpi_device *handle_to_device(acpi_handle handle, in handle_to_device() argument
573 status = acpi_get_data_full(handle, acpi_scan_drop_device, in handle_to_device()
576 acpi_handle_debug(handle, "No context!\n"); in handle_to_device()
589 struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle) in acpi_fetch_acpi_dev() argument
591 return handle_to_device(handle, NULL); in acpi_fetch_acpi_dev()
611 struct acpi_device *acpi_get_acpi_dev(acpi_handle handle) in acpi_get_acpi_dev() argument
613 return handle_to_device(handle, get_acpi_device); in acpi_get_acpi_dev()
646 acpi_handle handle = adev->handle; in acpi_tie_acpi_dev() local
649 if (!handle) in acpi_tie_acpi_dev()
652 status = acpi_attach_data(handle, acpi_scan_drop_device, adev); in acpi_tie_acpi_dev()
654 acpi_handle_err(handle, "Unable to attach device data\n"); in acpi_tie_acpi_dev()
666 status = acpi_get_physical_device_location(adev->handle, &pld); in acpi_store_pld_crc()
751 acpi_detach_data(device->handle, acpi_scan_drop_device); in acpi_device_add()
804 static struct acpi_device *acpi_find_parent_acpi_dev(acpi_handle handle) in acpi_find_parent_acpi_dev() argument
813 if (!handle) in acpi_find_parent_acpi_dev()
819 status = acpi_get_parent(handle, &handle); in acpi_find_parent_acpi_dev()
826 adev = acpi_fetch_acpi_dev(handle); in acpi_find_parent_acpi_dev()
832 acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd) in acpi_bus_get_ejd() argument
839 status = acpi_get_handle(handle, "_EJD", &tmp); in acpi_bus_get_ejd()
843 status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer); in acpi_bus_get_ejd()
856 acpi_handle handle = dev->handle; in acpi_bus_extract_wakeup_device_power_package() local
867 status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer); in acpi_bus_extract_wakeup_device_power_package()
869 acpi_handle_info(handle, "_PRW evaluation failed: %s\n", in acpi_bus_extract_wakeup_device_power_package()
891 element->package.elements[0].reference.handle; in acpi_bus_extract_wakeup_device_power_package()
917 acpi_handle_warn(handle, "Retrieving current states " in acpi_bus_extract_wakeup_device_power_package()
923 acpi_handle_warn(handle, "Overriding _PRW sleep state " in acpi_bus_extract_wakeup_device_power_package()
963 status = acpi_setup_gpe_for_wake(device->handle, wakeup->gpe_device, in acpi_wakeup_gpe_init()
973 if (!acpi_has_method(device->handle, "_PRW")) in acpi_bus_get_wakeup_device_flags()
1006 status = acpi_evaluate_object(device->handle, pathname, NULL, &buffer); in acpi_bus_init_power_state()
1020 if (acpi_has_method(device->handle, pathname)) in acpi_bus_init_power_state()
1037 if (!acpi_has_method(device->handle, "_PS0") && in acpi_bus_get_power_flags()
1038 !acpi_has_method(device->handle, "_PR0")) in acpi_bus_get_power_flags()
1046 if (acpi_has_method(device->handle, "_PSC")) in acpi_bus_get_power_flags()
1049 if (acpi_has_method(device->handle, "_IRC")) in acpi_bus_get_power_flags()
1052 if (acpi_has_method(device->handle, "_DSW")) in acpi_bus_get_power_flags()
1055 acpi_evaluate_integer(device->handle, "_DSC", NULL, &dsc); in acpi_bus_get_power_flags()
1093 if (acpi_has_method(device->handle, "_STA")) in acpi_bus_get_flags()
1097 if (acpi_has_method(device->handle, "_RMV")) in acpi_bus_get_flags()
1101 if (acpi_has_method(device->handle, "_EJD") || in acpi_bus_get_flags()
1102 acpi_has_method(device->handle, "_EJ0")) in acpi_bus_get_flags()
1134 acpi_get_name(device->handle, ACPI_SINGLE_NAME, &buffer); in acpi_device_get_busid()
1153 bool acpi_ata_match(acpi_handle handle) in acpi_ata_match() argument
1155 return acpi_has_method(handle, "_GTF") || in acpi_ata_match()
1156 acpi_has_method(handle, "_GTM") || in acpi_ata_match()
1157 acpi_has_method(handle, "_STM") || in acpi_ata_match()
1158 acpi_has_method(handle, "_SDD"); in acpi_ata_match()
1167 bool acpi_bay_match(acpi_handle handle) in acpi_bay_match() argument
1171 if (!acpi_has_method(handle, "_EJ0")) in acpi_bay_match()
1173 if (acpi_ata_match(handle)) in acpi_bay_match()
1175 if (ACPI_FAILURE(acpi_get_parent(handle, &phandle))) in acpi_bay_match()
1194 acpi_handle handle = adev->handle; in is_ejectable_bay() local
1196 if (acpi_has_method(handle, "_EJ0") && acpi_device_is_battery(adev)) in is_ejectable_bay()
1199 return acpi_bay_match(handle); in is_ejectable_bay()
1205 bool acpi_dock_match(acpi_handle handle) in acpi_dock_match() argument
1207 return acpi_has_method(handle, "_DCK"); in acpi_dock_match()
1211 acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, in acpi_backlight_cap_match() argument
1216 if (acpi_has_method(handle, "_BCM") && in acpi_backlight_cap_match()
1217 acpi_has_method(handle, "_BCL")) { in acpi_backlight_cap_match()
1218 acpi_handle_debug(handle, "Found generic backlight support\n"); in acpi_backlight_cap_match()
1234 long acpi_is_video_device(acpi_handle handle) in acpi_is_video_device() argument
1239 if (acpi_has_method(handle, "_DOD") || acpi_has_method(handle, "_DOS")) in acpi_is_video_device()
1243 if (acpi_has_method(handle, "_ROM")) in acpi_is_video_device()
1247 if (acpi_has_method(handle, "_VPO") && in acpi_is_video_device()
1248 acpi_has_method(handle, "_GPD") && in acpi_is_video_device()
1249 acpi_has_method(handle, "_SPD")) in acpi_is_video_device()
1254 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, in acpi_is_video_device()
1297 static bool acpi_ibm_smbus_match(acpi_handle handle) in acpi_ibm_smbus_match() argument
1306 if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &path)) || in acpi_ibm_smbus_match()
1311 if (acpi_has_method(handle, "SBI") && in acpi_ibm_smbus_match()
1312 acpi_has_method(handle, "SBR") && in acpi_ibm_smbus_match()
1313 acpi_has_method(handle, "SBW")) in acpi_ibm_smbus_match()
1319 static bool acpi_object_is_system_bus(acpi_handle handle) in acpi_object_is_system_bus() argument
1324 tmp == handle) in acpi_object_is_system_bus()
1327 tmp == handle) in acpi_object_is_system_bus()
1333 static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, in acpi_set_pnp_ids() argument
1342 if (handle == ACPI_ROOT_OBJECT) { in acpi_set_pnp_ids()
1347 acpi_get_object_info(handle, &info); in acpi_set_pnp_ids()
1378 if (acpi_is_video_device(handle)) { in acpi_set_pnp_ids()
1383 if (acpi_bay_match(handle)) in acpi_set_pnp_ids()
1385 else if (acpi_dock_match(handle)) in acpi_set_pnp_ids()
1387 else if (acpi_ibm_smbus_match(handle)) in acpi_set_pnp_ids()
1390 acpi_object_is_system_bus(handle)) { in acpi_set_pnp_ids()
1499 if (adev && acpi_has_method(adev->handle, METHOD_NAME__DMA)) in acpi_dma_get_range()
1508 if (!acpi_has_method(adev->handle, METHOD_NAME__CRS)) { in acpi_dma_get_range()
1509 acpi_handle_warn(adev->handle, "_DMA is valid only if _CRS is present\n"); in acpi_dma_get_range()
1665 status = acpi_evaluate_integer(adev->handle, "_CCA", in acpi_init_coherency()
1677 acpi_handle_debug(adev->handle, in acpi_init_coherency()
1769 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, in acpi_init_device_object() argument
1772 struct acpi_device *parent = acpi_find_parent_acpi_dev(handle); in acpi_init_device_object()
1776 device->handle = handle; in acpi_init_device_object()
1783 acpi_set_pnp_ids(handle, &device->pnp, type); in acpi_init_device_object()
1801 if (dep->consumer == adev->handle) { in acpi_scan_dep_init()
1823 acpi_handle handle, int type, bool dep_init) in acpi_add_single_object() argument
1833 acpi_init_device_object(device, handle, type, acpi_device_release); in acpi_add_single_object()
1873 acpi_handle_debug(handle, "Added as %s, parent %s\n", in acpi_add_single_object()
1892 static bool acpi_device_should_be_hidden(acpi_handle handle) in acpi_device_should_be_hidden() argument
1898 if (!(spcr_uart_addr && acpi_has_method(handle, METHOD_NAME__CRS))) in acpi_device_should_be_hidden()
1905 status = acpi_walk_resources(handle, METHOD_NAME__CRS, in acpi_device_should_be_hidden()
1910 acpi_handle_info(handle, "The UART device @%pa in SPCR table will be hidden\n", in acpi_device_should_be_hidden()
1969 if (acpi_dock_match(adev->handle) || is_ejectable_bay(adev)) { in acpi_scan_init_hotplug()
1984 static u32 acpi_scan_check_dep(acpi_handle handle, bool check_dep) in acpi_scan_check_dep() argument
1997 if (!check_dep || !acpi_has_method(handle, "_DEP") || in acpi_scan_check_dep()
1998 !acpi_has_method(handle, "_HID")) in acpi_scan_check_dep()
2001 status = acpi_evaluate_reference(handle, "_DEP", NULL, &dep_devices); in acpi_scan_check_dep()
2003 acpi_handle_debug(handle, "Failed to evaluate _DEP.\n"); in acpi_scan_check_dep()
2014 acpi_handle_debug(handle, "Error reading _DEP device info\n"); in acpi_scan_check_dep()
2032 dep->consumer = handle; in acpi_scan_check_dep()
2043 static acpi_status acpi_bus_check_add(acpi_handle handle, bool check_dep, in acpi_bus_check_add() argument
2046 struct acpi_device *device = acpi_fetch_acpi_dev(handle); in acpi_bus_check_add()
2053 if (ACPI_FAILURE(acpi_get_type(handle, &acpi_type))) in acpi_bus_check_add()
2058 if (acpi_device_should_be_hidden(handle)) in acpi_bus_check_add()
2062 if (acpi_scan_check_dep(handle, check_dep) > 0) in acpi_bus_check_add()
2079 acpi_add_power_resource(handle); in acpi_bus_check_add()
2089 acpi_add_single_object(&device, handle, type, !check_dep); in acpi_bus_check_add()
2102 static acpi_status acpi_bus_check_add_1(acpi_handle handle, u32 lvl_not_used, in acpi_bus_check_add_1() argument
2105 return acpi_bus_check_add(handle, true, (struct acpi_device **)ret_p); in acpi_bus_check_add_1()
2108 static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, in acpi_bus_check_add_2() argument
2111 return acpi_bus_check_add(handle, false, (struct acpi_device **)ret_p); in acpi_bus_check_add_2()
2190 if (ACPI_SUCCESS(acpi_bus_get_ejd(device->handle, &ejd))) in acpi_bus_attach()
2254 if (dep->consumer == adev->handle) in acpi_dev_get_next_consumer_dev_cb()
2347 static int acpi_walk_dep_device_list(acpi_handle handle, in acpi_walk_dep_device_list() argument
2356 if (dep->supplier == handle) { in acpi_walk_dep_device_list()
2375 acpi_walk_dep_device_list(supplier->handle, acpi_scan_clear_dep, NULL); in acpi_dev_clear_dependencies()
2412 acpi_walk_dep_device_list(supplier->handle, in acpi_dev_get_next_consumer_dev()
2424 static void acpi_scan_postponed_branch(acpi_handle handle) in acpi_scan_postponed_branch() argument
2428 if (ACPI_FAILURE(acpi_bus_check_add(handle, false, &adev))) in acpi_scan_postponed_branch()
2431 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_scan_postponed_branch()
2443 acpi_handle handle = dep->consumer; in acpi_scan_postponed() local
2450 if (!acpi_fetch_acpi_dev(handle)) { in acpi_scan_postponed()
2459 acpi_scan_postponed_branch(handle); in acpi_scan_postponed()
2487 int acpi_bus_scan(acpi_handle handle) in acpi_bus_scan() argument
2493 if (ACPI_SUCCESS(acpi_bus_check_add(handle, true, &device))) in acpi_bus_scan()
2494 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_bus_scan()