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
45 changes: 35 additions & 10 deletions include/uapi/sound/sof-ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#define SOF_IPC_PM_CLK_SET SOF_CMD_TYPE(0x004)
#define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005)
#define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006)
#define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007)

/* component runtime config - multiple different types */
#define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001)
Expand Down Expand Up @@ -217,6 +218,24 @@ struct sof_ipc_compound_hdr {
#define SOF_DAI_INTEL_SSP_FRAME_PULSE_WIDTH_MAX 38
#define SOF_DAI_INTEL_SSP_SLOT_PADDING_MAX 31

/* SSP clocks control settings
*
* Macros for clks_control field in sof_ipc_dai_ssp_params struct.
*/

/* mclk 0 disable */
#define SOF_DAI_INTEL_SSP_MCLK_0_DISABLE BIT(0)
/* mclk 1 disable */
#define SOF_DAI_INTEL_SSP_MCLK_1_DISABLE BIT(1)
/* mclk keep active */
#define SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_KA BIT(2)
/* bclk keep active */
#define SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_KA BIT(3)
/* fs keep active */
#define SOF_DAI_INTEL_SSP_CLKCTRL_FS_KA BIT(4)
/* bclk idle */
#define SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_IDLE_HIGH BIT(5)

/** \brief Types of DAI */
enum sof_ipc_dai_type {
SOF_DAI_INTEL_NONE = 0, /**< None */
Expand Down Expand Up @@ -246,14 +265,11 @@ struct sof_ipc_dai_ssp_params {

/* MCLK */
uint32_t mclk_direction;
uint32_t mclk_keep_active;
uint32_t bclk_keep_active;
uint32_t fs_keep_active;

uint16_t frame_pulse_width;
uint32_t quirks; // FIXME: is 32 bits enough ?

uint16_t tdm_per_slot_padding_flag;
uint32_t clks_control;
uint32_t quirks; // FIXME: is 32 bits enough ?
/* private data, e.g. for quirks */
//uint32_t pdata[10]; // FIXME: would really need ~16 u32
} __attribute__((packed));
Expand Down Expand Up @@ -724,21 +740,21 @@ struct sof_ipc_comp_tone {
struct sof_ipc_comp_eq_fir {
struct sof_ipc_comp comp;
struct sof_ipc_comp_config config;
int32_t size;
uint32_t size;
unsigned char data[0];
} __attribute__((packed));

/* IIR equalizer component */
struct sof_ipc_comp_eq_iir {
struct sof_ipc_comp comp;
struct sof_ipc_comp_config config;
int32_t size;
uint32_t size;
unsigned char data[0];
} __attribute__((packed));

/** \brief Types of EFFECT */
enum sof_ipc_effect_type {
SOF_EFFECT_INTEL_NONE = 0, /**< None */
SOF_EFFECT_NONE = 0, /**< None */
SOF_EFFECT_INTEL_EQFIR, /**< Intel FIR */
SOF_EFFECT_INTEL_EQIIR, /**< Intel IIR */
};
Expand Down Expand Up @@ -778,7 +794,9 @@ struct sof_ipc_pipe_new {
uint32_t mips; /* worst case instruction count per period */
uint32_t frames_per_sched;/* output frames of pipeline, 0 is variable */
uint32_t xrun_limit_usecs; /* report xruns greater than limit */
uint32_t timer;/* non zero if timer scheduled otherwise DAI scheduled */

/* non zero if timer scheduled, otherwise DAI DMA irq scheduled */
uint32_t timer_delay;
} __attribute__((packed));

/* pipeline construction complete - SOF_IPC_TPLG_PIPE_COMPLETE */
Expand Down Expand Up @@ -822,6 +840,12 @@ struct sof_ipc_pm_ctx {
struct sof_ipc_pm_ctx_elem elems[];
};

/* enable or disable cores - SOF_IPC_PM_CORE_ENABLE */
struct sof_ipc_pm_core_config {
struct sof_ipc_hdr hdr;
uint32_t enable_mask;
};

/*
* Firmware boot and version
*/
Expand All @@ -842,7 +866,8 @@ struct sof_ipc_fw_version {
uint8_t date[12];
uint8_t time[10];
uint8_t tag[6];
uint8_t pad[2]; /* Make sure the total size is 4 bytes aligned */
uint16_t abi_version;
/* Make sure the total size is 4 bytes aligned */
} __attribute__((packed));

/* FW ready Message - sent by firmware when boot has completed */
Expand Down
14 changes: 6 additions & 8 deletions include/uapi/sound/sof-topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@
#define SOF_TKN_COMP_PRELOAD_COUNT 403

/* SSP */
#define SOF_TKN_INTEL_SSP_MCLK_KEEP_ACTIVE 500
#define SOF_TKN_INTEL_SSP_BCLK_KEEP_ACTIVE 501
#define SOF_TKN_INTEL_SSP_FS_KEEP_ACTIVE 502
#define SOF_TKN_INTEL_SSP_MCLK_ID 503
#define SOF_TKN_INTEL_SSP_SAMPLE_BITS 504
#define SOF_TKN_INTEL_SSP_FRAME_PULSE_WIDTH 505
#define SOF_TKN_INTEL_SSP_QUIRKS 506
#define SOF_TKN_INTEL_SSP_TDM_PADDING_PER_SLOT 507
#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
#define SOF_TKN_INTEL_SSP_MCLK_ID 501
#define SOF_TKN_INTEL_SSP_SAMPLE_BITS 502
#define SOF_TKN_INTEL_SSP_FRAME_PULSE_WIDTH 503
#define SOF_TKN_INTEL_SSP_QUIRKS 504
#define SOF_TKN_INTEL_SSP_TDM_PADDING_PER_SLOT 505

/* DMIC */
#define SOF_TKN_INTEL_DMIC_DRIVER_VERSION 600
Expand Down
16 changes: 5 additions & 11 deletions sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static enum sof_ipc_effect_type find_effect(const char *name)
return sof_effects[i].type;
}

return SOF_EFFECT_INTEL_NONE;
return SOF_EFFECT_NONE;
}

/*
Expand Down Expand Up @@ -431,7 +431,7 @@ static const struct sof_topology_token sched_tokens[] = {
{SOF_TKN_SCHED_FRAMES, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, frames_per_sched), 0},
{SOF_TKN_SCHED_TIMER, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_pipe_new, timer), 0},
offsetof(struct sof_ipc_pipe_new, timer_delay), 0},
};

/* volume */
Expand Down Expand Up @@ -486,15 +486,9 @@ static const struct sof_topology_token comp_tokens[] = {

/* SSP */
static const struct sof_topology_token ssp_tokens[] = {
{SOF_TKN_INTEL_SSP_MCLK_KEEP_ACTIVE,
SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, mclk_keep_active), 0},
{SOF_TKN_INTEL_SSP_BCLK_KEEP_ACTIVE,
SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, bclk_keep_active), 0},
{SOF_TKN_INTEL_SSP_FS_KEEP_ACTIVE,
SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, fs_keep_active), 0},
{SOF_TKN_INTEL_SSP_CLKS_CONTROL,
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
offsetof(struct sof_ipc_dai_ssp_params, clks_control), 0},
{SOF_TKN_INTEL_SSP_MCLK_ID,
SND_SOC_TPLG_TUPLE_TYPE_SHORT, get_token_u16,
offsetof(struct sof_ipc_dai_ssp_params, mclk_id), 0},
Expand Down