Lines Matching refs:handle

133 static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
136 struct acpi_device *device = acpi_fetch_acpi_dev(handle);
178 static acpi_status acpi_bus_online(acpi_handle handle, u32 lvl, void *data,
181 struct acpi_device *device = acpi_fetch_acpi_dev(handle);
202 acpi_handle handle = device->handle;
215 status = acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
220 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
224 acpi_bus_offline(handle, 0, (void *)false, (void **)&errdev);
227 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
231 acpi_bus_offline(handle, 0, (void *)true,
236 acpi_bus_online(handle, 0, NULL, NULL);
237 acpi_walk_namespace(ACPI_TYPE_ANY, handle,
295 acpi_handle handle = device->handle;
308 acpi_handle_debug(handle, "Ejecting\n");
312 acpi_evaluate_lck(handle, 0);
316 status = acpi_evaluate_ej0(handle);
326 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
328 acpi_handle_warn(handle,
331 acpi_handle_warn(handle,
346 ret = acpi_bus_scan(adev->handle);
402 acpi_evaluate_ost(adev->handle, ACPI_NOTIFY_EJECT_REQUEST,
418 * The device object's ACPI handle cannot become invalid as long as we
422 if (adev->handle == INVALID_ACPI_HANDLE)
460 acpi_evaluate_ost(adev->handle, src, ost_code, NULL);
562 * @handle: Handle of an ACPI namespace node, not used.
573 static void acpi_scan_drop_device(acpi_handle handle, void *context)
594 /* Make acpi_ns_validate_handle() return NULL for this handle. */
595 adev->handle = INVALID_ACPI_HANDLE;
600 static struct acpi_device *handle_to_device(acpi_handle handle,
606 status = acpi_get_data_full(handle, acpi_scan_drop_device,
609 acpi_handle_debug(handle, "No context!\n");
617 * @handle: ACPI handle associated with the requested ACPI device object.
619 * Return a pointer to the ACPI device object associated with @handle, if
622 struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle)
624 return handle_to_device(handle, NULL);
635 * @handle: ACPI handle associated with the requested ACPI device object.
637 * Return a pointer to the ACPI device object associated with @handle and bump
644 struct acpi_device *acpi_get_acpi_dev(acpi_handle handle)
646 return handle_to_device(handle, get_acpi_device);
679 acpi_handle handle = adev->handle;
682 if (!handle)
685 status = acpi_attach_data(handle, acpi_scan_drop_device, adev);
687 acpi_handle_err(handle, "Unable to attach device data\n");
699 status = acpi_get_physical_device_location(adev->handle, &pld);
784 acpi_detach_data(device->handle, acpi_scan_drop_device);
838 static struct acpi_device *acpi_find_parent_acpi_dev(acpi_handle handle)
847 if (!handle)
853 status = acpi_get_parent(handle, &handle);
860 adev = acpi_fetch_acpi_dev(handle);
866 acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
873 status = acpi_get_handle(handle, "_EJD", &tmp);
877 status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer);
890 acpi_handle handle = dev->handle;
901 status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer);
903 acpi_handle_info(handle, "_PRW evaluation failed: %s\n",
925 element->package.elements[0].reference.handle;
951 acpi_handle_warn(handle, "Retrieving current states "
957 acpi_handle_warn(handle, "Overriding _PRW sleep state "
997 status = acpi_setup_gpe_for_wake(device->handle, wakeup->gpe_device,
1007 if (!acpi_has_method(device->handle, "_PRW"))
1040 status = acpi_evaluate_object(device->handle, pathname, NULL, &buffer);
1054 if (acpi_has_method(device->handle, pathname))
1071 if (!acpi_has_method(device->handle, "_PS0") &&
1072 !acpi_has_method(device->handle, "_PR0"))
1080 if (acpi_has_method(device->handle, "_PSC"))
1083 if (acpi_has_method(device->handle, "_IRC"))
1086 if (acpi_has_method(device->handle, "_DSW"))
1089 acpi_evaluate_integer(device->handle, "_DSC", NULL, &dsc);
1127 if (acpi_has_method(device->handle, "_STA"))
1131 if (acpi_has_method(device->handle, "_RMV"))
1135 if (acpi_has_method(device->handle, "_EJD") ||
1136 acpi_has_method(device->handle, "_EJ0"))
1168 acpi_get_name(device->handle, ACPI_SINGLE_NAME, &buffer);
1187 bool acpi_ata_match(acpi_handle handle)
1189 return acpi_has_method(handle, "_GTF") ||
1190 acpi_has_method(handle, "_GTM") ||
1191 acpi_has_method(handle, "_STM") ||
1192 acpi_has_method(handle, "_SDD");
1201 bool acpi_bay_match(acpi_handle handle)
1205 if (!acpi_has_method(handle, "_EJ0"))
1207 if (acpi_ata_match(handle))
1209 if (ACPI_FAILURE(acpi_get_parent(handle, &phandle)))
1228 acpi_handle handle = adev->handle;
1230 if (acpi_has_method(handle, "_EJ0") && acpi_device_is_battery(adev))
1233 return acpi_bay_match(handle);
1239 bool acpi_dock_match(acpi_handle handle)
1241 return acpi_has_method(handle, "_DCK");
1245 acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context,
1250 if (acpi_has_method(handle, "_BCM") &&
1251 acpi_has_method(handle, "_BCL")) {
1252 acpi_handle_debug(handle, "Found generic backlight support\n");
1268 long acpi_is_video_device(acpi_handle handle)
1273 if (acpi_has_method(handle, "_DOD") || acpi_has_method(handle, "_DOS"))
1277 if (acpi_has_method(handle, "_ROM"))
1281 if (acpi_has_method(handle, "_VPO") &&
1282 acpi_has_method(handle, "_GPD") &&
1283 acpi_has_method(handle, "_SPD"))
1288 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle,
1331 static bool acpi_ibm_smbus_match(acpi_handle handle)
1340 if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &path)) ||
1345 if (acpi_has_method(handle, "SBI") &&
1346 acpi_has_method(handle, "SBR") &&
1347 acpi_has_method(handle, "SBW"))
1353 static bool acpi_object_is_system_bus(acpi_handle handle)
1358 tmp == handle)
1361 tmp == handle)
1367 static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp,
1376 if (handle == ACPI_ROOT_OBJECT) {
1381 acpi_get_object_info(handle, &info);
1412 if (acpi_is_video_device(handle)) {
1417 if (acpi_bay_match(handle))
1419 else if (acpi_dock_match(handle))
1421 else if (acpi_ibm_smbus_match(handle))
1424 acpi_object_is_system_bus(handle)) {
1533 if (adev && acpi_has_method(adev->handle, METHOD_NAME__DMA))
1542 if (!acpi_has_method(adev->handle, METHOD_NAME__CRS)) {
1543 acpi_handle_warn(adev->handle, "_DMA is valid only if _CRS is present\n");
1698 status = acpi_evaluate_integer(adev->handle, "_CCA",
1710 acpi_handle_debug(adev->handle,
1805 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
1808 struct acpi_device *parent = acpi_find_parent_acpi_dev(handle);
1812 device->handle = handle;
1819 acpi_set_pnp_ids(handle, &device->pnp, type);
1837 if (dep->consumer == adev->handle) {
1860 acpi_handle handle, int type, bool dep_init)
1870 acpi_init_device_object(device, handle, type, acpi_device_release);
1910 acpi_handle_debug(handle, "Added as %s, parent %s\n",
1929 static bool acpi_device_should_be_hidden(acpi_handle handle)
1935 if (!(spcr_uart_addr && acpi_has_method(handle, METHOD_NAME__CRS)))
1942 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
1947 acpi_handle_info(handle, "The UART device @%pa in SPCR table will be hidden\n",
2011 if (acpi_dock_match(adev->handle) || is_ejectable_bay(adev)) {
2026 static u32 acpi_scan_check_dep(acpi_handle handle)
2038 if (!acpi_has_method(handle, "_DEP") || !acpi_has_method(handle, "_HID"))
2041 if (!acpi_evaluate_reference(handle, "_DEP", NULL, &dep_devices)) {
2042 acpi_handle_debug(handle, "Failed to evaluate _DEP.\n");
2054 acpi_handle_debug(handle, "Error reading _DEP device info\n");
2072 dep->consumer = handle;
2084 static acpi_status acpi_scan_check_crs_csi2_cb(acpi_handle handle, u32 a, void *b, void **c)
2086 acpi_mipi_check_crs_csi2(handle);
2090 static acpi_status acpi_bus_check_add(acpi_handle handle, bool first_pass,
2093 struct acpi_device *device = acpi_fetch_acpi_dev(handle);
2100 if (ACPI_FAILURE(acpi_get_type(handle, &acpi_type)))
2105 if (acpi_device_should_be_hidden(handle))
2109 acpi_mipi_check_crs_csi2(handle);
2112 if (acpi_scan_check_dep(handle) > 0) {
2118 * devices below the current handle.
2120 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle,
2142 acpi_add_power_resource(handle);
2152 acpi_add_single_object(&device, handle, type, !first_pass);
2165 static acpi_status acpi_bus_check_add_1(acpi_handle handle, u32 lvl_not_used,
2168 return acpi_bus_check_add(handle, true, (struct acpi_device **)ret_p);
2171 static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used,
2174 return acpi_bus_check_add(handle, false, (struct acpi_device **)ret_p);
2253 if (ACPI_SUCCESS(acpi_bus_get_ejd(device->handle, &ejd)))
2317 if (dep->consumer == adev->handle)
2400 * @handle: The ACPI handle of the supplier device
2410 static int acpi_walk_dep_device_list(acpi_handle handle,
2419 if (dep->supplier == handle) {
2438 acpi_walk_dep_device_list(supplier->handle, acpi_scan_clear_dep, NULL);
2475 acpi_walk_dep_device_list(supplier->handle,
2487 static void acpi_scan_postponed_branch(acpi_handle handle)
2491 if (ACPI_FAILURE(acpi_bus_check_add(handle, false, &adev)))
2494 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
2513 acpi_handle handle = dep->consumer;
2520 if (!acpi_fetch_acpi_dev(handle)) {
2529 acpi_scan_postponed_branch(handle);
2545 * @handle: Root of the namespace scope to scan.
2557 int acpi_bus_scan(acpi_handle handle)
2563 if (ACPI_SUCCESS(acpi_bus_check_add(handle, true, &device)))
2564 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,