summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd/acp/amd.h
diff options
context:
space:
mode:
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>2022-08-10 15:29:13 +0200
committerMark Brown <broonie@kernel.org>2022-08-15 02:19:42 +0200
commit12229b7e50cfa95fda55b83a2617eafd6ac4c8c5 (patch)
tree002bca02a5159c34144012d6d74fc6925ffca7f2 /sound/soc/amd/acp/amd.h
parentASoC: amd: acp: Initialize list to store acp_stream during pcm_open (diff)
downloadlinux-12229b7e50cfa95fda55b83a2617eafd6ac4c8c5.tar.xz
linux-12229b7e50cfa95fda55b83a2617eafd6ac4c8c5.zip
ASoC: amd: acp: Add TDM support for acp i2s stream
Add callback and code changes to enable ACP I2S controller in TDM mode. Add new fields in acp_stream and acp_dev_data struct to configure tdm related registers for ACP i2s controllers. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20220810132913.1181247-3-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp/amd.h')
-rw-r--r--sound/soc/amd/acp/amd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h
index e49269f42a4e..afa4e25cba19 100644
--- a/sound/soc/amd/acp/amd.h
+++ b/sound/soc/amd/acp/amd.h
@@ -84,6 +84,14 @@
#define ACP_MAX_STREAM 8
+#define TDM_ENABLE 1
+#define TDM_DISABLE 0
+
+#define SLOT_WIDTH_8 0x8
+#define SLOT_WIDTH_16 0x10
+#define SLOT_WIDTH_24 0x18
+#define SLOT_WIDTH_32 0x20
+
struct acp_chip_info {
char *name; /* Platform name */
unsigned int acp_rev; /* ACP Revision id */
@@ -96,6 +104,7 @@ struct acp_stream {
int irq_bit;
int dai_id;
int id;
+ int dir;
u64 bytescount;
u32 reg_offset;
u32 pte_offset;
@@ -120,6 +129,7 @@ struct acp_dev_data {
void __iomem *acp_base;
unsigned int i2s_irq;
+ bool tdm_mode;
/* SOC specific dais */
struct snd_soc_dai_driver *dai_driver;
int num_dai;
@@ -134,6 +144,8 @@ struct acp_dev_data {
u32 lrclk_div;
struct acp_resource *rsrc;
+ u32 tdm_tx_fmt[3];
+ u32 tdm_rx_fmt[3];
};
union acp_i2stdm_mstrclkgen {