From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: linux-sound@vger.kernel.org
Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org,
rafael@kernel.org, vkoul@kernel.org,
andriy.shevchenko@linux.intel.com,
"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
"Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
"Bard Liao" <yung-chuan.liao@linux.intel.com>,
"Len Brown" <lenb@kernel.org>,
linux-acpi@vger.kernel.org (open list:ACPI),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 1/3] ACPI: utils: introduce acpi_get_local_u64_address()
Date: Tue, 28 May 2024 14:29:33 -0500 [thread overview]
Message-ID: <20240528192936.16180-2-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20240528192936.16180-1-pierre-louis.bossart@linux.intel.com>
The ACPI _ADR is a 64-bit value. We changed the definitions in commit
ca6f998cf9a2 ("ACPI: bus: change _ADR representation to 64 bits") but
some helpers still assume the value is a 32-bit value.
This patch adds a new helper to extract the full 64-bits. The existing
32-bit helper is kept for backwards-compatibility and cases where the
_ADR is known to fit in a 32-bit value.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
drivers/acpi/utils.c | 22 ++++++++++++++++------
include/linux/acpi.h | 1 +
2 files changed, 17 insertions(+), 6 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_u64_address(acpi_handle handle, u64 *addr)
+{
+ acpi_status status;
+
+ 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)
{
- unsigned long long adr;
- acpi_status status;
-
- status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr);
- if (ACPI_FAILURE(status))
- return -ENODATA;
+ u64 adr;
+ int ret;
+ ret = acpi_get_local_u64_address(handle, &adr);
+ if (ret < 0)
+ return ret;
*addr = (u32)adr;
return 0;
}
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 28c3fb2bef0d..65e7177bcb02 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -761,6 +761,7 @@ static inline u64 acpi_arch_get_root_pointer(void)
}
#endif
+int acpi_get_local_u64_address(acpi_handle handle, u64 *addr);
int acpi_get_local_address(acpi_handle handle, u32 *addr);
const char *acpi_get_subsystem_id(acpi_handle handle);
--
2.43.0
next prev parent reply other threads:[~2024-05-28 19:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 19:29 [PATCH 0/3] ACPI/ALSA/soundwire: add acpi_get_local_u64_address() helper Pierre-Louis Bossart
2024-05-28 19:29 ` Pierre-Louis Bossart [this message]
2024-06-07 18:51 ` [PATCH 1/3] ACPI: utils: introduce acpi_get_local_u64_address() Rafael J. Wysocki
2024-06-07 20:33 ` Pierre-Louis Bossart
2024-06-07 21:59 ` Mark Brown
2024-06-08 11:58 ` Rafael J. Wysocki
2024-05-28 19:29 ` [PATCH 2/3] soundwire: slave: simplify code with acpi_get_local_u64_address() Pierre-Louis Bossart
2024-06-02 14:49 ` Vinod Koul
2024-05-28 19:29 ` [PATCH 3/3] ALSA: hda: intel-sdw-acpi: use acpi_get_local_u64_address() Pierre-Louis Bossart
2024-05-29 14:32 ` [PATCH 0/3] ACPI/ALSA/soundwire: add acpi_get_local_u64_address() helper Takashi Iwai
2024-05-30 15:14 ` Andy Shevchenko
2024-06-11 10:19 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240528192936.16180-2-pierre-louis.bossart@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=peter.ujfalusi@linux.intel.com \
--cc=rafael@kernel.org \
--cc=tiwai@suse.de \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox