Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / acpi / acpi_ffh.c
blob8d5126963dc790ef96b5d0e40efce706d0312a13
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Author: Sudeep Holla <sudeep.holla@arm.com>
4 * Copyright 2022 Arm Limited
5 */
6 #include <linux/kernel.h>
7 #include <linux/acpi.h>
8 #include <linux/completion.h>
9 #include <linux/idr.h>
10 #include <linux/io.h>
12 static struct acpi_ffh_info ffh_ctx;
14 int __weak acpi_ffh_address_space_arch_setup(void *handler_ctxt,
15 void **region_ctxt)
17 return -EOPNOTSUPP;
20 int __weak acpi_ffh_address_space_arch_handler(acpi_integer *value,
21 void *region_context)
23 return -EOPNOTSUPP;
26 static acpi_status
27 acpi_ffh_address_space_setup(acpi_handle region_handle, u32 function,
28 void *handler_context, void **region_context)
30 return acpi_ffh_address_space_arch_setup(handler_context,
31 region_context);
34 static acpi_status
35 acpi_ffh_address_space_handler(u32 function, acpi_physical_address addr,
36 u32 bits, acpi_integer *value,
37 void *handler_context, void *region_context)
39 return acpi_ffh_address_space_arch_handler(value, region_context);
42 void __init acpi_init_ffh(void)
44 acpi_status status;
46 status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
47 ACPI_ADR_SPACE_FIXED_HARDWARE,
48 &acpi_ffh_address_space_handler,
49 &acpi_ffh_address_space_setup,
50 &ffh_ctx);
51 if (ACPI_FAILURE(status))
52 pr_alert("OperationRegion handler could not be installed\n");