Skip to content

Commit 3e3ae0c

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: cadence: add BTP support for DP0
The register definitions are missing a BULK_ENABLE bitfield which must be set for DP0. In addition, the existing mapping from PDI to Data Port is 1:1. That's fine for PCM streams which are by construction in one direction only. The BTP/BRA protocol is bidirectional and relies on DP0 only, which breaks the 1:1 mapping. DP0 MUST be mapped to both PDI0 and PDI1, with PDI0 taking care of the TX direction and PDI1 of the RX direction. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Tested-by: shumingf@realtek.com Link: https://lore.kernel.org/r/20250227140615.8147-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 3641c63 commit 3e3ae0c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/soundwire/cadence_master.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ MODULE_PARM_DESC(cdns_mcp_int_mask, "Cadence MCP IntMask");
184184
#define CDNS_PORTCTRL_TEST_FAILED BIT(1)
185185
#define CDNS_PORTCTRL_DIRN BIT(7)
186186
#define CDNS_PORTCTRL_BANK_INVERT BIT(8)
187+
#define CDNS_PORTCTRL_BULK_ENABLE BIT(16)
187188

188189
#define CDNS_PORT_OFFSET 0x80
189190

@@ -1917,13 +1918,20 @@ void sdw_cdns_config_stream(struct sdw_cdns *cdns,
19171918

19181919
if (cdns->bus.params.m_data_mode != SDW_PORT_DATA_MODE_NORMAL)
19191920
val |= CDNS_PORTCTRL_TEST_FAILED;
1921+
} else if (pdi->num == 0 || pdi->num == 1) {
1922+
val |= CDNS_PORTCTRL_BULK_ENABLE;
19201923
}
19211924
offset = CDNS_PORTCTRL + pdi->num * CDNS_PORT_OFFSET;
19221925
cdns_updatel(cdns, offset,
1923-
CDNS_PORTCTRL_DIRN | CDNS_PORTCTRL_TEST_FAILED,
1926+
CDNS_PORTCTRL_DIRN | CDNS_PORTCTRL_TEST_FAILED |
1927+
CDNS_PORTCTRL_BULK_ENABLE,
19241928
val);
19251929

1926-
val = pdi->num;
1930+
/* The DataPort0 needs to be mapped to both PDI0 and PDI1 ! */
1931+
if (pdi->num == 1)
1932+
val = 0;
1933+
else
1934+
val = pdi->num;
19271935
val |= CDNS_PDI_CONFIG_SOFT_RESET;
19281936
val |= FIELD_PREP(CDNS_PDI_CONFIG_CHANNEL, (1 << ch) - 1);
19291937
cdns_writel(cdns, CDNS_PDI_CONFIG(pdi->num), val);

0 commit comments

Comments
 (0)