Skip to content

Commit cf43cd3

Browse files
Srinivas-Kandagatlavinodkoul
authored andcommitted
soundwire: qcom: add support for v1.7 Soundwire Controller
This patch add support for v1.7 SoundWire Controller which has support for Multi-EE (Execution Environment), resulting in a new register and extending field in BUS_CTRL register. With these updates v1.7.0 is fully supported. Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent df73f66 commit cf43cd3

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

drivers/soundwire/qcom.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#define SWRM_COMP_SW_RESET 0x008
2727
#define SWRM_COMP_STATUS 0x014
28+
#define SWRM_LINK_MANAGER_EE 0x018
29+
#define SWRM_EE_CPU 1
2830
#define SWRM_FRM_GEN_ENABLED BIT(0)
2931
#define SWRM_COMP_HW_VERSION 0x00
3032
#define SWRM_COMP_CFG_ADDR 0x04
@@ -684,7 +686,14 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl)
684686
u32p_replace_bits(&val, SWRM_DEF_CMD_NO_PINGS, SWRM_MCP_CFG_MAX_NUM_OF_CMD_NO_PINGS_BMSK);
685687
ctrl->reg_write(ctrl, SWRM_MCP_CFG_ADDR, val);
686688

687-
ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START);
689+
if (ctrl->version >= 0x01070000) {
690+
ctrl->reg_write(ctrl, SWRM_LINK_MANAGER_EE, SWRM_EE_CPU);
691+
ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL,
692+
SWRM_MCP_BUS_CLK_START << SWRM_EE_CPU);
693+
} else {
694+
ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START);
695+
}
696+
688697
/* Configure number of retries of a read/write cmd */
689698
if (ctrl->version > 0x01050001) {
690699
/* Only for versions >= 1.5.1 */
@@ -1509,7 +1518,13 @@ static int __maybe_unused swrm_runtime_resume(struct device *dev)
15091518
} else {
15101519
reset_control_reset(ctrl->audio_cgcr);
15111520

1512-
ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START);
1521+
if (ctrl->version >= 0x01070000) {
1522+
ctrl->reg_write(ctrl, SWRM_LINK_MANAGER_EE, SWRM_EE_CPU);
1523+
ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL,
1524+
SWRM_MCP_BUS_CLK_START << SWRM_EE_CPU);
1525+
} else {
1526+
ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START);
1527+
}
15131528
ctrl->reg_write(ctrl, SWRM_INTERRUPT_CLEAR,
15141529
SWRM_INTERRUPT_STATUS_MASTER_CLASH_DET);
15151530

@@ -1573,6 +1588,7 @@ static const struct of_device_id qcom_swrm_of_match[] = {
15731588
{ .compatible = "qcom,soundwire-v1.3.0", .data = &swrm_v1_3_data },
15741589
{ .compatible = "qcom,soundwire-v1.5.1", .data = &swrm_v1_5_data },
15751590
{ .compatible = "qcom,soundwire-v1.6.0", .data = &swrm_v1_6_data },
1591+
{ .compatible = "qcom,soundwire-v1.7.0", .data = &swrm_v1_5_data },
15761592
{/* sentinel */},
15771593
};
15781594

0 commit comments

Comments
 (0)