forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/rockchip/rockchip_spdif.h
....@@ -1,12 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * ALSA SoC Audio Layer - Rockchip SPDIF transceiver driver
34 *
45 * Copyright (c) 2015 Collabora Ltd.
56 * Author: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #ifndef _ROCKCHIP_SPDIF_H
....@@ -18,7 +15,19 @@
1815 */
1916 #define SPDIF_CFGR_CLK_DIV_SHIFT (16)
2017 #define SPDIF_CFGR_CLK_DIV_MASK (0xff << SPDIF_CFGR_CLK_DIV_SHIFT)
21
-#define SPDIF_CFGR_CLK_DIV(x) (x << SPDIF_CFGR_CLK_DIV_SHIFT)
18
+#define SPDIF_CFGR_CLK_DIV(x) ((x - 1) << SPDIF_CFGR_CLK_DIV_SHIFT)
19
+
20
+#define SPDIF_CFGR_CLR_MASK BIT(7)
21
+#define SPDIF_CFGR_CLR_EN BIT(7)
22
+#define SPDIF_CFGR_CLR_DIS 0
23
+
24
+#define SPDIF_CFGR_CSE_MASK BIT(6)
25
+#define SPDIF_CFGR_CSE_EN BIT(6)
26
+#define SPDIF_CFGR_CSE_DIS 0
27
+
28
+#define SPDIF_CFGR_ADJ_MASK BIT(3)
29
+#define SPDIF_CFGR_ADJ_LEFT_J BIT(3)
30
+#define SPDIF_CFGR_ADJ_RIGHT_J 0
2231
2332 #define SPDIF_CFGR_HALFWORD_SHIFT 2
2433 #define SPDIF_CFGR_HALFWORD_DISABLE (0 << SPDIF_CFGR_HALFWORD_SHIFT)
....@@ -59,5 +68,9 @@
5968 #define SPDIF_INTSR (0x0010)
6069 #define SPDIF_XFER (0x0018)
6170 #define SPDIF_SMPDR (0x0020)
71
+#define SPDIF_VLDFRn(x) (0x0060 + (x) * 4)
72
+#define SPDIF_USRDRn(x) (0x0090 + (x) * 4)
73
+#define SPDIF_CHNSRn(x) (0x00c0 + (x) * 4)
74
+#define SPDIF_VERSION (0x01c0)
6275
6376 #endif /* _ROCKCHIP_SPDIF_H */