From b496bb56b418788aa8625950e94206abe7282e18 Mon Sep 17 00:00:00 2001 From: Sibi Sankar Date: Wed, 1 Jul 2026 17:31:13 +0100 Subject: 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 -- cgit v1.2.3 From 6ccec91c3535b07310e12d32fe9c67ff8d31d965 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Wed, 1 Jul 2026 20:30:05 +0100 Subject: 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; } -- cgit v1.2.3 From 4f9df964ba4507958df39612103d0eb318b1e3e5 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Wed, 1 Jul 2026 20:30:06 +0100 Subject: 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) -- cgit v1.2.3 From 90af3209742db61a7f9d7d054a16165818cfc6d8 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Tue, 30 Jun 2026 09:11:32 +0100 Subject: 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"), -- cgit v1.2.3