From b496bb56b418788aa8625950e94206abe7282e18 Mon Sep 17 00:00:00 2001 From: Sibi Sankar Date: Wed, 1 Jul 2026 17:31:13 +0100 Subject: [PATCH 1/8] dt-bindings: soundwire: qcom: Increase max data ports to 17 Bump the maxItems from 16 to 17 for all qcom,ports-* properties to accommodate SoundWire controllers v3.1.0 with 17 data ports. WSA instances on Glymur has 6 DIN and 11 DOUT ports. Signed-off-by: Sibi Sankar Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260701163115.3701298-2-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Vinod Koul --- .../bindings/soundwire/qcom,soundwire.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml b/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml index 9447a2f371b5..8e6973fa229c 100644 --- a/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml +++ b/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml @@ -90,7 +90,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 qcom,ports-sinterval-low: $ref: /schemas/types.yaml#/definitions/uint8-array @@ -101,7 +101,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 qcom,ports-sinterval: $ref: /schemas/types.yaml#/definitions/uint16-array @@ -112,7 +112,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 qcom,ports-offset1: $ref: /schemas/types.yaml#/definitions/uint8-array @@ -123,7 +123,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 qcom,ports-offset2: $ref: /schemas/types.yaml#/definitions/uint8-array @@ -134,7 +134,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 qcom,ports-lane-control: $ref: /schemas/types.yaml#/definitions/uint8-array @@ -145,7 +145,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 qcom,ports-block-pack-mode: $ref: /schemas/types.yaml#/definitions/uint8-array @@ -158,7 +158,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 items: oneOf: - minimum: 0 @@ -175,7 +175,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 items: oneOf: - minimum: 0 @@ -192,7 +192,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 items: oneOf: - minimum: 0 @@ -208,7 +208,7 @@ properties: or applicable for the respective data port. More info in MIPI Alliance SoundWire 1.0 Specifications. minItems: 3 - maxItems: 16 + maxItems: 17 items: oneOf: - minimum: 0 From 6ccec91c3535b07310e12d32fe9c67ff8d31d965 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Wed, 1 Jul 2026 20:30:05 +0100 Subject: [PATCH 2/8] soundwire: qcom: Fix port exhaustion check in stream_alloc_ports find_first_zero_bit(mask, n) returns n (not n+1) when all bits are set, so the guard `pn > maxport` is never true on exhaustion. The driver would silently call set_bit(maxport, port_mask) and assign the out-of-range port instead of returning -EBUSY. Fix the comparison to `pn >= maxport`. Fixes: 02efb49aa805 ("soundwire: qcom: add support for SoundWire controller") Reported-by: sashiko-bot Assisted-by: Claude Sonnet 4.6 Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20260701193006.4113-2-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Vinod Koul --- drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 3d8f5a81eff1..b288218f64b4 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1271,7 +1271,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, else pn = find_first_zero_bit(port_mask, maxport); - if (pn > maxport) { + if (pn >= maxport) { dev_err(ctrl->dev, "All ports busy\n"); return -EBUSY; } From 4f9df964ba4507958df39612103d0eb318b1e3e5 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Wed, 1 Jul 2026 20:30:06 +0100 Subject: [PATCH 3/8] soundwire: qcom: Allocate sruntime array dynamically Instead of sizing sruntime[] with a hardcoded SWRM_MAX_DAIS constant, allocate it at probe time once the actual port count is known from hardware. This removes the need to keep the constant in sync with dt-binding limits and naturally supports any future port count increase. Reported-by: sashiko-bot Assisted-by: Claude Sonnet 4.6 Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20260701193006.4113-3-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Vinod Koul --- drivers/soundwire/qcom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index b288218f64b4..603f228f46b5 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -134,7 +134,6 @@ #define TIMEOUT_MS 100 #define QCOM_SWRM_MAX_RD_LEN 0x1 #define DEFAULT_CLK_FREQ 9600000 -#define SWRM_MAX_DAIS 0xF #define SWR_INVALID_PARAM 0xFF #define SWR_HSTOP_MAX_VAL 0xF #define SWR_HSTART_MIN_VAL 0x0 @@ -215,7 +214,7 @@ struct qcom_swrm_ctrl { u8 wcmd_id; /* Port numbers are 1 - 14 */ struct qcom_swrm_port_config *pconfig; - struct sdw_stream_runtime *sruntime[SWRM_MAX_DAIS]; + struct sdw_stream_runtime **sruntime; enum sdw_slave_status status[SDW_MAX_DEVICES + 1]; int (*reg_read)(struct qcom_swrm_ctrl *ctrl, int reg, u32 *val); int (*reg_write)(struct qcom_swrm_ctrl *ctrl, int reg, int val); @@ -1384,6 +1383,10 @@ static int qcom_swrm_register_dais(struct qcom_swrm_ctrl *ctrl) struct device *dev = ctrl->dev; int i; + ctrl->sruntime = devm_kcalloc(dev, num_dais, sizeof(*ctrl->sruntime), GFP_KERNEL); + if (!ctrl->sruntime) + return -ENOMEM; + /* PDM dais are only tested for now */ dais = devm_kcalloc(dev, num_dais, sizeof(*dais), GFP_KERNEL); if (!dais) From 90af3209742db61a7f9d7d054a16165818cfc6d8 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Tue, 30 Jun 2026 09:11:32 +0100 Subject: [PATCH 4/8] soundwire: dmi-quirks: Disable ghost Realtek on Asus Expertbook The Asus Expertbook B9406CAA also has a Realtek device in the ACPI that doesn't exist in the physical hardware. This confuses the machine driver into attempting to create DAI links for the device. Add a quirk to remove this device. Closes: https://github.com/thesofproject/linux/issues/5828 Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20260630081132.3294488-1-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul --- drivers/soundwire/dmi-quirks.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c index 32a46a2d90f7..2a98fc8c104d 100644 --- a/drivers/soundwire/dmi-quirks.c +++ b/drivers/soundwire/dmi-quirks.c @@ -178,6 +178,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { .driver_data = (void *)hp_omen_16, }, /* PTL devices */ + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUS"), + DMI_MATCH(DMI_BOARD_NAME, "B9406CAA"), + }, + .driver_data = (void *)ghost_realtek, + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUS"), From b7a5d101d7d267922e828c40135bcaccf8cfb3bf Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Fri, 3 Jul 2026 09:16:56 +0800 Subject: [PATCH 5/8] soundwire: dmi-quirks: add a global ghost list Not like other ghost devices, the 0x000000D010010500 ADR doesn't belong to any codec. We should disable it in all devices. Signed-off-by: Bard Liao Reviewed-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Link: https://patch.msgid.link/20260703011656.2572959-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul --- drivers/soundwire/dmi-quirks.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c index 2a98fc8c104d..62cee6e2179d 100644 --- a/drivers/soundwire/dmi-quirks.c +++ b/drivers/soundwire/dmi-quirks.c @@ -15,6 +15,14 @@ struct adr_remap { u64 remapped_adr; }; +static const struct adr_remap global_ghost_adr[] = { + { + 0x000000D010010500ull, + 0x0000000000000000ull + }, + {} +}; + /* * Some TigerLake devices based on an initial Intel BIOS do not expose * the correct _ADR in the DSDT. @@ -212,6 +220,7 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { u64 sdw_dmi_override_adr(struct sdw_bus *bus, u64 addr) { const struct dmi_system_id *dmi_id; + int i; /* check if any address remap quirk applies */ dmi_id = dmi_first_match(adr_remap_quirk_table); @@ -223,10 +232,20 @@ u64 sdw_dmi_override_adr(struct sdw_bus *bus, u64 addr) dev_dbg(bus->dev, "remapped _ADR 0x%llx as 0x%llx\n", addr, map->remapped_adr); addr = map->remapped_adr; - break; + goto out; } } } + /* remap the ghost ADRs */ + for (i = 0; i < ARRAY_SIZE(global_ghost_adr); i++) { + if (global_ghost_adr[i].adr == addr) { + dev_dbg(bus->dev, "remapped _ADR 0x%llx as 0x%llx\n", + addr, global_ghost_adr[i].remapped_adr); + addr = global_ghost_adr[i].remapped_adr; + break; + } + } +out: return addr; } From 999f80904763fae547c2c9c32bb7dbc31b86ffa1 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Mon, 6 Jul 2026 21:21:50 +0200 Subject: [PATCH 6/8] soundwire: qcom: add SCP address paging support The Qualcomm controller driver ignores the paging fields of struct sdw_msg. For a paged access (register address >= 0x8000 on a paging-capable peripheral, e.g. the SDCA control space at 0x40000000+) the core sets BIT(15) in the wire address and splits the upper bits into addr_page1/addr_page2, but since the controller never programmed the SCP_AddrPage registers the peripheral resolved every such command against their reset value: reads and writes were silently redirected to addr[14:0] in page 0. Write the two SCP_AddrPage registers through the command FIFO before the transfer, as cadence_master.c (cdns_program_scp_addr) and amd_manager.c (amd_program_scp_addr) do. Like those controllers the pages are programmed on every paged message rather than cached per device; a cache can be a follow-up if the two extra FIFO commands ever matter. No peripheral on a Qualcomm bus sets prop.paging_support in mainline today; the first user is the WCD9378 codec, whose driver is being upstreamed separately - its entire register map, the wcd937x-compatible analog core included, lives in the SDCA address space. Verified on the Fairphone 6 (SM7635): WCD9378 SDCA registers read back their documented reset defaults and audio capture through the codec works end-to-end; without this change every paged access landed in page 0. Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf Reviewed-by: Srinivas Kandagatla Link: https://patch.msgid.link/20260706192150.143921-1-jorijnvdgraaf@catcrafts.net Signed-off-by: Vinod Koul --- drivers/soundwire/qcom.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 603f228f46b5..3562802f4204 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -975,6 +975,20 @@ static enum sdw_command_response qcom_swrm_xfer_msg(struct sdw_bus *bus, struct qcom_swrm_ctrl *ctrl = to_qcom_sdw(bus); int ret, i, len; + if (msg->page) { + ret = qcom_swrm_cmd_fifo_wr_cmd(ctrl, msg->addr_page1, + msg->dev_num, + SDW_SCP_ADDRPAGE1); + if (ret) + return ret; + + ret = qcom_swrm_cmd_fifo_wr_cmd(ctrl, msg->addr_page2, + msg->dev_num, + SDW_SCP_ADDRPAGE2); + if (ret) + return ret; + } + if (msg->flags == SDW_MSG_FLAG_READ) { for (i = 0; i < msg->len;) { len = min(msg->len - i, QCOM_SWRM_MAX_RD_LEN); From d08e4d9197396ceb906715d976b63aed0c5cc8e5 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Wed, 8 Jul 2026 13:29:48 +0100 Subject: [PATCH 7/8] soundwire: intel_auxdevice: Add cs42l44 to wake_capable_list Add cs42l44 to the wake_capable_list because it can generate jack events whilst the bus is stopped. Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20260708122948.1502227-1-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul --- drivers/soundwire/intel_auxdevice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c index 0b8107bec9ab..a8407560bf4f 100644 --- a/drivers/soundwire/intel_auxdevice.c +++ b/drivers/soundwire/intel_auxdevice.c @@ -54,6 +54,7 @@ static struct wake_capable_part wake_capable_list[] = { {0x01fa, 0x2A30}, {0x01fa, 0x2A3B}, {0x01fa, 0x4243}, + {0x01fa, 0x4244}, {0x01fa, 0x4245}, {0x01fa, 0x4249}, {0x01fa, 0x4747}, From 6409292ab5f7d1a60a6f8948bd6dcd8633c36dfe Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 14 Jul 2026 20:07:19 -0700 Subject: [PATCH 8/8] soundwire: bus.h: repair kernel-doc comments Use the correct struct names (i.e., correct typos). Use the struct keyword for structs as required. Prevents 5 warnings: Warning: drivers/soundwire/bus.h:86 expecting prototype for struct sdw_btp_section. Prototype was for struct sdw_bpt_section instead Warning: drivers/soundwire/bus.h:100 expecting prototype for struct sdw_btp_msg. Prototype was for struct sdw_bpt_msg instead Warning: drivers/soundwire/bus.h:125 cannot understand function prototype: 'struct sdw_port_runtime' Warning: drivers/soundwire/bus.h:144 cannot understand function prototype: 'struct sdw_slave_runtime' Warning: drivers/soundwire/bus.h:165 cannot understand function prototype: 'struct sdw_master_runtime' Signed-off-by: Randy Dunlap Link: https://patch.msgid.link/20260715030719.757781-1-rdunlap@infradead.org Signed-off-by: Vinod Koul --- drivers/soundwire/bus.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h index 8115c64dd48e..44e4f5193917 100644 --- a/drivers/soundwire/bus.h +++ b/drivers/soundwire/bus.h @@ -73,7 +73,7 @@ struct sdw_msg { }; /** - * struct sdw_btp_section - Message section structure + * struct sdw_bpt_section - Message section structure * @addr: Start Register address accessed in the Slave * @len: number of bytes to transfer. More than 64Kb can be transferred * but a practical limit of SDW_BPT_MSG_MAX_BYTES is enforced. @@ -87,7 +87,7 @@ struct sdw_bpt_section { }; /** - * struct sdw_btp_msg - Message structure + * struct sdw_bpt_msg - Message structure * @sec: Pointer to array of sections * @sections: Number of sections in the array * @dev_num: Slave device number @@ -110,7 +110,7 @@ int sdw_find_row_index(int row); int sdw_find_col_index(int col); /** - * sdw_port_runtime: Runtime port parameters for Master or Slave + * struct sdw_port_runtime - Runtime port parameters for Master or Slave * * @num: Port number. For audio streams, valid port number ranges from * [1,14] @@ -133,7 +133,7 @@ struct sdw_port_runtime { }; /** - * sdw_slave_runtime: Runtime Stream parameters for Slave + * struct sdw_slave_runtime - Runtime Stream parameters for Slave * * @slave: Slave handle * @direction: Data direction for Slave @@ -151,7 +151,7 @@ struct sdw_slave_runtime { }; /** - * sdw_master_runtime: Runtime stream parameters for Master + * struct sdw_master_runtime - Runtime stream parameters for Master * * @bus: Bus handle * @stream: Stream runtime handle