Skip to content

Commit e8f112d

Browse files
keyonjiebroonie
authored andcommitted
ASoC: SOF: add set_power_state() to dsp_ops for power state update
D0i3 is a platform-defined substate of D0, so we need a platform-specific callback in dsp_ops to handle the relevant configurations. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191025224122.7718-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 09fe6b5 commit e8f112d

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎sound/soc/sof/ops.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ static inline int snd_sof_dsp_set_clk(struct snd_sof_dev *sdev, u32 freq)
193193
return 0;
194194
}
195195

196+
static inline int snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev,
197+
enum sof_d0_substate substate)
198+
{
199+
if (sof_ops(sdev)->set_power_state)
200+
return sof_ops(sdev)->set_power_state(sdev, substate);
201+
202+
return 0;
203+
}
204+
196205
/* debug */
197206
static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags)
198207
{

‎sound/soc/sof/sof-priv.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ struct snd_sof_dsp_ops {
189189
int (*runtime_resume)(struct snd_sof_dev *sof_dev); /* optional */
190190
int (*runtime_idle)(struct snd_sof_dev *sof_dev); /* optional */
191191
int (*set_hw_params_upon_resume)(struct snd_sof_dev *sdev); /* optional */
192+
int (*set_power_state)(struct snd_sof_dev *sdev,
193+
enum sof_d0_substate d0_substate); /* optional */
192194

193195
/* DSP clocking */
194196
int (*set_clk)(struct snd_sof_dev *sof_dev, u32 freq); /* optional */

0 commit comments

Comments
 (0)