diff --git a/Documentation/devicetree/bindings/devfreq/devfreq-spdm.txt b/Documentation/devicetree/bindings/devfreq/devfreq-spdm.txt index 16303f769d42..1f0d0a0db20e 100644 --- a/Documentation/devicetree/bindings/devfreq/devfreq-spdm.txt +++ b/Documentation/devicetree/bindings/devfreq/devfreq-spdm.txt @@ -6,9 +6,6 @@ hardware to measure the traffic status of configured master ports on the bus. Required properties: -compatible: Must be "qcom,devfreq_spdm" --clock-names: Clocks used to measure current bus frequency. - Expected names are "cci_clk" --clocks: References to named clocks -qcom,spdm-client: Client id of the port being monitored -qcom,bw-upstep: Initial up vote size in MB/s -qcom,bw-dwnstep: Initial down vote size in MB/s @@ -31,6 +28,11 @@ Required properties: -qcom,up-step-multp: used to increase rate of growth on up votes -qcom,spdm-interval: down-vote polling interval +Optional properties: +-clock-names: Clocks used to measure current bus frequency. + Expected names are "cci_clk" +-clocks: References to named clocks + Example: devfreq_spdm_cpu { compatible = "qcom,devfreq_spdm"; diff --git a/drivers/devfreq/devfreq_spdm.c b/drivers/devfreq/devfreq_spdm.c index f8ef5eda08ea..8e35570e0443 100644 --- a/drivers/devfreq/devfreq_spdm.c +++ b/drivers/devfreq/devfreq_spdm.c @@ -70,7 +70,12 @@ static int change_bw(struct device *dev, unsigned long *freq, u32 flags) update_thresholds: desc.arg[0] = SPDM_CMD_ENABLE; desc.arg[1] = data->spdm_client; - desc.arg[2] = (clk_get_rate(data->cci_clk)) / 1000; + + if (data->cci_clk) + desc.arg[2] = (clk_get_rate(data->cci_clk)) / 1000; + else + desc.arg[2] = 0; + ext_status = spdm_ext_call(&desc, 3); if (ext_status) pr_err("External command %u failed with error %u", @@ -339,8 +344,7 @@ static int probe(struct platform_device *pdev) data->cci_clk = clk_get(&pdev->dev, "cci_clk"); if (IS_ERR(data->cci_clk)) { - ret = PTR_ERR(data->cci_clk); - goto no_clock; + data->cci_clk = NULL; } data->profile = @@ -376,7 +380,6 @@ static int probe(struct platform_device *pdev) no_spdm_device: devm_kfree(&pdev->dev, data->profile); no_profile: -no_clock: msm_bus_scale_unregister_client(data->bus_scale_client_id); no_bus_scaling: devm_kfree(&pdev->dev, data->config_data.ports); diff --git a/drivers/devfreq/governor_spdm_bw_hyp.c b/drivers/devfreq/governor_spdm_bw_hyp.c index e5e179931811..cd068a3097ce 100644 --- a/drivers/devfreq/governor_spdm_bw_hyp.c +++ b/drivers/devfreq/governor_spdm_bw_hyp.c @@ -361,7 +361,7 @@ static int probe(struct platform_device *pdev) *irq = platform_get_irq_byname(pdev, "spdm-irq"); ret = request_threaded_irq(*irq, isr, threaded_isr, - IRQF_TRIGGER_HIGH | IRQF_ONESHOT, + IRQF_ONESHOT, spdm_hyp_gov.name, pdev); if (ret) goto no_irq;