History

ASoC: Intel: Skylake: Add support for LPMode

For D0i3, we need to tell DSP to run the pipelines in LP mode. This information is kept in topology and passed to driver as an attribute for pipe. So add a new tuple for lpmode and program the pipe based on value set.

Vinod Koul committed 10 years ago

Commit 8a0cb231 parent 5bb4cd46 files · +21 −4Browse files

Unified · Split

6 files
  1. include/uapi/sound/snd_sst_tokens.h +4 −1
  2. sound/soc/intel/skylake/skl-messages.c +2 −1
  3. sound/soc/intel/skylake/skl-sst-ipc.c +8 −1
  4. sound/soc/intel/skylake/skl-sst-ipc.h +1 −1
  5. sound/soc/intel/skylake/skl-topology.c +5 −0
  6. sound/soc/intel/skylake/skl-topology.h +1 −0
include/uapi/sound/snd_sst_tokens.h+4−1
@@ -157,6 +157,8 @@ · 156 unmodified lines
157157 *
158158 * %SKL_TKN_STR_LIB_NAME: Specifies the library name
159159 *
160+ * %SKL_TKN_U32_PMODE: Specifies the power mode for pipe
161+ *
160162 * module_id and loadable flags dont have tokens as these values will be
161163 * read from the DSP FW manifest
162164 */
@@ -208,7 +210,8 @@ enum SKL_TKNS { · 45 unmodified lines
208210 SKL_TKN_U32_PROC_DOMAIN,
209211 SKL_TKN_U32_LIB_COUNT,
210212 SKL_TKN_STR_LIB_NAME,
211− SKL_TKN_MAX = SKL_TKN_STR_LIB_NAME,
213+ SKL_TKN_U32_PMODE,
214+ SKL_TKN_MAX = SKL_TKN_U32_PMODE,
212215 };
213216
214217 #endif
sound/soc/intel/skylake/skl-messages.c+2−1
@@ -1042,7 +1042,8 @@ int skl_create_pipeline(struct skl_sst *ctx, struct skl_pipe *pipe) · 1041 unmodified lines
10421042 dev_dbg(ctx->dev, "%s: pipe_id = %d\n", __func__, pipe->ppl_id);
10431043
10441044 ret = skl_ipc_create_pipeline(&ctx->ipc, pipe->memory_pages,
1045− pipe->pipe_priority, pipe->ppl_id);
1045+ pipe->pipe_priority, pipe->ppl_id,
1046+ pipe->lp_mode);
10461047 if (ret < 0) {
10471048 dev_err(ctx->dev, "Failed to create pipeline\n");
10481049 return ret;
sound/soc/intel/skylake/skl-sst-ipc.c+8−1
@@ -81,6 +81,11 @@ · 80 unmodified lines
8181 #define IPC_INSTANCE_ID(x) (((x) & IPC_INSTANCE_ID_MASK) \
8282 << IPC_INSTANCE_ID_SHIFT)
8383
84+#define IPC_PPL_LP_MODE_SHIFT 0
85+#define IPC_PPL_LP_MODE_MASK 0x1
86+#define IPC_PPL_LP_MODE(x) (((x) & IPC_PPL_LP_MODE_MASK) \
87+ << IPC_PPL_LP_MODE_SHIFT)
88+
8489 /* Set pipeline state message */
8590 #define IPC_PPL_STATE_SHIFT 0
8691 #define IPC_PPL_STATE_MASK 0x1F
@@ -559,7 +564,7 @@ void skl_ipc_free(struct sst_generic_ipc *ipc) · 472 unmodified lines
559564 }
560565
561566 int skl_ipc_create_pipeline(struct sst_generic_ipc *ipc,
562− u16 ppl_mem_size, u8 ppl_type, u8 instance_id)
567+ u16 ppl_mem_size, u8 ppl_type, u8 instance_id, u8 lp_mode)
563568 {
564569 struct skl_ipc_header header = {0};
565570 u64 *ipc_header = (u64 *)(&header);
@@ -572,6 +577,8 @@ int skl_ipc_create_pipeline(struct sst_generic_ipc *ipc, · 6 unmodified lines
572577 header.primary |= IPC_PPL_TYPE(ppl_type);
573578 header.primary |= IPC_PPL_MEM_SIZE(ppl_mem_size);
574579
580+ header.extension = IPC_PPL_LP_MODE(lp_mode);
581+
575582 dev_dbg(ipc->dev, "In %s header=%d\n", __func__, header.primary);
576583 ret = sst_ipc_tx_message_wait(ipc, *ipc_header, NULL, 0, NULL, 0);
577584 if (ret < 0) {
sound/soc/intel/skylake/skl-sst-ipc.h+1−1
@@ -148,7 +148,7 @@ struct skl_ipc_d0ix_msg { · 147 unmodified lines
148148 irqreturn_t skl_dsp_irq_thread_handler(int irq, void *context);
149149
150150 int skl_ipc_create_pipeline(struct sst_generic_ipc *sst_ipc,
151− u16 ppl_mem_size, u8 ppl_type, u8 instance_id);
151+ u16 ppl_mem_size, u8 ppl_type, u8 instance_id, u8 lp_mode);
152152
153153 int skl_ipc_delete_pipeline(struct sst_generic_ipc *sst_ipc, u8 instance_id);
154154
sound/soc/intel/skylake/skl-topology.c+5−0
@@ -1519,6 +1519,10 @@ static int skl_tplg_fill_pipe_tkn(struct device *dev, · 1518 unmodified lines
15191519 pipe->memory_pages = tkn_val;
15201520 break;
15211521
1522+ case SKL_TKN_U32_PMODE:
1523+ pipe->lp_mode = tkn_val;
1524+ break;
1525+
15221526 default:
15231527 dev_err(dev, "Token not handled %d\n", tkn);
15241528 return -EINVAL;
@@ -1841,6 +1845,7 @@ static int skl_tplg_get_token(struct device *dev, · 316 unmodified lines
18411845 case SKL_TKN_U32_PIPE_CONN_TYPE:
18421846 case SKL_TKN_U32_PIPE_PRIORITY:
18431847 case SKL_TKN_U32_PIPE_MEM_PGS:
1848+ case SKL_TKN_U32_PMODE:
18441849 if (is_pipe_exists) {
18451850 ret = skl_tplg_fill_pipe_tkn(dev, mconfig->pipe,
18461851 tkn_elem->token, tkn_elem->value);
sound/soc/intel/skylake/skl-topology.h+1−0
@@ -279,6 +279,7 @@ struct skl_pipe { · 278 unmodified lines
279279 u8 pipe_priority;
280280 u16 conn_type;
281281 u32 memory_pages;
282+ u8 lp_mode;
282283 struct skl_pipe_params *p_params;
283284 enum skl_pipe_state state;
284285 struct list_head w_list;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t