|
13 | 13 | #include <linux/of_device.h> |
14 | 14 | #include <linux/pm_runtime.h> |
15 | 15 | #include <linux/regmap.h> |
| 16 | +#include <linux/reset.h> |
16 | 17 | #include <linux/slab.h> |
17 | 18 | #include <linux/pm_wakeirq.h> |
18 | 19 | #include <linux/slimbus.h> |
@@ -142,6 +143,7 @@ struct qcom_swrm_ctrl { |
142 | 143 | struct device *dev; |
143 | 144 | struct regmap *regmap; |
144 | 145 | void __iomem *mmio; |
| 146 | + struct reset_control *audio_cgcr; |
145 | 147 | #ifdef CONFIG_DEBUG_FS |
146 | 148 | struct dentry *debugfs; |
147 | 149 | #endif |
@@ -656,6 +658,8 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl) |
656 | 658 | val = FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_ROW_CTRL_BMSK, ctrl->rows_index); |
657 | 659 | val |= FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_COL_CTRL_BMSK, ctrl->cols_index); |
658 | 660 |
|
| 661 | + reset_control_reset(ctrl->audio_cgcr); |
| 662 | + |
659 | 663 | ctrl->reg_write(ctrl, SWRM_MCP_FRAME_CTRL_BANK_ADDR(0), val); |
660 | 664 |
|
661 | 665 | /* Enable Auto enumeration */ |
@@ -1332,6 +1336,10 @@ static int qcom_swrm_probe(struct platform_device *pdev) |
1332 | 1336 | ctrl->bus.compute_params = &qcom_swrm_compute_params; |
1333 | 1337 | ctrl->bus.clk_stop_timeout = 300; |
1334 | 1338 |
|
| 1339 | + ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr"); |
| 1340 | + if (IS_ERR(ctrl->audio_cgcr)) |
| 1341 | + dev_err(dev, "Failed to get audio_cgcr reset required for soundwire-v1.6.0\n"); |
| 1342 | + |
1335 | 1343 | ret = qcom_swrm_get_port_config(ctrl); |
1336 | 1344 | if (ret) |
1337 | 1345 | goto err_clk; |
@@ -1485,6 +1493,8 @@ static int __maybe_unused swrm_runtime_resume(struct device *dev) |
1485 | 1493 | qcom_swrm_get_device_status(ctrl); |
1486 | 1494 | sdw_handle_slave_status(&ctrl->bus, ctrl->status); |
1487 | 1495 | } else { |
| 1496 | + reset_control_reset(ctrl->audio_cgcr); |
| 1497 | + |
1488 | 1498 | ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START); |
1489 | 1499 | ctrl->reg_write(ctrl, SWRM_INTERRUPT_CLEAR, |
1490 | 1500 | SWRM_INTERRUPT_STATUS_MASTER_CLASH_DET); |
|
0 commit comments