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.
Unified · Split
| @@ -157,6 +157,8 @@ · 156 unmodified lines | ||
| 157 | 157 | * |
| 158 | 158 | * %SKL_TKN_STR_LIB_NAME: Specifies the library name |
| 159 | 159 | * |
| 160 | + * %SKL_TKN_U32_PMODE: Specifies the power mode for pipe | |
| 161 | + * | |
| 160 | 162 | * module_id and loadable flags dont have tokens as these values will be |
| 161 | 163 | * read from the DSP FW manifest |
| 162 | 164 | */ |
| @@ -208,7 +210,8 @@ enum SKL_TKNS { · 45 unmodified lines | ||
| 208 | 210 | SKL_TKN_U32_PROC_DOMAIN, |
| 209 | 211 | SKL_TKN_U32_LIB_COUNT, |
| 210 | 212 | 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, | |
| 212 | 215 | }; |
| 213 | 216 | |
| 214 | 217 | #endif |
| @@ -1042,7 +1042,8 @@ int skl_create_pipeline(struct skl_sst *ctx, struct skl_pipe *pipe) · 1041 unmodified lines | ||
| 1042 | 1042 | dev_dbg(ctx->dev, "%s: pipe_id = %d\n", __func__, pipe->ppl_id); |
| 1043 | 1043 | |
| 1044 | 1044 | 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); | |
| 1046 | 1047 | if (ret < 0) { |
| 1047 | 1048 | dev_err(ctx->dev, "Failed to create pipeline\n"); |
| 1048 | 1049 | return ret; |
| @@ -81,6 +81,11 @@ · 80 unmodified lines | ||
| 81 | 81 | #define IPC_INSTANCE_ID(x) (((x) & IPC_INSTANCE_ID_MASK) \ |
| 82 | 82 | << IPC_INSTANCE_ID_SHIFT) |
| 83 | 83 | |
| 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 | + | |
| 84 | 89 | /* Set pipeline state message */ |
| 85 | 90 | #define IPC_PPL_STATE_SHIFT 0 |
| 86 | 91 | #define IPC_PPL_STATE_MASK 0x1F |
| @@ -559,7 +564,7 @@ void skl_ipc_free(struct sst_generic_ipc *ipc) · 472 unmodified lines | ||
| 559 | 564 | } |
| 560 | 565 | |
| 561 | 566 | 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) | |
| 563 | 568 | { |
| 564 | 569 | struct skl_ipc_header header = {0}; |
| 565 | 570 | u64 *ipc_header = (u64 *)(&header); |
| @@ -572,6 +577,8 @@ int skl_ipc_create_pipeline(struct sst_generic_ipc *ipc, · 6 unmodified lines | ||
| 572 | 577 | header.primary |= IPC_PPL_TYPE(ppl_type); |
| 573 | 578 | header.primary |= IPC_PPL_MEM_SIZE(ppl_mem_size); |
| 574 | 579 | |
| 580 | + header.extension = IPC_PPL_LP_MODE(lp_mode); | |
| 581 | + | |
| 575 | 582 | dev_dbg(ipc->dev, "In %s header=%d\n", __func__, header.primary); |
| 576 | 583 | ret = sst_ipc_tx_message_wait(ipc, *ipc_header, NULL, 0, NULL, 0); |
| 577 | 584 | if (ret < 0) { |
| @@ -148,7 +148,7 @@ struct skl_ipc_d0ix_msg { · 147 unmodified lines | ||
| 148 | 148 | irqreturn_t skl_dsp_irq_thread_handler(int irq, void *context); |
| 149 | 149 | |
| 150 | 150 | 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); | |
| 152 | 152 | |
| 153 | 153 | int skl_ipc_delete_pipeline(struct sst_generic_ipc *sst_ipc, u8 instance_id); |
| 154 | 154 | |
| @@ -1519,6 +1519,10 @@ static int skl_tplg_fill_pipe_tkn(struct device *dev, · 1518 unmodified lines | ||
| 1519 | 1519 | pipe->memory_pages = tkn_val; |
| 1520 | 1520 | break; |
| 1521 | 1521 | |
| 1522 | + case SKL_TKN_U32_PMODE: | |
| 1523 | + pipe->lp_mode = tkn_val; | |
| 1524 | + break; | |
| 1525 | + | |
| 1522 | 1526 | default: |
| 1523 | 1527 | dev_err(dev, "Token not handled %d\n", tkn); |
| 1524 | 1528 | return -EINVAL; |
| @@ -1841,6 +1845,7 @@ static int skl_tplg_get_token(struct device *dev, · 316 unmodified lines | ||
| 1841 | 1845 | case SKL_TKN_U32_PIPE_CONN_TYPE: |
| 1842 | 1846 | case SKL_TKN_U32_PIPE_PRIORITY: |
| 1843 | 1847 | case SKL_TKN_U32_PIPE_MEM_PGS: |
| 1848 | + case SKL_TKN_U32_PMODE: | |
| 1844 | 1849 | if (is_pipe_exists) { |
| 1845 | 1850 | ret = skl_tplg_fill_pipe_tkn(dev, mconfig->pipe, |
| 1846 | 1851 | tkn_elem->token, tkn_elem->value); |
| @@ -279,6 +279,7 @@ struct skl_pipe { · 278 unmodified lines | ||
| 279 | 279 | u8 pipe_priority; |
| 280 | 280 | u16 conn_type; |
| 281 | 281 | u32 memory_pages; |
| 282 | + u8 lp_mode; | |
| 282 | 283 | struct skl_pipe_params *p_params; |
| 283 | 284 | enum skl_pipe_state state; |
| 284 | 285 | struct list_head w_list; |