#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/acpi.h>
#include <linux/acpi_iort.h>
#include <linux/acpi_viot.h>
#include <linux/iommu.h>
#include <linux/signal.h>
#include <linux/kthread.h>
#include <linux/dmi.h>
#include <linux/dma-map-ops.h>
#include <linux/platform_data/x86/apple.h>
#include <linux/pgtable.h>
#include <linux/crc32.h>
#include <linux/dma-direct.h>
#include "internal.h"
#include "sleep.h"
#define ACPI_BUS_CLASS …
#define ACPI_BUS_HID …
#define ACPI_BUS_DEVICE_NAME …
#define INVALID_ACPI_HANDLE …
static const char *dummy_hid = …;
static LIST_HEAD(acpi_dep_list);
static DEFINE_MUTEX(acpi_dep_list_lock);
LIST_HEAD(…);
static DEFINE_MUTEX(acpi_scan_lock);
static LIST_HEAD(acpi_scan_handlers_list);
DEFINE_MUTEX(…) …;
LIST_HEAD(…);
static DEFINE_MUTEX(acpi_hp_context_lock);
static u64 spcr_uart_addr;
void acpi_scan_lock_acquire(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void acpi_scan_lock_release(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void acpi_lock_hp_context(void)
{ … }
void acpi_unlock_hp_context(void)
{ … }
void acpi_initialize_hp_context(struct acpi_device *adev,
struct acpi_hotplug_context *hp,
acpi_hp_notify notify, acpi_hp_uevent uevent)
{ … }
EXPORT_SYMBOL_GPL(…);
int acpi_scan_add_handler(struct acpi_scan_handler *handler)
{ … }
int acpi_scan_add_handler_with_hotplug(struct acpi_scan_handler *handler,
const char *hotplug_profile_name)
{ … }
bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
{ … }
static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
void **ret_p)
{ … }
static acpi_status acpi_bus_online(acpi_handle handle, u32 lvl, void *data,
void **ret_p)
{ … }
static int acpi_scan_try_to_offline(struct acpi_device *device)
{ … }
#define ACPI_SCAN_CHECK_FLAG_STATUS …
#define ACPI_SCAN_CHECK_FLAG_EJECT …
static int acpi_scan_check_and_detach(struct acpi_device *adev, void *p)
{ … }
static int acpi_bus_post_eject(struct acpi_device *adev, void *not_used)
{ … }
static void acpi_scan_check_subtree(struct acpi_device *adev)
{ … }
static int acpi_scan_hot_remove(struct acpi_device *device)
{ … }
static int acpi_scan_rescan_bus(struct acpi_device *adev)
{ … }
static int acpi_scan_device_check(struct acpi_device *adev)
{ … }
static int acpi_scan_bus_check(struct acpi_device *adev)
{ … }
static int acpi_generic_hotplug_event(struct acpi_device *adev, u32 type)
{ … }
void acpi_device_hotplug(struct acpi_device *adev, u32 src)
{ … }
static void acpi_free_power_resources_lists(struct acpi_device *device)
{ … }
static void acpi_device_release(struct device *dev)
{ … }
static void acpi_device_del(struct acpi_device *device)
{ … }
static BLOCKING_NOTIFIER_HEAD(acpi_reconfig_chain);
static LIST_HEAD(acpi_device_del_list);
static DEFINE_MUTEX(acpi_device_del_lock);
static void acpi_device_del_work_fn(struct work_struct *work_not_used)
{ … }
static void acpi_scan_drop_device(acpi_handle handle, void *context)
{ … }
static struct acpi_device *handle_to_device(acpi_handle handle,
void (*callback)(void *))
{ … }
struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle)
{ … }
EXPORT_SYMBOL_GPL(…);
static void get_acpi_device(void *dev)
{ … }
struct acpi_device *acpi_get_acpi_dev(acpi_handle handle)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id)
{ … }
static int acpi_device_set_name(struct acpi_device *device,
struct acpi_device_bus_id *acpi_device_bus_id)
{ … }
int acpi_tie_acpi_dev(struct acpi_device *adev)
{ … }
static void acpi_store_pld_crc(struct acpi_device *adev)
{ … }
int acpi_device_add(struct acpi_device *device)
{ … }
static bool acpi_info_matches_ids(struct acpi_device_info *info,
const char * const ids[])
{ … }
static const char * const acpi_ignore_dep_ids[] = …;
static const char * const acpi_honor_dep_ids[] = …;
static struct acpi_device *acpi_find_parent_acpi_dev(acpi_handle handle)
{ … }
acpi_status
acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
{ … }
EXPORT_SYMBOL_GPL(…);
static int acpi_bus_extract_wakeup_device_power_package(struct acpi_device *dev)
{ … }
#define ACPI_AVOID_WAKE_FROM_S5 …
static bool acpi_wakeup_gpe_init(struct acpi_device *device)
{ … }
static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
{ … }
static void acpi_bus_init_power_state(struct acpi_device *device, int state)
{ … }
static void acpi_bus_get_power_flags(struct acpi_device *device)
{ … }
static void acpi_bus_get_flags(struct acpi_device *device)
{ … }
static void acpi_device_get_busid(struct acpi_device *device)
{ … }
bool acpi_ata_match(acpi_handle handle)
{ … }
bool acpi_bay_match(acpi_handle handle)
{ … }
bool acpi_device_is_battery(struct acpi_device *adev)
{ … }
static bool is_ejectable_bay(struct acpi_device *adev)
{ … }
bool acpi_dock_match(acpi_handle handle)
{ … }
static acpi_status
acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context,
void **return_value)
{ … }
long acpi_is_video_device(acpi_handle handle)
{ … }
EXPORT_SYMBOL(…);
const char *acpi_device_hid(struct acpi_device *device)
{ … }
EXPORT_SYMBOL(…);
static void acpi_add_id(struct acpi_device_pnp *pnp, const char *dev_id)
{ … }
static bool acpi_ibm_smbus_match(acpi_handle handle)
{ … }
static bool acpi_object_is_system_bus(acpi_handle handle)
{ … }
static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp,
int device_type)
{ … }
void acpi_free_pnp_ids(struct acpi_device_pnp *pnp)
{ … }
bool acpi_dma_supported(const struct acpi_device *adev)
{ … }
enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev)
{ … }
int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map)
{ … }
#ifdef CONFIG_IOMMU_API
int acpi_iommu_fwspec_init(struct device *dev, u32 id,
struct fwnode_handle *fwnode)
{ … }
static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
{ … }
#else
int acpi_iommu_fwspec_init(struct device *dev, u32 id,
struct fwnode_handle *fwnode)
{
return -ENODEV;
}
static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
{
return -ENODEV;
}
#endif
int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
const u32 *input_id)
{ … }
EXPORT_SYMBOL_GPL(…);
static void acpi_init_coherency(struct acpi_device *adev)
{ … }
static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data)
{ … }
static bool acpi_is_indirect_io_slave(struct acpi_device *device)
{ … }
static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
{ … }
void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
int type, void (*release)(struct device *))
{ … }
static void acpi_scan_dep_init(struct acpi_device *adev)
{ … }
void acpi_device_add_finalize(struct acpi_device *device)
{ … }
static void acpi_scan_init_status(struct acpi_device *adev)
{ … }
static int acpi_add_single_object(struct acpi_device **child,
acpi_handle handle, int type, bool dep_init)
{ … }
static acpi_status acpi_get_resource_memory(struct acpi_resource *ares,
void *context)
{ … }
static bool acpi_device_should_be_hidden(acpi_handle handle)
{ … }
bool acpi_device_is_present(const struct acpi_device *adev)
{ … }
bool acpi_device_is_enabled(const struct acpi_device *adev)
{ … }
static bool acpi_scan_handler_matching(struct acpi_scan_handler *handler,
const char *idstr,
const struct acpi_device_id **matchid)
{ … }
static struct acpi_scan_handler *acpi_scan_match_handler(const char *idstr,
const struct acpi_device_id **matchid)
{ … }
void acpi_scan_hotplug_enabled(struct acpi_hotplug_profile *hotplug, bool val)
{ … }
int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices)
{ … }
static void acpi_scan_init_hotplug(struct acpi_device *adev)
{ … }
u32 __weak arch_acpi_add_auto_dep(acpi_handle handle) { … }
static u32 acpi_scan_check_dep(acpi_handle handle)
{ … }
static acpi_status acpi_scan_check_crs_csi2_cb(acpi_handle handle, u32 a, void *b, void **c)
{ … }
static acpi_status acpi_bus_check_add(acpi_handle handle, bool first_pass,
struct acpi_device **adev_p)
{ … }
static acpi_status acpi_bus_check_add_1(acpi_handle handle, u32 lvl_not_used,
void *not_used, void **ret_p)
{ … }
static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used,
void *not_used, void **ret_p)
{ … }
static void acpi_default_enumeration(struct acpi_device *device)
{ … }
static const struct acpi_device_id generic_device_ids[] = …;
static int acpi_generic_device_attach(struct acpi_device *adev,
const struct acpi_device_id *not_used)
{ … }
static struct acpi_scan_handler generic_device_handler = …;
static int acpi_scan_attach_handler(struct acpi_device *device)
{ … }
static int acpi_bus_attach(struct acpi_device *device, void *first_pass)
{ … }
static int acpi_dev_get_next_consumer_dev_cb(struct acpi_dep_data *dep, void *data)
{ … }
struct acpi_scan_clear_dep_work { … };
static void acpi_scan_clear_dep_fn(struct work_struct *work)
{ … }
static bool acpi_scan_clear_dep_queue(struct acpi_device *adev)
{ … }
static void acpi_scan_delete_dep_data(struct acpi_dep_data *dep)
{ … }
static int acpi_scan_clear_dep(struct acpi_dep_data *dep, void *data)
{ … }
static int acpi_walk_dep_device_list(acpi_handle handle,
int (*callback)(struct acpi_dep_data *, void *),
void *data)
{ … }
void acpi_dev_clear_dependencies(struct acpi_device *supplier)
{ … }
EXPORT_SYMBOL_GPL(…);
bool acpi_dev_ready_for_enumeration(const struct acpi_device *device)
{ … }
EXPORT_SYMBOL_GPL(…);
struct acpi_device *acpi_dev_get_next_consumer_dev(struct acpi_device *supplier,
struct acpi_device *start)
{ … }
EXPORT_SYMBOL_GPL(…);
static void acpi_scan_postponed_branch(acpi_handle handle)
{ … }
static void acpi_scan_postponed(void)
{ … }
int acpi_bus_scan(acpi_handle handle)
{ … }
EXPORT_SYMBOL(…);
void acpi_bus_trim(struct acpi_device *adev)
{ … }
EXPORT_SYMBOL_GPL(…);
int acpi_bus_register_early_device(int type)
{ … }
EXPORT_SYMBOL_GPL(…);
static void acpi_bus_scan_fixed(void)
{ … }
static void __init acpi_get_spcr_uart_addr(void)
{ … }
static bool acpi_scan_initialized;
void __init acpi_scan_init(void)
{ … }
static struct acpi_probe_entry *ape;
static int acpi_probe_count;
static DEFINE_MUTEX(acpi_probe_mutex);
static int __init acpi_match_madt(union acpi_subtable_headers *header,
const unsigned long end)
{ … }
void __weak arch_sort_irqchip_probe(struct acpi_probe_entry *ap_head, int nr) { … }
int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr)
{ … }
static void acpi_table_events_fn(struct work_struct *work)
{ … }
void acpi_scan_table_notify(void)
{ … }
int acpi_reconfig_notifier_register(struct notifier_block *nb)
{ … }
EXPORT_SYMBOL(…);
int acpi_reconfig_notifier_unregister(struct notifier_block *nb)
{ … }
EXPORT_SYMBOL(…);