[RESEND v5 0/2] Add software clock gating requirement check
This patch set is to add software clock gating requirement check
Changes Since V4: -- Fix error check, after a reset control get api return -- Fix typo in commit message Changes Since V3: -- Remove redundant check before reset control call -- Reorganiaze patches. -- Fix typos. Changes Since V2: -- Fix if check before reset control call Changes Since V1: -- Use boolean flag for bool variable initialization instead of hard coding.
Srinivasa Rao Mandadapu (2): soundwire: qcom: Add flag for software clock gating check ASoC: qcom: soundwire: Enable software clock gating requirement flag
drivers/soundwire/qcom.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
Validate software clock gating required or not and do software clock gating on hclk if soundwire is operational and keep it running by adding flag in private data structure. This is to avoid conflict between older architectures, where software clock gating is not required and on latest architectures, where software clock gating is mandatory.
Signed-off-by: Srinivasa Rao Mandadapu quic_srivasam@quicinc.com Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- drivers/soundwire/qcom.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 22b7063..5baceda 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -179,6 +179,7 @@ struct qcom_swrm_ctrl { struct qcom_swrm_data { u32 default_cols; u32 default_rows; + bool sw_clk_gate_required; };
static const struct qcom_swrm_data swrm_v1_3_data = { @@ -1307,6 +1308,15 @@ static int qcom_swrm_probe(struct platform_device *pdev) return PTR_ERR(ctrl->mmio); }
+ if (data->sw_clk_gate_required) { + ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr"); + if (IS_ERR_OR_NULL(ctrl->audio_cgcr)) { + dev_err(dev, "Failed to get cgcr reset ctrl required for SW gating\n"); + ret = PTR_ERR(ctrl->audio_cgcr); + goto err_init; + } + } + ctrl->irq = of_irq_get(dev->of_node, 0); if (ctrl->irq < 0) { ret = ctrl->irq;
Enable software clock gating flag in private data for SC7280 based platforms, which are soundwire 1.6.0 version based.
Signed-off-by: Srinivasa Rao Mandadapu quic_srivasam@quicinc.com Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- drivers/soundwire/qcom.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 5baceda..4a77e74 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -192,6 +192,12 @@ static const struct qcom_swrm_data swrm_v1_5_data = { .default_cols = 16, };
+static const struct qcom_swrm_data swrm_v1_6_data = { + .default_rows = 50, + .default_cols = 16, + .sw_clk_gate_required = true, +}; + #define to_qcom_sdw(b) container_of(b, struct qcom_swrm_ctrl, bus)
static int qcom_swrm_ahb_reg_read(struct qcom_swrm_ctrl *ctrl, int reg, @@ -1558,7 +1564,7 @@ static const struct dev_pm_ops swrm_dev_pm_ops = { static const struct of_device_id qcom_swrm_of_match[] = { { .compatible = "qcom,soundwire-v1.3.0", .data = &swrm_v1_3_data }, { .compatible = "qcom,soundwire-v1.5.1", .data = &swrm_v1_5_data }, - { .compatible = "qcom,soundwire-v1.6.0", .data = &swrm_v1_5_data }, + { .compatible = "qcom,soundwire-v1.6.0", .data = &swrm_v1_6_data }, {/* sentinel */}, };
On 01-07-22, 12:47, Srinivasa Rao Mandadapu wrote:
Enable software clock gating flag in private data for SC7280 based platforms, which are soundwire 1.6.0 version based.
why is this tagged ASoC... ???
I have fixed it up while applying
On 7/4/2022 11:06 AM, Vinod Koul wrote:
On 01-07-22, 12:47, Srinivasa Rao Mandadapu wrote:
Enable software clock gating flag in private data for SC7280 based platforms, which are soundwire 1.6.0 version based.
why is this tagged ASoC... ???
As regular habit, did this mistake. No particular intention. Will take care from next time.
I have fixed it up while applying
Thanks Vinod. Sorry for inconvenience caused.
participants (2)
-
Srinivasa Rao Mandadapu
-
Vinod Koul