Skip to content

Commit 3217d38

Browse files
ujfalusiranj063
authored andcommitted
ASoC: SOF: pm: Add module option to override on-demand DSP boot support
The on_demand_boot can be used to force the on-demand DSP boot to be turned on or off, if the option is not set then the platform's on_demand_dsp_boot will be used to decide to use the on-demand boot. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 28cdbad commit 3217d38

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sound/soc/sof/pm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
99
//
1010

11+
#include <linux/module.h>
1112
#include "ops.h"
1213
#include "sof-priv.h"
1314
#include "sof-audio.h"
1415

16+
static int override_on_demand_boot = -1;
17+
module_param_named(on_demand_boot, override_on_demand_boot, int, 0444);
18+
MODULE_PARM_DESC(on_demand_boot, "Force on-demand DSP boot: 0 - disabled, 1 - enabled");
19+
1520
/*
1621
* Helper function to determine the target DSP state during
1722
* system suspend. This function only cares about the device
@@ -159,6 +164,7 @@ static int sof_resume(struct device *dev, bool runtime_resume)
159164
{
160165
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
161166
u32 old_state = sdev->dsp_power_state.state;
167+
bool on_demand_boot;
162168
int ret;
163169

164170
/* do nothing if dsp resume callbacks are not set */
@@ -206,7 +212,12 @@ static int sof_resume(struct device *dev, bool runtime_resume)
206212
return 0;
207213
}
208214

209-
if (sdev->pdata->desc->on_demand_dsp_boot) {
215+
if (override_on_demand_boot > -1)
216+
on_demand_boot = override_on_demand_boot ? true : false;
217+
else
218+
on_demand_boot = sdev->pdata->desc->on_demand_dsp_boot;
219+
220+
if (on_demand_boot) {
210221
/* Only change the fw_state to PREPARE but skip booting */
211222
sof_set_fw_state(sdev, SOF_FW_BOOT_PREPARE);
212223
return 0;

0 commit comments

Comments
 (0)