Lines Matching +full:sci +full:- +full:proc +full:- +full:ids
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * acpi_bus.c - ACPI Bus Driver ($Revision: 80 $)
50 pr_notice("%s detected - force copy of DSDT to local memory\n", id->ident); in set_copy_dsdt()
58 * Invoke DSDT corruption work-around on all Toshiba Satellite.
73 /* --------------------------------------------------------------------------
75 -------------------------------------------------------------------------- */
106 if (acpi_device_is_battery(device) && device->dep_unmet) { in acpi_bus_get_status()
111 status = acpi_bus_get_status_handle(device->handle, &sta); in acpi_bus_get_status()
113 return -ENODEV; in acpi_bus_get_status()
117 if (device->status.functional && !device->status.present) { in acpi_bus_get_status()
119 device->pnp.bus_id, (u32)sta); in acpi_bus_get_status()
122 pr_debug("Device [%s] status [%08x]\n", device->pnp.bus_id, (u32)sta); in acpi_bus_get_status()
142 return -ENODEV; in acpi_bus_attach_private_data()
154 return -EINVAL; in acpi_bus_get_private_data()
159 return -ENODEV; in acpi_bus_get_private_data()
177 acpi_handle_debug(handle, "(%s): %s\n", context->uuid_str, error); in acpi_print_osc_error()
180 for (i = 0; i < context->cap.length; i += sizeof(u32)) in acpi_print_osc_error()
181 pr_debug(" %x", *((u32 *)(context->cap.pointer + i))); in acpi_print_osc_error()
198 if (guid_parse(context->uuid_str, &guid)) in acpi_run_osc()
200 context->ret.length = ACPI_ALLOCATE_BUFFER; in acpi_run_osc()
201 context->ret.pointer = NULL; in acpi_run_osc()
210 in_params[1].integer.value = context->rev; in acpi_run_osc()
212 in_params[2].integer.value = context->cap.length/sizeof(u32); in acpi_run_osc()
214 in_params[3].buffer.length = context->cap.length; in acpi_run_osc()
215 in_params[3].buffer.pointer = context->cap.pointer; in acpi_run_osc()
225 if (out_obj->type != ACPI_TYPE_BUFFER in acpi_run_osc()
226 || out_obj->buffer.length != context->cap.length) { in acpi_run_osc()
233 errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); in acpi_run_osc()
245 if (((u32 *)context->cap.pointer)[OSC_QUERY_DWORD] in acpi_run_osc()
255 context->ret.length = out_obj->buffer.length; in acpi_run_osc()
256 context->ret.pointer = kmemdup(out_obj->buffer.pointer, in acpi_run_osc()
257 context->ret.length, GFP_KERNEL); in acpi_run_osc()
258 if (!context->ret.pointer) { in acpi_run_osc()
280 * ACPI 6.2 Section 6.2.11.2 'Platform-Wide OSPM Capabilities':
287 * - PCC or Functional Fixed Hardware address space if defined
288 * - SystemMemory address space (NULL register) if not defined
301 static u8 sb_uuid_str[] = "0811B06E-4A27-44F9-8D60-3CBBC22E7B48";
402 (bits & OSC_USB_USB3_TUNNELING) ? '+' : '-', in acpi_bus_decode_usb_osc()
403 (bits & OSC_USB_DP_TUNNELING) ? '+' : '-', in acpi_bus_decode_usb_osc()
404 (bits & OSC_USB_PCIE_TUNNELING) ? '+' : '-', in acpi_bus_decode_usb_osc()
405 (bits & OSC_USB_XDOMAIN) ? '+' : '-'); in acpi_bus_decode_usb_osc()
408 static u8 sb_usb_uuid_str[] = "23A0D13A-26AB-486C-9C5F-0FFA525A575A";
455 /* --------------------------------------------------------------------------
457 -------------------------------------------------------------------------- */
460 * acpi_bus_notify - Global system-level (0x00-0x7F) notifications handler
525 struct acpi_driver *acpi_drv = to_acpi_driver(device->dev.driver); in acpi_notify_device()
527 acpi_drv->ops.notify(device, event); in acpi_notify_device()
533 u32 type = acpi_drv->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS ? in acpi_device_install_notify_handler()
537 status = acpi_install_notify_handler(device->handle, type, in acpi_device_install_notify_handler()
540 return -EINVAL; in acpi_device_install_notify_handler()
548 u32 type = acpi_drv->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS ? in acpi_device_remove_notify_handler()
551 acpi_remove_notify_handler(device->handle, type, in acpi_device_remove_notify_handler()
563 status = acpi_install_notify_handler(adev->handle, handler_type, in acpi_dev_install_notify_handler()
566 return -ENODEV; in acpi_dev_install_notify_handler()
576 acpi_remove_notify_handler(adev->handle, handler_type, handler); in acpi_dev_remove_notify_handler()
623 return -ENXIO; in acpi_setup_sb_notify_handler()
627 return -EINVAL; in acpi_setup_sb_notify_handler()
632 /* --------------------------------------------------------------------------
634 -------------------------------------------------------------------------- */
637 * acpi_get_first_physical_node - Get first physical node of an ACPI device
644 struct mutex *physical_node_lock = &adev->physical_node_lock; in acpi_get_first_physical_node()
648 if (list_empty(&adev->physical_node_list)) { in acpi_get_first_physical_node()
653 node = list_first_entry(&adev->physical_node_list, in acpi_get_first_physical_node()
656 phys_dev = node->dev; in acpi_get_first_physical_node()
672 * acpi_device_is_first_physical_node - Is given dev first physical node
689 * acpi_companion_match() - Can we match via ACPI companion device
693 * a valid list of PNP IDs, and if the device is the first (primary) physical
700 * companion. A typical case is an MFD device where all the sub-devices share
703 * IDs.
717 if (list_empty(&adev->pnp.ids)) in acpi_companion_match()
724 * acpi_of_match_device - Match device object using the "compatible" property.
726 * @of_match_table: List of device IDs to match against.
743 of_compatible = adev->data.of_compatible; in acpi_of_match_device()
747 if (of_compatible->type == ACPI_TYPE_PACKAGE) { in acpi_of_match_device()
748 nval = of_compatible->package.count; in acpi_of_match_device()
749 obj = of_compatible->package.elements; in acpi_of_match_device()
758 for (id = of_match_table; id->compatible[0]; id++) in acpi_of_match_device()
759 if (!strcasecmp(obj->string.pointer, id->compatible)) { in acpi_of_match_device()
776 of_compatible = adev->data.of_compatible; in acpi_of_modalias()
780 if (of_compatible->type == ACPI_TYPE_PACKAGE) in acpi_of_modalias()
781 obj = of_compatible->package.elements; in acpi_of_modalias()
785 str = obj->string.pointer; in acpi_of_modalias()
793 * acpi_set_modalias - Set modalias using "compatible" property or supplied ID
818 if (!id->cls) in __acpi_match_device_cls()
821 /* Apply class-code bitmask, before checking each class-code byte */ in __acpi_match_device_cls()
823 byte_shift = 8 * (3 - i); in __acpi_match_device_cls()
824 msk = (id->cls_msk >> byte_shift) & 0xFF; in __acpi_match_device_cls()
828 sprintf(buf, "%02x", (id->cls >> byte_shift) & msk); in __acpi_match_device_cls()
829 if (strncmp(buf, &hwid->id[(i - 1) * 2], 2)) in __acpi_match_device_cls()
848 if (!device || !device->status.present) in __acpi_match_device()
851 list_for_each_entry(hwid, &device->pnp.ids, list) { in __acpi_match_device()
852 /* First, check the ACPI/PNP IDs provided by the caller. */ in __acpi_match_device()
854 for (id = acpi_ids; id->id[0] || id->cls; id++) { in __acpi_match_device()
855 if (id->id[0] && !strcmp((char *)id->id, hwid->id)) in __acpi_match_device()
857 if (id->cls && __acpi_match_device_cls(id, hwid)) in __acpi_match_device()
866 if (!strcmp(ACPI_DT_NAMESPACE_HID, hwid->id)) in __acpi_match_device()
878 * acpi_match_acpi_device - Match an ACPI device against a given list of ACPI IDs
879 * @ids: Array of struct acpi_device_id objects to match against.
882 * Match the ACPI device @adev against a given list of ACPI IDs @ids.
887 const struct acpi_device_id *acpi_match_acpi_device(const struct acpi_device_id *ids, in acpi_match_acpi_device() argument
892 __acpi_match_device(adev, ids, NULL, &id, NULL); in acpi_match_acpi_device()
898 * acpi_match_device - Match a struct device against a given list of ACPI IDs
899 * @ids: Array of struct acpi_device_id object to match against.
904 * device IDs.
908 const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, in acpi_match_device() argument
911 return acpi_match_acpi_device(ids, acpi_companion_match(dev)); in acpi_match_device()
920 if (!acpi_of_match_device(adev, dev->driver->of_match_table, &match)) in acpi_of_device_get_match_data()
923 return match->data; in acpi_of_device_get_match_data()
928 const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table; in acpi_device_get_match_data()
938 return (const void *)match->driver_data; in acpi_device_get_match_data()
943 const struct acpi_device_id *ids) in acpi_match_device_ids() argument
945 return __acpi_match_device(device, ids, NULL, NULL, NULL) ? 0 : -ENOENT; in acpi_match_device_ids()
952 const struct acpi_device_id *acpi_ids = drv->acpi_match_table; in acpi_driver_match_device()
953 const struct of_device_id *of_ids = drv->of_match_table; in acpi_driver_match_device()
962 /* --------------------------------------------------------------------------
964 -------------------------------------------------------------------------- */
967 * acpi_bus_register_driver - register a driver with the ACPI bus
977 return -ENODEV; in acpi_bus_register_driver()
978 driver->drv.name = driver->name; in acpi_bus_register_driver()
979 driver->drv.bus = &acpi_bus_type; in acpi_bus_register_driver()
980 driver->drv.owner = driver->owner; in acpi_bus_register_driver()
982 return driver_register(&driver->drv); in acpi_bus_register_driver()
988 * acpi_bus_unregister_driver - unregisters a driver with the ACPI bus
996 driver_unregister(&driver->drv); in acpi_bus_unregister_driver()
1001 /* --------------------------------------------------------------------------
1003 -------------------------------------------------------------------------- */
1010 return acpi_dev->flags.match_driver in acpi_bus_match()
1011 && !acpi_match_device_ids(acpi_dev, acpi_drv->ids); in acpi_bus_match()
1022 struct acpi_driver *acpi_drv = to_acpi_driver(dev->driver); in acpi_device_probe()
1025 if (acpi_dev->handler && !acpi_is_pnp_device(acpi_dev)) in acpi_device_probe()
1026 return -EINVAL; in acpi_device_probe()
1028 if (!acpi_drv->ops.add) in acpi_device_probe()
1029 return -ENOSYS; in acpi_device_probe()
1031 ret = acpi_drv->ops.add(acpi_dev); in acpi_device_probe()
1033 acpi_dev->driver_data = NULL; in acpi_device_probe()
1038 acpi_drv->name, acpi_dev->pnp.bus_id); in acpi_device_probe()
1040 if (acpi_drv->ops.notify) { in acpi_device_probe()
1043 if (acpi_drv->ops.remove) in acpi_device_probe()
1044 acpi_drv->ops.remove(acpi_dev); in acpi_device_probe()
1046 acpi_dev->driver_data = NULL; in acpi_device_probe()
1051 pr_debug("Found driver [%s] for device [%s]\n", acpi_drv->name, in acpi_device_probe()
1052 acpi_dev->pnp.bus_id); in acpi_device_probe()
1061 struct acpi_driver *acpi_drv = to_acpi_driver(dev->driver); in acpi_device_remove()
1063 if (acpi_drv->ops.notify) in acpi_device_remove()
1066 if (acpi_drv->ops.remove) in acpi_device_remove()
1067 acpi_drv->ops.remove(acpi_dev); in acpi_device_remove()
1069 acpi_dev->driver_data = NULL; in acpi_device_remove()
1097 if (dev->bus != &acpi_bus_type) in acpi_dev_for_one_check()
1100 return adwc->fn(to_acpi_device(dev), adwc->data); in acpi_dev_for_one_check()
1112 return device_for_each_child(&adev->dev, &adwc, acpi_dev_for_one_check); in acpi_dev_for_each_child()
1124 return device_for_each_child_reverse(&adev->dev, &adwc, acpi_dev_for_one_check); in acpi_dev_for_each_child_reverse()
1127 /* --------------------------------------------------------------------------
1129 -------------------------------------------------------------------------- */
1163 return -ENODEV; in acpi_bus_init_irq()
1171 return -ENODEV; in acpi_bus_init_irq()
1178 * acpi_early_init - Initialize ACPICA and populate the ACPI namespace.
1232 /* Set PIC-mode SCI trigger type */ in acpi_early_init()
1250 * acpi_subsystem_init - Finalize the early initialization of ACPI.
1372 * Create the top ACPI proc directory in acpi_bus_init()
1383 return -ENODEV; in acpi_bus_init()
1395 return -ENODEV; in acpi_init()