Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/sound/sof/dai-intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#define SOF_DAI_INTEL_SSP_CLKCTRL_FS_KA BIT(4)
/* bclk idle */
#define SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_IDLE_HIGH BIT(5)
/* mclk early start */
#define SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES BIT(6)
/* bclk early start */
#define SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_ES BIT(7)

/* DMIC max. four controllers for eight microphone channels */
#define SOF_DAI_INTEL_DMIC_NUM_CTRL 4
Expand Down
10 changes: 9 additions & 1 deletion include/sound/sof/dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
#define SOF_DAI_FMT_INV_MASK 0x0f00
#define SOF_DAI_FMT_CLOCK_PROVIDER_MASK 0xf000

/* DAI_CONFIG flags */
#define SOF_DAI_CONFIG_FLAGS_MASK 0x3
#define SOF_DAI_CONFIG_FLAGS_NONE (0 << 0) /**< DAI_CONFIG sent without stage information */
#define SOF_DAI_CONFIG_FLAGS_HW_PARAMS (1 << 0) /**< DAI_CONFIG sent during hw_params stage */
#define SOF_DAI_CONFIG_FLAGS_HW_FREE (2 << 0) /**< DAI_CONFIG sent during hw_free stage */
#define SOF_DAI_CONFIG_FLAGS_RFU (3 << 0) /**< not used, reserved for future use */

/** \brief Types of DAI */
enum sof_ipc_dai_type {
SOF_DAI_INTEL_NONE = 0, /**< None */
Expand All @@ -69,7 +76,8 @@ struct sof_ipc_dai_config {

/* physical protocol and clocking */
uint16_t format; /**< SOF_DAI_FMT_ */
uint16_t reserved16; /**< alignment */
uint8_t group_id; /**< group ID, 0 means no group (ABI 3.17) */
uint8_t flags; /**< SOF_DAI_CONFIG_FLAGS_ (ABI 3.19) */

/* reserved for future use */
uint32_t reserved[8];
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/sof/intel/hda-dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,8 @@ static int ssp_dai_setup_or_free(struct snd_pcm_substream *substream, struct snd
return hda_ctrl_dai_widget_free(w);
}

static int ssp_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
static int ssp_dai_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
return ssp_dai_setup_or_free(substream, dai, true);
}
Expand All @@ -493,7 +492,7 @@ static int ssp_dai_hw_free(struct snd_pcm_substream *substream,
}

static const struct snd_soc_dai_ops ssp_dai_ops = {
.hw_params = ssp_dai_hw_params,
.prepare = ssp_dai_prepare,
.hw_free = ssp_dai_hw_free,
};

Expand Down
10 changes: 10 additions & 0 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w)
return ret;
}

/* set HW_PARAMS flag */
set_mask_bits(&config->flags,
SOF_DAI_CONFIG_FLAGS_MASK,
SOF_DAI_CONFIG_FLAGS_HW_PARAMS);

/* send DAI_CONFIG IPC */
ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size,
&reply, sizeof(reply));
Expand Down Expand Up @@ -107,6 +112,11 @@ int hda_ctrl_dai_widget_free(struct snd_soc_dapm_widget *w)

config = &sof_dai->dai_config[sof_dai->current_config];

/* set HW_FREE flag */
set_mask_bits(&config->flags,
SOF_DAI_CONFIG_FLAGS_MASK,
SOF_DAI_CONFIG_FLAGS_HW_FREE);

ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size,
&reply, sizeof(reply));
if (ret < 0) {
Expand Down
5 changes: 5 additions & 0 deletions sound/soc/sof/sof-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ static int sof_dai_config_setup(struct snd_sof_dev *sdev, struct snd_sof_dai *da
return -EINVAL;
}

/* set NONE flag to clear all previous settings */
set_mask_bits(&config->flags,
SOF_DAI_CONFIG_FLAGS_MASK,
SOF_DAI_CONFIG_FLAGS_NONE);

ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size,
&reply, sizeof(reply));

Expand Down