Skip to content

Commit 59d4c54

Browse files
committed
ASoC: SOF: sof-client-probes: Add module parameter to enable probes support
Keep the probes support disabled by default and require module parameter to enable it explicitly as the probes usage is meant for developers only. This will avoid confusing users with the existence of a probes card with a compressed capture. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent f85f28e commit 59d4c54

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

sound/soc/sof/sof-client-probes.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
#define SOF_PROBES_INVALID_NODE_ID UINT_MAX
2525

26+
static bool __read_mostly sof_probes_enabled;
27+
module_param_named(enable, sof_probes_enabled, bool, 0444);
28+
MODULE_PARM_DESC(enable, "Enable SOF probes support");
29+
2630
struct sof_probes_priv {
2731
struct dentry *dfs_points;
2832
struct dentry *dfs_points_remove;
@@ -674,6 +678,10 @@ static int sof_probes_client_probe(struct auxiliary_device *auxdev,
674678
struct snd_soc_dai_link *links;
675679
int ret;
676680

681+
/* do not set up the probes support if it is not enabled */
682+
if (!sof_probes_enabled)
683+
return 0;
684+
677685
if (!dev->platform_data) {
678686
dev_err(dev, "error: missing platform data\n");
679687
return -ENODEV;
@@ -771,6 +779,9 @@ static void sof_probes_client_remove(struct auxiliary_device *auxdev)
771779
struct sof_client_dev *cdev = auxiliary_dev_to_sof_client_dev(auxdev);
772780
struct sof_probes_priv *priv = cdev->data;
773781

782+
if (!sof_probes_enabled)
783+
return;
784+
774785
pm_runtime_disable(&auxdev->dev);
775786
debugfs_remove(priv->dfs_points);
776787
debugfs_remove(priv->dfs_points_remove);

0 commit comments

Comments
 (0)