Skip to content

Commit

Permalink
dai: support for amd specific hs dai id
Browse files Browse the repository at this point in the history
Add support for hs i2s instance on rembrandt
platform.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
  • Loading branch information
balakishorepati authored and lgirdwood committed Jun 15, 2022
1 parent e7cce06 commit 83ee5b4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/include/ipc/dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ enum sof_ipc_dai_type {
SOF_DAI_AMD_BT, /**< Amd BT */
SOF_DAI_AMD_SP, /**< Amd SP */
SOF_DAI_AMD_DMIC, /**< Amd DMIC */
SOF_DAI_AMD_HS, /**< Amd HS */
SOF_DAI_MEDIATEK_AFE /**< Mtk AFE */
};

Expand Down Expand Up @@ -117,6 +118,7 @@ struct sof_ipc_dai_config {
struct sof_ipc_dai_acp_params acpbt;
struct sof_ipc_dai_acp_params acpsp;
struct sof_ipc_dai_acpdmic_params acpdmic;
struct sof_ipc_dai_acp_params acphs;
struct sof_ipc_dai_afe_params afe;
};
} __attribute__((packed, aligned(4)));
Expand Down
24 changes: 16 additions & 8 deletions src/include/sof/drivers/acp_dai_dma.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2021 AMD. All rights reserved.
* Copyright(c) 2022 AMD. All rights reserved.
*
* Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
* Anup Kulkarni<anup.kulkarni@amd.com>
Expand All @@ -17,27 +17,35 @@
#include <user/trace.h>

#if CONFIG_AMD_BT
#define ACP_BT_ENABLE
#define ACP_BT_ENABLE
#endif

#if CONFIG_AMD_SP
#define ACP_SP_ENABLE
#endif

int acp_dma_init(struct sof *sof);

#define ACP_DMA_BUFFER_PERIOD_COUNT 2

/* default max number of channels supported */
#define ACP_DEFAULT_NUM_CHANNELS 2
#define ACP_DEFAULT_NUM_CHANNELS 2

/* default sample rate */
#define ACP_DEFAULT_SAMPLE_RATE 48000
#define ACP_DEFAULT_SAMPLE_RATE 48000

#define ACP_DMA_BUFFER_ALIGN 64
#define ACP_DMA_BUFFER_ALIGN_128 128
#define ACP_DMA_TRANS_SIZE 64
#define ACP_DMA_TRANS_SIZE_128 128
#define ACP_DAI_DMA_BUFFER_PERIOD_COUNT 2
#define ACP_DRAM_ADDRESS_MASK 0x0FFFFFFF

#define ACP_DMA_BUFFER_ALIGN 64
#define ACP_DMA_TRANS_SIZE 64
#define ACP_DAI_DMA_BUFFER_PERIOD_COUNT 2
#define ACP_DRAM_ADDRESS_MASK 0x0FFFFFFF

extern const struct dai_driver acp_spdai_driver;
extern const struct dai_driver acp_btdai_driver;
extern const struct dai_driver acp_dmic_dai_driver;
extern const struct dai_driver acp_hsdai_driver;

/* ACP private data */
struct acp_pdata {
Expand Down
3 changes: 1 addition & 2 deletions src/include/sof/lib/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ struct comp_buffer;
#define DMA_CAP_HDA BIT(0) /**< HDA DMA */
#define DMA_CAP_GP_LP BIT(1) /**< GP LP DMA */
#define DMA_CAP_GP_HP BIT(2) /**< GP HP DMA */
#define DMA_CAP_BT BIT(3) /**< DMA I2S */
#define DMA_CAP_BT BIT(3) /**< BT DMA */
#define DMA_CAP_SP BIT(4) /**< SP DMA */
#define DMA_CAP_DMIC BIT(5) /**< ACP DMA DMIC > */

/* DMA dev type bitmasks used to define the type of DMA */

#define DMA_DEV_HOST BIT(0) /**< connectable to host */
Expand Down
7 changes: 7 additions & 0 deletions src/ipc/ipc3/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ int dai_config_dma_channel(struct comp_dev *dev, void *spec_config)
channel = dai_get_handshake(dd->dai, dai->direction,
dd->stream_id);
break;
case SOF_DAI_AMD_HS:
channel = dai_get_handshake(dd->dai, dai->direction,
dd->stream_id);
break;
case SOF_DAI_MEDIATEK_AFE:
handshake = dai_get_handshake(dd->dai, dai->direction,
dd->stream_id);
Expand Down Expand Up @@ -157,6 +161,9 @@ int ipc_dai_data_config(struct comp_dev *dev)
dev->ipc_config.frame_fmt = SOF_IPC_FRAME_S32_LE;
dd->dma_buffer->stream.frame_fmt = dev->ipc_config.frame_fmt;
break;
case SOF_DAI_AMD_HS:
dev->ipc_config.frame_fmt = SOF_IPC_FRAME_S16_LE;
break;
case SOF_DAI_MEDIATEK_AFE:
break;
default:
Expand Down

0 comments on commit 83ee5b4

Please sign in to comment.