Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: core: Module parameter updates

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

Add new debug only parameters to override the default IPC and boot
timeout, these are only available if CONFIG_SND_SOC_SOF_DEBUG is
enabled, only for developers.

The second patch moves the firmware, topology name/path and IPC
version overrides from acpi/pci/of platform code to core and markes
the platform parameters deprecated, to be removed in few kernel
cycles.
There is really no point of duplicating these overrides as they
are not platform dependent.

+76 -12
+64
sound/soc/sof/core.c
··· 19 19 #define CREATE_TRACE_POINTS 20 20 #include <trace/events/sof.h> 21 21 22 + /* Module parameters for firmware, topology and IPC type override */ 23 + static char *override_fw_path; 24 + module_param_named(fw_path, override_fw_path, charp, 0444); 25 + MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware."); 26 + 27 + static char *override_fw_filename; 28 + module_param_named(fw_filename, override_fw_filename, charp, 0444); 29 + MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware."); 30 + 31 + static char *override_lib_path; 32 + module_param_named(lib_path, override_lib_path, charp, 0444); 33 + MODULE_PARM_DESC(lib_path, "alternate path for SOF firmware libraries."); 34 + 35 + static char *override_tplg_path; 36 + module_param_named(tplg_path, override_tplg_path, charp, 0444); 37 + MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology."); 38 + 39 + static char *override_tplg_filename; 40 + module_param_named(tplg_filename, override_tplg_filename, charp, 0444); 41 + MODULE_PARM_DESC(tplg_filename, "alternate filename for SOF topology."); 42 + 43 + static int override_ipc_type = -1; 44 + module_param_named(ipc_type, override_ipc_type, int, 0444); 45 + MODULE_PARM_DESC(ipc_type, "Force SOF IPC type. 0 - IPC3, 1 - IPC4"); 46 + 22 47 /* see SOF_DBG_ flags */ 23 48 static int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE); 24 49 module_param_named(sof_debug, sof_core_debug, int, 0444); 25 50 MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)"); 51 + 52 + #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG) 53 + static unsigned int sof_ipc_timeout_ms; 54 + static unsigned int sof_boot_timeout_ms; 55 + module_param_named(ipc_timeout, sof_ipc_timeout_ms, uint, 0444); 56 + MODULE_PARM_DESC(ipc_timeout, 57 + "Set the IPC timeout value in ms (0 to use the platform default)"); 58 + module_param_named(boot_timeout, sof_boot_timeout_ms, uint, 0444); 59 + MODULE_PARM_DESC(boot_timeout, 60 + "Set the DSP boot timeout value in ms (0 to use the platform default)"); 61 + #endif 26 62 27 63 /* SOF defaults if not provided by the platform in ms */ 28 64 #define TIMEOUT_DEFAULT_IPC_MS 500 ··· 606 570 } 607 571 } 608 572 573 + static void 574 + sof_apply_profile_override(struct sof_loadable_file_profile *path_override) 575 + { 576 + if (override_ipc_type >= 0 && override_ipc_type < SOF_IPC_TYPE_COUNT) 577 + path_override->ipc_type = override_ipc_type; 578 + if (override_fw_path) 579 + path_override->fw_path = override_fw_path; 580 + if (override_fw_filename) 581 + path_override->fw_name = override_fw_filename; 582 + if (override_lib_path) 583 + path_override->fw_lib_path = override_lib_path; 584 + if (override_tplg_path) 585 + path_override->tplg_path = override_tplg_path; 586 + if (override_tplg_filename) 587 + path_override->tplg_name = override_tplg_filename; 588 + } 589 + 609 590 int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data) 610 591 { 611 592 struct snd_sof_dev *sdev; ··· 654 601 } 655 602 } 656 603 604 + sof_apply_profile_override(&plat_data->ipc_file_profile_base); 605 + 657 606 /* Initialize sof_ops based on the initial selected IPC version */ 658 607 ret = sof_init_sof_ops(sdev); 659 608 if (ret) ··· 686 631 sdev->boot_timeout = TIMEOUT_DEFAULT_BOOT_MS; 687 632 else 688 633 sdev->boot_timeout = plat_data->desc->boot_timeout; 634 + 635 + #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG) 636 + /* Override the timeout values with module parameter, if set */ 637 + if (sof_ipc_timeout_ms) 638 + sdev->ipc_timeout = sof_ipc_timeout_ms; 639 + 640 + if (sof_boot_timeout_ms) 641 + sdev->boot_timeout = sof_boot_timeout_ms; 642 + #endif 689 643 690 644 sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED); 691 645
+2 -2
sound/soc/sof/sof-acpi-dev.c
··· 24 24 25 25 static char *fw_path; 26 26 module_param(fw_path, charp, 0444); 27 - MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware."); 27 + MODULE_PARM_DESC(fw_path, "deprecated - moved to snd-sof module."); 28 28 29 29 static char *tplg_path; 30 30 module_param(tplg_path, charp, 0444); 31 - MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology."); 31 + MODULE_PARM_DESC(tplg_path, "deprecated - moved to snd-sof module."); 32 32 33 33 static int sof_acpi_debug; 34 34 module_param_named(sof_acpi_debug, sof_acpi_debug, int, 0444);
+4 -4
sound/soc/sof/sof-of-dev.c
··· 16 16 17 17 static char *fw_path; 18 18 module_param(fw_path, charp, 0444); 19 - MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware."); 19 + MODULE_PARM_DESC(fw_path, "deprecated - moved to snd-sof module."); 20 20 21 21 static char *fw_filename; 22 22 module_param(fw_filename, charp, 0444); 23 - MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware."); 23 + MODULE_PARM_DESC(fw_filename, "deprecated - moved to snd-sof module."); 24 24 25 25 static char *tplg_path; 26 26 module_param(tplg_path, charp, 0444); 27 - MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology."); 27 + MODULE_PARM_DESC(tplg_path, "deprecated - moved to snd-sof module."); 28 28 29 29 static char *tplg_filename; 30 30 module_param(tplg_filename, charp, 0444); 31 - MODULE_PARM_DESC(tplg_filename, "alternate filename for SOF topology."); 31 + MODULE_PARM_DESC(tplg_filename, "deprecated - moved to snd-sof module."); 32 32 33 33 const struct dev_pm_ops sof_of_pm = { 34 34 .prepare = snd_sof_prepare,
+6 -6
sound/soc/sof/sof-pci-dev.c
··· 22 22 23 23 static char *fw_path; 24 24 module_param(fw_path, charp, 0444); 25 - MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware."); 25 + MODULE_PARM_DESC(fw_path, "deprecated - moved to snd-sof module."); 26 26 27 27 static char *fw_filename; 28 28 module_param(fw_filename, charp, 0444); 29 - MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware."); 29 + MODULE_PARM_DESC(fw_filename, "deprecated - moved to snd-sof module."); 30 30 31 31 static char *lib_path; 32 32 module_param(lib_path, charp, 0444); 33 - MODULE_PARM_DESC(lib_path, "alternate path for SOF firmware libraries."); 33 + MODULE_PARM_DESC(lib_path, "deprecated - moved to snd-sof module."); 34 34 35 35 static char *tplg_path; 36 36 module_param(tplg_path, charp, 0444); 37 - MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology."); 37 + MODULE_PARM_DESC(tplg_path, "deprecated - moved to snd-sof module."); 38 38 39 39 static char *tplg_filename; 40 40 module_param(tplg_filename, charp, 0444); 41 - MODULE_PARM_DESC(tplg_filename, "alternate filename for SOF topology."); 41 + MODULE_PARM_DESC(tplg_filename, "deprecated - moved to snd-sof module."); 42 42 43 43 static int sof_pci_debug; 44 44 module_param_named(sof_pci_debug, sof_pci_debug, int, 0444); ··· 46 46 47 47 static int sof_pci_ipc_type = -1; 48 48 module_param_named(ipc_type, sof_pci_ipc_type, int, 0444); 49 - MODULE_PARM_DESC(ipc_type, "Force SOF IPC type. 0 - IPC3, 1 - IPC4"); 49 + MODULE_PARM_DESC(ipc_type, "deprecated - moved to snd-sof module."); 50 50 51 51 static const char *sof_dmi_override_tplg_name; 52 52 static bool sof_dmi_use_community_key;