aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2016-11-03 07:37:18 -0400
committerMark Brown <broonie@kernel.org>2016-11-03 13:14:22 -0400
commit8a0cb2360ddb941e0a2fbe33d400d2985e4f2fff (patch)
tree8cbbc7147df4021e428e2cde24b82c1eecdd96c4
parent5bb4cd46ace5f220fbc34370e7fe9ba515ead9f8 (diff)
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. Signed-off-by: Jayachandran B <jayachandran.b@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/uapi/sound/snd_sst_tokens.h5
-rw-r--r--sound/soc/intel/skylake/skl-messages.c3
-rw-r--r--sound/soc/intel/skylake/skl-sst-ipc.c9
-rw-r--r--sound/soc/intel/skylake/skl-sst-ipc.h2
-rw-r--r--sound/soc/intel/skylake/skl-topology.c5
-rw-r--r--sound/soc/intel/skylake/skl-topology.h1
6 files changed, 21 insertions, 4 deletions
diff --git a/include/uapi/sound/snd_sst_tokens.h b/include/uapi/sound/snd_sst_tokens.h
index 1ee2e943d66a..f4b8b34de519 100644
--- a/include/uapi/sound/snd_sst_tokens.h
+++ b/include/uapi/sound/snd_sst_tokens.h
@@ -157,6 +157,8 @@
157 * 157 *
158 * %SKL_TKN_STR_LIB_NAME: Specifies the library name 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 * module_id and loadable flags dont have tokens as these values will be 162 * module_id and loadable flags dont have tokens as these values will be
161 * read from the DSP FW manifest 163 * read from the DSP FW manifest
162 */ 164 */
@@ -208,7 +210,8 @@ enum SKL_TKNS {
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#endif 217#endif
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index 805b7f2173f3..87fc647fa04c 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -1042,7 +1042,8 @@ int skl_create_pipeline(struct skl_sst *ctx, struct skl_pipe *pipe)
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;
diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c
index 087b8d6e7186..734408a34a24 100644
--- a/sound/soc/intel/skylake/skl-sst-ipc.c
+++ b/sound/soc/intel/skylake/skl-sst-ipc.c
@@ -81,6 +81,11 @@
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 0 90#define IPC_PPL_STATE_SHIFT 0
86#define IPC_PPL_STATE_MASK 0x1F 91#define IPC_PPL_STATE_MASK 0x1F
@@ -559,7 +564,7 @@ void skl_ipc_free(struct sst_generic_ipc *ipc)
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,
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) {
diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h
index a45c42046b64..83bf1689f62e 100644
--- a/sound/soc/intel/skylake/skl-sst-ipc.h
+++ b/sound/soc/intel/skylake/skl-sst-ipc.h
@@ -148,7 +148,7 @@ struct skl_ipc_d0ix_msg {
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
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index b5b1934d8550..9a7a008f6689 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -1519,6 +1519,10 @@ static int skl_tplg_fill_pipe_tkn(struct device *dev,
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,
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);
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index a519360f42a6..11fd0a4b6603 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -279,6 +279,7 @@ struct skl_pipe {
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;