• Home
  • Raw
  • Download

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()
641 acpi_handle handle = adev->handle; in acpi_tie_acpi_dev() local
644 if (!handle) in acpi_tie_acpi_dev()
647 status = acpi_attach_data(handle, acpi_scan_drop_device, adev); in acpi_tie_acpi_dev()
649 acpi_handle_err(handle, "Unable to attach device data\n"); in acpi_tie_acpi_dev()
745 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()
1023 if (!acpi_has_method(device->handle, "_PS0") && in acpi_bus_get_power_flags()
1024 !acpi_has_method(device->handle, "_PR0")) in acpi_bus_get_power_flags()
1032 if (acpi_has_method(device->handle, "_PSC")) in acpi_bus_get_power_flags()
1035 if (acpi_has_method(device->handle, "_IRC")) in acpi_bus_get_power_flags()
1038 if (acpi_has_method(device->handle, "_DSW")) in acpi_bus_get_power_flags()
1076 if (acpi_has_method(device->handle, "_STA")) in acpi_bus_get_flags()
1080 if (acpi_has_method(device->handle, "_RMV")) in acpi_bus_get_flags()
1084 if (acpi_has_method(device->handle, "_EJD") || in acpi_bus_get_flags()
1085 acpi_has_method(device->handle, "_EJ0")) in acpi_bus_get_flags()
1117 acpi_get_name(device->handle, ACPI_SINGLE_NAME, &buffer); in acpi_device_get_busid()
1136 bool acpi_ata_match(acpi_handle handle) in acpi_ata_match() argument
1138 return acpi_has_method(handle, "_GTF") || in acpi_ata_match()
1139 acpi_has_method(handle, "_GTM") || in acpi_ata_match()
1140 acpi_has_method(handle, "_STM") || in acpi_ata_match()
1141 acpi_has_method(handle, "_SDD"); in acpi_ata_match()
1150 bool acpi_bay_match(acpi_handle handle) in acpi_bay_match() argument
1154 if (!acpi_has_method(handle, "_EJ0")) in acpi_bay_match()
1156 if (acpi_ata_match(handle)) in acpi_bay_match()
1158 if (ACPI_FAILURE(acpi_get_parent(handle, &phandle))) in acpi_bay_match()
1177 acpi_handle handle = adev->handle; in is_ejectable_bay() local
1179 if (acpi_has_method(handle, "_EJ0") && acpi_device_is_battery(adev)) in is_ejectable_bay()
1182 return acpi_bay_match(handle); in is_ejectable_bay()
1188 bool acpi_dock_match(acpi_handle handle) in acpi_dock_match() argument
1190 return acpi_has_method(handle, "_DCK"); in acpi_dock_match()
1194 acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, in acpi_backlight_cap_match() argument
1199 if (acpi_has_method(handle, "_BCM") && in acpi_backlight_cap_match()
1200 acpi_has_method(handle, "_BCL")) { in acpi_backlight_cap_match()
1201 acpi_handle_debug(handle, "Found generic backlight support\n"); in acpi_backlight_cap_match()
1217 long acpi_is_video_device(acpi_handle handle) in acpi_is_video_device() argument
1222 if (acpi_has_method(handle, "_DOD") || acpi_has_method(handle, "_DOS")) in acpi_is_video_device()
1226 if (acpi_has_method(handle, "_ROM")) in acpi_is_video_device()
1230 if (acpi_has_method(handle, "_VPO") && in acpi_is_video_device()
1231 acpi_has_method(handle, "_GPD") && in acpi_is_video_device()
1232 acpi_has_method(handle, "_SPD")) in acpi_is_video_device()
1237 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, in acpi_is_video_device()
1280 static bool acpi_ibm_smbus_match(acpi_handle handle) in acpi_ibm_smbus_match() argument
1289 if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &path)) || in acpi_ibm_smbus_match()
1294 if (acpi_has_method(handle, "SBI") && in acpi_ibm_smbus_match()
1295 acpi_has_method(handle, "SBR") && in acpi_ibm_smbus_match()
1296 acpi_has_method(handle, "SBW")) in acpi_ibm_smbus_match()
1302 static bool acpi_object_is_system_bus(acpi_handle handle) in acpi_object_is_system_bus() argument
1307 tmp == handle) in acpi_object_is_system_bus()
1310 tmp == handle) in acpi_object_is_system_bus()
1316 static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, in acpi_set_pnp_ids() argument
1325 if (handle == ACPI_ROOT_OBJECT) { in acpi_set_pnp_ids()
1330 acpi_get_object_info(handle, &info); in acpi_set_pnp_ids()
1361 if (acpi_is_video_device(handle)) in acpi_set_pnp_ids()
1363 else if (acpi_bay_match(handle)) in acpi_set_pnp_ids()
1365 else if (acpi_dock_match(handle)) in acpi_set_pnp_ids()
1367 else if (acpi_ibm_smbus_match(handle)) in acpi_set_pnp_ids()
1370 acpi_object_is_system_bus(handle)) { in acpi_set_pnp_ids()
1483 if (adev && acpi_has_method(adev->handle, METHOD_NAME__DMA)) in acpi_dma_get_range()
1492 if (!acpi_has_method(adev->handle, METHOD_NAME__CRS)) { in acpi_dma_get_range()
1493 acpi_handle_warn(adev->handle, "_DMA is valid only if _CRS is present\n"); in acpi_dma_get_range()
1652 status = acpi_evaluate_integer(adev->handle, "_CCA", in acpi_init_coherency()
1664 acpi_handle_debug(adev->handle, in acpi_init_coherency()
1745 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, in acpi_init_device_object() argument
1750 device->handle = handle; in acpi_init_device_object()
1751 device->parent = acpi_bus_get_parent(handle); in acpi_init_device_object()
1755 acpi_set_pnp_ids(handle, &device->pnp, type); in acpi_init_device_object()
1773 if (dep->consumer == adev->handle) in acpi_scan_dep_init()
1791 acpi_handle handle, int type, bool dep_init) in acpi_add_single_object() argument
1801 acpi_init_device_object(device, handle, type); in acpi_add_single_object()
1841 acpi_handle_debug(handle, "Added as %s, parent %s\n", in acpi_add_single_object()
1860 static bool acpi_device_should_be_hidden(acpi_handle handle) in acpi_device_should_be_hidden() argument
1866 if (!(spcr_uart_addr && acpi_has_method(handle, METHOD_NAME__CRS))) in acpi_device_should_be_hidden()
1873 status = acpi_walk_resources(handle, METHOD_NAME__CRS, in acpi_device_should_be_hidden()
1878 acpi_handle_info(handle, "The UART device @%pa in SPCR table will be hidden\n", in acpi_device_should_be_hidden()
1937 if (acpi_dock_match(adev->handle) || is_ejectable_bay(adev)) { in acpi_scan_init_hotplug()
1952 static u32 acpi_scan_check_dep(acpi_handle handle, bool check_dep) in acpi_scan_check_dep() argument
1965 if (!check_dep || !acpi_has_method(handle, "_DEP") || in acpi_scan_check_dep()
1966 !acpi_has_method(handle, "_HID")) in acpi_scan_check_dep()
1969 status = acpi_evaluate_reference(handle, "_DEP", NULL, &dep_devices); in acpi_scan_check_dep()
1971 acpi_handle_debug(handle, "Failed to evaluate _DEP.\n"); in acpi_scan_check_dep()
1982 acpi_handle_debug(handle, "Error reading _DEP device info\n"); in acpi_scan_check_dep()
1999 dep->consumer = handle; in acpi_scan_check_dep()
2011 static acpi_status acpi_bus_check_add(acpi_handle handle, bool check_dep, in acpi_bus_check_add() argument
2018 acpi_bus_get_device(handle, &device); in acpi_bus_check_add()
2022 if (ACPI_FAILURE(acpi_get_type(handle, &acpi_type))) in acpi_bus_check_add()
2027 if (acpi_device_should_be_hidden(handle)) in acpi_bus_check_add()
2031 if (acpi_scan_check_dep(handle, check_dep) > 0) { in acpi_bus_check_add()
2050 acpi_add_power_resource(handle); in acpi_bus_check_add()
2060 acpi_add_single_object(&device, handle, type, !check_dep); in acpi_bus_check_add()
2073 static acpi_status acpi_bus_check_add_1(acpi_handle handle, u32 lvl_not_used, in acpi_bus_check_add_1() argument
2076 return acpi_bus_check_add(handle, true, (struct acpi_device **)ret_p); in acpi_bus_check_add_1()
2079 static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, in acpi_bus_check_add_2() argument
2082 return acpi_bus_check_add(handle, false, (struct acpi_device **)ret_p); in acpi_bus_check_add_2()
2162 if (ACPI_SUCCESS(acpi_bus_get_ejd(device->handle, &ejd))) in acpi_bus_attach()
2297 static int acpi_walk_dep_device_list(acpi_handle handle, in acpi_walk_dep_device_list() argument
2306 if (dep->supplier == handle) { in acpi_walk_dep_device_list()
2325 acpi_walk_dep_device_list(supplier->handle, acpi_scan_clear_dep, NULL); in acpi_dev_clear_dependencies()
2343 acpi_walk_dep_device_list(supplier->handle, in acpi_dev_get_first_consumer_dev()
2364 int acpi_bus_scan(acpi_handle handle) in acpi_bus_scan() argument
2372 if (ACPI_SUCCESS(acpi_bus_check_add(handle, true, &device))) in acpi_bus_scan()
2373 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_bus_scan()
2389 if (ACPI_SUCCESS(acpi_bus_check_add(handle, false, &device))) in acpi_bus_scan()
2390 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, in acpi_bus_scan()
2567 acpi_detach_data(acpi_root->handle, in acpi_scan_init()