[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250217231747.1656228-2-superm1@kernel.org>
Date: Mon, 17 Feb 2025 17:17:41 -0600
From: Mario Limonciello <superm1@...nel.org>
To: Yazen Ghannam <yazen.ghannam@....com>,
Borislav Petkov <bp@...en8.de>,
Mark Brown <broonie@...nel.org>
Cc: Mario Limonciello <mario.limonciello@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
"H . Peter Anvin" <hpa@...or.com>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Daniel Baluta <daniel.baluta@....com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.dev>,
Vijendar Mukunda <Vijendar.Mukunda@....com>,
Peter Zijlstra <peterz@...radead.org>,
Jeff Johnson <quic_jjohnson@...cinc.com>,
Venkata Prasad Potturu <venkataprasad.potturu@....com>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Arnd Bergmann <arnd@...db.de>,
Cristian Ciocaltea <cristian.ciocaltea@...labora.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
linux-kernel@...r.kernel.org (open list:AMD NODE DRIVER),
linux-sound@...r.kernel.org (open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...),
sound-open-firmware@...a-project.org (moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS)
Subject: [PATCH 1/7] x86/amd_node: Add a helper for use with `read_poll_timeout`
From: Mario Limonciello <mario.limonciello@....com>
Some of the ACP drivers will poll registers through SMN using
`read_poll_timeout` which requires returning the result of the register
read as the argument.
Add a helper to do just that.
Tested by: Venkata Prasad Potturu <venkataprasad.potturu@....com>
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
arch/x86/include/asm/amd_node.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/x86/include/asm/amd_node.h b/arch/x86/include/asm/amd_node.h
index 113ad3e8ee40a..9f3f613366f7d 100644
--- a/arch/x86/include/asm/amd_node.h
+++ b/arch/x86/include/asm/amd_node.h
@@ -33,4 +33,15 @@ static inline u16 amd_num_nodes(void)
int __must_check amd_smn_read(u16 node, u32 address, u32 *value);
int __must_check amd_smn_write(u16 node, u32 address, u32 value);
+/* helper for use with read_poll_timeout */
+static inline int smn_read_register(u32 reg)
+{
+ int data, rc;
+
+ rc = amd_smn_read(0, reg, &data);
+ if (rc)
+ return rc;
+
+ return data;
+}
#endif /*_ASM_X86_AMD_NODE_H_*/
--
2.43.0
Powered by blists - more mailing lists