Skip to content

Commit 5bbb391

Browse files
committed
Add audio support for acp7.2 platform
Merge series from Venkata Prasad Potturu <[email protected]>: This patch series is to add legacy and sof audio support for acp7.2 platform.
2 parents 1b03391 + 1c4c768 commit 5bbb391

File tree

9 files changed

+26
-0
lines changed

9 files changed

+26
-0
lines changed

sound/soc/amd/acp/acp-sdw-legacy-mach.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
158158
break;
159159
case ACP70_PCI_REV:
160160
case ACP71_PCI_REV:
161+
case ACP72_PCI_REV:
161162
ret = get_acp70_cpu_pin_id(ffs(soc_end->link_mask - 1),
162163
*be_id, &cpu_pin_id, dev);
163164
if (ret)
@@ -264,6 +265,7 @@ static int create_sdw_dailinks(struct snd_soc_card *card,
264265
case ACP63_PCI_REV:
265266
case ACP70_PCI_REV:
266267
case ACP71_PCI_REV:
268+
case ACP72_PCI_REV:
267269
sdw_platform_component->name = "amd_ps_sdw_dma.0";
268270
break;
269271
default:
@@ -311,6 +313,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
311313
case ACP63_PCI_REV:
312314
case ACP70_PCI_REV:
313315
case ACP71_PCI_REV:
316+
case ACP72_PCI_REV:
314317
pdm_cpu->name = "acp_ps_pdm_dma.0";
315318
pdm_platform->name = "acp_ps_pdm_dma.0";
316319
break;

sound/soc/amd/acp/acp-sdw-sof-mach.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
130130
break;
131131
case ACP70_PCI_REV:
132132
case ACP71_PCI_REV:
133+
case ACP72_PCI_REV:
133134
ret = get_acp70_cpu_pin_id(ffs(sof_end->link_mask - 1),
134135
*be_id, &cpu_pin_id, dev);
135136
if (ret)

sound/soc/amd/acp/soc_amd_sdw_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#define ACP63_PCI_REV 0x63
2222
#define ACP70_PCI_REV 0x70
2323
#define ACP71_PCI_REV 0x71
24+
#define ACP72_PCI_REV 0x72
25+
2426
#define SOC_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0))
2527
#define ASOC_SDW_FOUR_SPK BIT(4)
2628
#define ASOC_SDW_ACP_DMIC BIT(5)

sound/soc/amd/ps/acp63.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define ACP63_PCI_REV 0x63
1515
#define ACP70_PCI_REV 0x70
1616
#define ACP71_PCI_REV 0x71
17+
#define ACP72_PCI_REV 0x72
1718

1819
#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001
1920
#define ACP63_PGFSM_CNTL_POWER_ON_MASK 1

sound/soc/amd/ps/pci-ps.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ static short int check_and_handle_sdw_dma_irq(struct acp63_dev_data *adata, u32
117117
break;
118118
case ACP70_PCI_REV:
119119
case ACP71_PCI_REV:
120+
case ACP72_PCI_REV:
120121
adata->acp70_sdw0_dma_intr_stat[stream_id] = 1;
121122
break;
122123
}
@@ -141,6 +142,7 @@ static short int check_and_handle_sdw_dma_irq(struct acp63_dev_data *adata, u32
141142
break;
142143
case ACP70_PCI_REV:
143144
case ACP71_PCI_REV:
145+
case ACP72_PCI_REV:
144146
if (ext_intr_stat1 & ACP70_P1_SDW_DMA_IRQ_MASK) {
145147
for (index = ACP70_P1_AUDIO2_RX_THRESHOLD;
146148
index <= ACP70_P1_AUDIO0_TX_THRESHOLD; index++) {
@@ -552,6 +554,7 @@ static int acp_hw_init_ops(struct acp63_dev_data *adata, struct pci_dev *pci)
552554
break;
553555
case ACP70_PCI_REV:
554556
case ACP71_PCI_REV:
557+
case ACP72_PCI_REV:
555558
acp70_hw_init_ops(adata->hw_ops);
556559
break;
557560
default:
@@ -581,6 +584,7 @@ static int snd_acp63_probe(struct pci_dev *pci,
581584
case ACP63_PCI_REV:
582585
case ACP70_PCI_REV:
583586
case ACP71_PCI_REV:
587+
case ACP72_PCI_REV:
584588
break;
585589
default:
586590
dev_dbg(&pci->dev, "acp63/acp70/acp71 pci device not found\n");

sound/soc/amd/ps/ps-sdw-dma.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ static int acp63_configure_sdw_ringbuffer(void __iomem *acp_base, u32 stream_id,
269269
break;
270270
case ACP70_PCI_REV:
271271
case ACP71_PCI_REV:
272+
case ACP72_PCI_REV:
272273
switch (manager_instance) {
273274
case ACP_SDW0:
274275
reg_dma_size = acp70_sdw0_dma_reg[stream_id].reg_dma_size;
@@ -382,6 +383,7 @@ static int acp63_sdw_dma_hw_params(struct snd_soc_component *component,
382383
break;
383384
case ACP70_PCI_REV:
384385
case ACP71_PCI_REV:
386+
case ACP72_PCI_REV:
385387
switch (stream->instance) {
386388
case ACP_SDW0:
387389
sdw_data->acp70_sdw0_dma_stream[stream_id] = substream;
@@ -451,6 +453,7 @@ static u64 acp63_sdw_get_byte_count(struct acp_sdw_dma_stream *stream, void __io
451453
break;
452454
case ACP70_PCI_REV:
453455
case ACP71_PCI_REV:
456+
case ACP72_PCI_REV:
454457
switch (stream->instance) {
455458
case ACP_SDW0:
456459
pos_low_reg = acp70_sdw0_dma_reg[stream->stream_id].pos_low_reg;
@@ -529,6 +532,7 @@ static int acp63_sdw_dma_close(struct snd_soc_component *component,
529532
break;
530533
case ACP70_PCI_REV:
531534
case ACP71_PCI_REV:
535+
case ACP72_PCI_REV:
532536
switch (stream->instance) {
533537
case ACP_SDW0:
534538
sdw_data->acp70_sdw0_dma_stream[stream->stream_id] = NULL;
@@ -574,6 +578,7 @@ static int acp63_sdw_dma_enable(struct snd_pcm_substream *substream,
574578
break;
575579
case ACP70_PCI_REV:
576580
case ACP71_PCI_REV:
581+
case ACP72_PCI_REV:
577582
switch (stream->instance) {
578583
case ACP_SDW0:
579584
sdw_dma_en_reg = acp70_sdw0_dma_enable_reg[stream_id];

sound/soc/sof/amd/acp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static void init_dma_descriptor(struct acp_dev_data *adata)
5959
switch (acp_data->pci_rev) {
6060
case ACP70_PCI_ID:
6161
case ACP71_PCI_ID:
62+
case ACP72_PCI_ID:
6263
acp_dma_desc_base_addr = ACP70_DMA_DESC_BASE_ADDR;
6364
acp_dma_desc_max_num_dscr = ACP70_DMA_DESC_MAX_NUM_DSCR;
6465
break;
@@ -99,6 +100,7 @@ static int config_dma_channel(struct acp_dev_data *adata, unsigned int ch,
99100
switch (acp_data->pci_rev) {
100101
case ACP70_PCI_ID:
101102
case ACP71_PCI_ID:
103+
case ACP72_PCI_ID:
102104
acp_dma_cntl_0 = ACP70_DMA_CNTL_0;
103105
acp_dma_ch_rst_sts = ACP70_DMA_CH_RST_STS;
104106
acp_dma_dscr_err_sts_0 = ACP70_DMA_ERR_STS_0;
@@ -339,6 +341,7 @@ int acp_dma_status(struct acp_dev_data *adata, unsigned char ch)
339341
switch (adata->pci_rev) {
340342
case ACP70_PCI_ID:
341343
case ACP71_PCI_ID:
344+
case ACP72_PCI_ID:
342345
acp_dma_ch_sts = ACP70_DMA_CH_STS;
343346
break;
344347
default:
@@ -522,6 +525,7 @@ static irqreturn_t acp_irq_handler(int irq, void *dev_id)
522525
switch (adata->pci_rev) {
523526
case ACP70_PCI_ID:
524527
case ACP71_PCI_ID:
528+
case ACP72_PCI_ID:
525529
wake_irq_flag = amd_sof_check_and_handle_acp70_sdw_wake_irq(sdev);
526530
break;
527531
}
@@ -559,6 +563,7 @@ static int acp_power_on(struct snd_sof_dev *sdev)
559563
break;
560564
case ACP70_PCI_ID:
561565
case ACP71_PCI_ID:
566+
case ACP72_PCI_ID:
562567
acp_pgfsm_status_mask = ACP70_PGFSM_STATUS_MASK;
563568
acp_pgfsm_cntl_mask = ACP70_PGFSM_CNTL_POWER_ON_MASK;
564569
break;
@@ -661,6 +666,7 @@ static int acp_init(struct snd_sof_dev *sdev)
661666
switch (acp_data->pci_rev) {
662667
case ACP70_PCI_ID:
663668
case ACP71_PCI_ID:
669+
case ACP72_PCI_ID:
664670
sdw0_wake_en = snd_sof_dsp_read(sdev, ACP_DSP_BAR, ACP70_SW0_WAKE_EN);
665671
sdw1_wake_en = snd_sof_dsp_read(sdev, ACP_DSP_BAR, ACP70_SW1_WAKE_EN);
666672
if (sdw0_wake_en || sdw1_wake_en)
@@ -712,6 +718,7 @@ int amd_sof_acp_suspend(struct snd_sof_dev *sdev, u32 target_state)
712718
switch (acp_data->pci_rev) {
713719
case ACP70_PCI_ID:
714720
case ACP71_PCI_ID:
721+
case ACP72_PCI_ID:
715722
enable = true;
716723
break;
717724
}
@@ -738,6 +745,7 @@ int amd_sof_acp_resume(struct snd_sof_dev *sdev)
738745
switch (acp_data->pci_rev) {
739746
case ACP70_PCI_ID:
740747
case ACP71_PCI_ID:
748+
case ACP72_PCI_ID:
741749
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP70_PME_EN, 1);
742750
break;
743751
}

sound/soc/sof/amd/acp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#define ACP63_PCI_ID 0x63
7676
#define ACP70_PCI_ID 0x70
7777
#define ACP71_PCI_ID 0x71
78+
#define ACP72_PCI_ID 0x72
7879

7980
#define HOST_BRIDGE_CZN 0x1630
8081
#define HOST_BRIDGE_VGH 0x1645

sound/soc/sof/amd/pci-acp70.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static int acp70_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_
7777
switch (pci->revision) {
7878
case ACP70_PCI_ID:
7979
case ACP71_PCI_ID:
80+
case ACP72_PCI_ID:
8081
break;
8182
default:
8283
return -ENODEV;

0 commit comments

Comments
 (0)