summaryrefslogtreecommitdiff
path: root/drivers/soundwire/amd_init.h
diff options
context:
space:
mode:
authorVijendar Mukunda <Vijendar.Mukunda@amd.com>2024-03-27 09:31:42 +0300
committerVinod Koul <vkoul@kernel.org>2024-03-28 21:09:50 +0300
commite05af1a42bb804e0465f76baa79a1ae8e4b619fc (patch)
tree37af889fbc9babeebf1eaae661dfd67e33109163 /drivers/soundwire/amd_init.h
parent91c4dd2e5c9066577960c7eef7dd8e699220c85e (diff)
downloadlinux-e05af1a42bb804e0465f76baa79a1ae8e4b619fc.tar.xz
soundwire: amd: use inline function for register update
Define common inline function for register update. Use this inline function for updating SoundWire Pad registers and enable/disable SoundWire interrupt control registers. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20240327063143.2266464-1-Vijendar.Mukunda@amd.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire/amd_init.h')
-rw-r--r--drivers/soundwire/amd_init.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/soundwire/amd_init.h b/drivers/soundwire/amd_init.h
index 928b0c707162..5e7b43836a37 100644
--- a/drivers/soundwire/amd_init.h
+++ b/drivers/soundwire/amd_init.h
@@ -10,4 +10,12 @@
int amd_sdw_manager_start(struct amd_sdw_manager *amd_manager);
+static inline void amd_updatel(void __iomem *mmio, int offset, u32 mask, u32 val)
+{
+ u32 tmp;
+
+ tmp = readl(mmio + offset);
+ tmp = (tmp & ~mask) | val;
+ writel(tmp, mmio + offset);
+}
#endif