251a7e0347a780a04f22c8127da8d6e36424b09b
[linux-2.6-microblaze.git] / sound / soc / amd / vangogh / acp5x.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * AMD ALSA SoC PCM Driver
4  *
5  * Copyright (C) 2021 Advanced Micro Devices, Inc. All rights reserved.
6  */
7
8 #include "vg_chip_offset_byte.h"
9
10 #define ACP5x_PHY_BASE_ADDRESS 0x1240000
11 #define ACP_DEVICE_ID 0x15E2
12
13 /* common header file uses exact offset rather than relative
14  * offset which requires subtraction logic from base_addr
15  * for accessing ACP5x MMIO space registers
16  */
17 static inline u32 acp_readl(void __iomem *base_addr)
18 {
19         return readl(base_addr - ACP5x_PHY_BASE_ADDRESS);
20 }
21
22 static inline void acp_writel(u32 val, void __iomem *base_addr)
23 {
24         writel(val, base_addr - ACP5x_PHY_BASE_ADDRESS);
25 }