summaryrefslogtreecommitdiff
path: root/sound/soc/amd/acp/amd.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-10-31 11:01:25 +0300
committerTakashi Iwai <tiwai@suse.de>2023-10-31 11:01:25 +0300
commit2dc15ff73b6a7b47db0e848498cb5b0479e781c6 (patch)
treed93457787d3349dadcbbf7691650ebdb1d0cd883 /sound/soc/amd/acp/amd.h
parentc468b5dd759ede754b23cbc9c50b048a781d4217 (diff)
parentbdb7e1922052b1e7fcce63e2cfa195958ff97e05 (diff)
downloadlinux-2dc15ff73b6a7b47db0e848498cb5b0479e781c6.tar.xz
Merge tag 'asoc-v6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v6.7 More updates for v6,7 following the early merge request: - Fixes for handling of component name prefixing when name prefixes are used by the machine driver. - Fixes for noise when stopping some Sounwire CODECs. - Support for AMD ACP 6.3 and 7.0, Awinc AW88399, more Intel platforms and more Qualcomm SC7180 platforms.
Diffstat (limited to 'sound/soc/amd/acp/amd.h')
-rw-r--r--sound/soc/amd/acp/amd.h71
1 files changed, 32 insertions, 39 deletions
diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h
index d6cfae6ec5f7..5017e868f39b 100644
--- a/sound/soc/amd/acp/amd.h
+++ b/sound/soc/amd/acp/amd.h
@@ -20,6 +20,8 @@
#define ACP3X_DEV 3
#define ACP6X_DEV 6
+#define ACP63_DEV 0x63
+#define ACP70_DEV 0x70
#define DMIC_INSTANCE 0x00
#define I2S_SP_INSTANCE 0x01
@@ -95,9 +97,15 @@
#define ACP6X_PGFSM_CONTROL 0x1024
#define ACP6X_PGFSM_STATUS 0x1028
+#define ACP63_PGFSM_CONTROL ACP6X_PGFSM_CONTROL
+#define ACP63_PGFSM_STATUS ACP6X_PGFSM_STATUS
+
+#define ACP70_PGFSM_CONTROL ACP6X_PGFSM_CONTROL
+#define ACP70_PGFSM_STATUS ACP6X_PGFSM_STATUS
+
#define ACP_SOFT_RST_DONE_MASK 0x00010001
-#define ACP_PGFSM_CNTL_POWER_ON_MASK 0x01
+#define ACP_PGFSM_CNTL_POWER_ON_MASK 0xffffffff
#define ACP_PGFSM_CNTL_POWER_OFF_MASK 0x00
#define ACP_PGFSM_STATUS_MASK 0x03
#define ACP_POWERED_ON 0x00
@@ -129,6 +137,7 @@ struct acp_chip_info {
unsigned int acp_rev; /* ACP Revision id */
void __iomem *base; /* ACP memory PCI base */
struct platform_device *chip_pdev;
+ unsigned int flag; /* Distinguish b/w Legacy or Only PDM */
};
struct acp_stream {
@@ -182,17 +191,27 @@ struct acp_dev_data {
u32 tdm_rx_fmt[3];
u32 xfer_tx_resolution[3];
u32 xfer_rx_resolution[3];
+ unsigned int flag;
+ unsigned int platform;
};
-union acp_i2stdm_mstrclkgen {
- struct {
- u32 i2stdm_master_mode : 1;
- u32 i2stdm_format_mode : 1;
- u32 i2stdm_lrclk_div_val : 9;
- u32 i2stdm_bclk_div_val : 11;
- u32:10;
- } bitfields, bits;
- u32 u32_all;
+enum acp_config {
+ ACP_CONFIG_0 = 0,
+ ACP_CONFIG_1,
+ ACP_CONFIG_2,
+ ACP_CONFIG_3,
+ ACP_CONFIG_4,
+ ACP_CONFIG_5,
+ ACP_CONFIG_6,
+ ACP_CONFIG_7,
+ ACP_CONFIG_8,
+ ACP_CONFIG_9,
+ ACP_CONFIG_10,
+ ACP_CONFIG_11,
+ ACP_CONFIG_12,
+ ACP_CONFIG_13,
+ ACP_CONFIG_14,
+ ACP_CONFIG_15,
};
extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops;
@@ -207,7 +226,7 @@ int smn_read(struct pci_dev *dev, u32 smn_addr);
int smn_write(struct pci_dev *dev, u32 smn_addr, u32 data);
int acp_init(struct acp_chip_info *chip);
-int acp_deinit(void __iomem *base);
+int acp_deinit(struct acp_chip_info *chip);
void acp_enable_interrupts(struct acp_dev_data *adata);
void acp_disable_interrupts(struct acp_dev_data *adata);
/* Machine configuration */
@@ -221,6 +240,8 @@ void restore_acp_pdm_params(struct snd_pcm_substream *substream,
int restore_acp_i2s_params(struct snd_pcm_substream *substream,
struct acp_dev_data *adata, struct acp_stream *stream);
+int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip);
+
static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int direction)
{
u64 byte_count = 0, low = 0, high = 0;
@@ -272,32 +293,4 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int
POINTER_RETURN_BYTES:
return byte_count;
}
-
-static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id)
-{
- union acp_i2stdm_mstrclkgen mclkgen;
- u32 master_reg;
-
- switch (dai_id) {
- case I2S_SP_INSTANCE:
- master_reg = ACP_I2STDM0_MSTRCLKGEN;
- break;
- case I2S_BT_INSTANCE:
- master_reg = ACP_I2STDM1_MSTRCLKGEN;
- break;
- case I2S_HS_INSTANCE:
- master_reg = ACP_I2STDM2_MSTRCLKGEN;
- break;
- default:
- master_reg = ACP_I2STDM0_MSTRCLKGEN;
- break;
- }
-
- mclkgen.bits.i2stdm_master_mode = 0x1;
- mclkgen.bits.i2stdm_format_mode = 0x00;
-
- mclkgen.bits.i2stdm_bclk_div_val = adata->bclk_div;
- mclkgen.bits.i2stdm_lrclk_div_val = adata->lrclk_div;
- writel(mclkgen.u32_all, adata->acp_base + master_reg);
-}
#endif