Commit 50302fc7 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Vinod Koul

soundwire: intel_init: add kernel module parameter to filter out links

The hardware and ACPI info may report the presence of links that are
not physically enabled (e.g. due to pin-muxing or hardware reworks),
which in turn can result in errors being thrown. This shouldn't be the
case for production devices but will happen a lot on development
devices - even more so when they expose a connector.

Even when the ACPI information is correct, it's useful to be able to
only enable the links that need attention - mostly to filter out
dynamic debug messages.

Add a module parameter to filter out such links, e.g. adding the
following config to a file in /etc/modprobe.d will select the second
and third links only.

options soundwire_intel_init sdw_link_mask=0x6
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190806005522.22642-16-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent a50954e2
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
#define SDW_LINK_BASE 0x30000 #define SDW_LINK_BASE 0x30000
#define SDW_LINK_SIZE 0x10000 #define SDW_LINK_SIZE 0x10000
static int link_mask;
module_param_named(sdw_link_mask, link_mask, int, 0444);
MODULE_PARM_DESC(sdw_link_mask, "Intel link mask (one bit per link)");
struct sdw_link_data { struct sdw_link_data {
struct sdw_intel_link_res res; struct sdw_intel_link_res res;
struct platform_device *pdev; struct platform_device *pdev;
...@@ -111,6 +115,13 @@ static struct sdw_intel_ctx ...@@ -111,6 +115,13 @@ static struct sdw_intel_ctx
/* Create SDW Master devices */ /* Create SDW Master devices */
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (link_mask && !(link_mask & BIT(i))) {
dev_dbg(&adev->dev,
"Link %d masked, will not be enabled\n", i);
link++;
continue;
}
link->res.irq = res->irq; link->res.irq = res->irq;
link->res.registers = res->mmio_base + SDW_LINK_BASE link->res.registers = res->mmio_base + SDW_LINK_BASE
+ (SDW_LINK_SIZE * i); + (SDW_LINK_SIZE * i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment