summaryrefslogtreecommitdiff
path: root/drivers/acpi/utils.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-06-11 00:49:29 +0300
committerMark Brown <broonie@kernel.org>2024-06-11 00:49:29 +0300
commit40751808803b78f6dda7f39e6717eb9dc8c5c309 (patch)
tree1123477260691caec97c014ee96b947d51482931 /drivers/acpi/utils.c
parentcb0ab6400987decc3f205606c2e96198eef6bc67 (diff)
parent9b7dc68eeba04d20f4a1733e791bc71355423612 (diff)
downloadlinux-40751808803b78f6dda7f39e6717eb9dc8c5c309.tar.xz
ACPI/ALSA/soundwire: add acpi_get_local_u64_address()
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: The acpi_get_local_address() helper assumes a 32-bit ADR is used. If we want to use this helper for SoundWire/SDCA ASoC codecs, we need an extension where the native 64-bits are used. This patchset suggests a new helper, acpi_get_local_address() may be renamed if desired in a folow-up patch. The path of least resistance would be to merge this patchset in the ASoC tree, since I have additional changes for ASoC/SDCA (SoundWire Device Class) that depend on the new helper. Pierre-Louis Bossart (3): ACPI: utils: introduce acpi_get_local_u64_address() soundwire: slave: simplify code with acpi_get_local_u64_address() ALSA: hda: intel-sdw-acpi: use acpi_get_local_u64_address() drivers/acpi/utils.c | 22 ++++++++++++++++------ drivers/soundwire/slave.c | 13 ++++--------- include/linux/acpi.h | 1 + sound/hda/intel-sdw-acpi.c | 6 +++--- 4 files changed, 24 insertions(+), 18 deletions(-) -- 2.43.0
Diffstat (limited to 'drivers/acpi/utils.c')
-rw-r--r--drivers/acpi/utils.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 202234ba54bd..ae9384282273 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -277,15 +277,25 @@ acpi_evaluate_integer(acpi_handle handle,
EXPORT_SYMBOL(acpi_evaluate_integer);
-int acpi_get_local_address(acpi_handle handle, u32 *addr)
+int acpi_get_local_u64_address(acpi_handle handle, u64 *addr)
{
- unsigned long long adr;
acpi_status status;
- status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr);
+ status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, addr);
if (ACPI_FAILURE(status))
return -ENODATA;
+ return 0;
+}
+EXPORT_SYMBOL(acpi_get_local_u64_address);
+
+int acpi_get_local_address(acpi_handle handle, u32 *addr)
+{
+ u64 adr;
+ int ret;
+ ret = acpi_get_local_u64_address(handle, &adr);
+ if (ret < 0)
+ return ret;
*addr = (u32)adr;
return 0;
}