Re: [PATCH v2 05/13] ASoC: qcom: support bitclk and osrclk per i2s port
From: Kenneth Westfield
Date: Sun May 17 2015 - 12:15:02 EST
On Sat, May 16, 2015 at 05:32:42AM -0700, Srinivas Kandagatla wrote:
> This patch adds support to allow bitclk and osrclk per i2s dai port.
> on APQ8016 there are 4 i2s ports each one has its own bit clks.
>
> Without this patch its not possible to support multiple i2s ports in the
> lpass driver.
> @@ -400,18 +402,34 @@ int asoc_qcom_lpass_cpu_platform_probe(struct
> platform_device *pdev)
> if (variant->init)
> variant->init(pdev);
>
> - drvdata->mi2s_osr_clk = devm_clk_get(&pdev->dev, "mi2s-osr-clk");
> - if (IS_ERR(drvdata->mi2s_osr_clk)) {
> - dev_err(&pdev->dev, "%s() error getting mi2s-osr-clk:
> %ld\n",
> - __func__, PTR_ERR(drvdata->mi2s_osr_clk));
> - return PTR_ERR(drvdata->mi2s_osr_clk);
> - }
> -
> - drvdata->mi2s_bit_clk = devm_clk_get(&pdev->dev, "mi2s-bit-clk");
> - if (IS_ERR(drvdata->mi2s_bit_clk)) {
> - dev_err(&pdev->dev, "%s() error getting mi2s-bit-clk:
> %ld\n",
> - __func__, PTR_ERR(drvdata->mi2s_bit_clk));
> - return PTR_ERR(drvdata->mi2s_bit_clk);
> + for (i = 0; i < variant->num_dai; i++) {
> + dai_id = variant->dai_driver[i].id;
> + if (variant->num_dai > 1)
> + sprintf(clk_name, "mi2s-osr-clk%d", i);
> + else
> + sprintf(clk_name, "mi2s-osr-clk");
> +
> + drvdata->mi2s_osr_clk[dai_id] = devm_clk_get(&pdev->dev,
> + clk_name);
> + if (IS_ERR(drvdata->mi2s_osr_clk[dai_id])) {
> + dev_err(&pdev->dev,
> + "%s() error getting mi2s-osr-clk: %ld\n",
> + __func__,
> + return PTR_ERR(drvdata->mi2s_osr_clk[dai_id]));
Should the previous two lines be:
+ __func__, PTR_ERR(drvdata->mi2s_osr_clk[dai_id]));
+ return PTR_ERR(drvdata->mi2s_osr_clk[dai_id]);
as you remove the return in patch 6?
> + }
> +
> + if (variant->num_dai > 1)
> + sprintf(clk_name, "mi2s-bit-clk%d", i);
> + else
> + sprintf(clk_name, "mi2s-bit-clk");
> +
> + drvdata->mi2s_bit_clk[dai_id] = devm_clk_get(&pdev->dev,
> clk_name);
> + if (IS_ERR(drvdata->mi2s_bit_clk[dai_id])) {
> + dev_err(&pdev->dev,
> + "%s() error getting mi2s-bit-clk: %ld\n",
> + __func__,
> PTR_ERR(drvdata->mi2s_bit_clk[i]));
> + return PTR_ERR(drvdata->mi2s_bit_clk[dai_id]);
> + }
> }
--
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/