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