From patchwork Sat Apr 11 08:02:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Pandey X-Patchwork-Id: 193044 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDB55C2BA19 for ; Tue, 14 Apr 2020 07:44:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55919206B6 for ; Tue, 14 Apr 2020 07:44:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hSXUhGHi"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="FEzc0nJI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55919206B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B551E1696; Tue, 14 Apr 2020 09:43:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B551E1696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1586850281; bh=iXw/90kgNgV+65nLurqRVw7PQEne8xVE+CBqzlCo//I=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hSXUhGHiSKVFF3wMAvC/As12xs1lNhBwb56KmiqgG5sLBk0bE7xQHRocavYe/hxdt v9w9Zc3/WzXeCbWHM/TokjBzzYcwJRieQpt7zv7TCpbj/7R4C6eQxgzkQ88OEfJQtt 33/sq0PSZOXpBuKFJbWC505jvP7JQzmHyHsmfDCM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 403A4F8028A; Tue, 14 Apr 2020 09:42:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7C4E2F801DA; Sat, 11 Apr 2020 10:04:05 +0200 (CEST) Received: from mail27.static.mailgun.info (mail27.static.mailgun.info [104.130.122.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 88CF6F800B9 for ; Sat, 11 Apr 2020 10:04:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 88CF6F800B9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="FEzc0nJI" DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586592243; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=KXy1loHb2FhxhHhKQrd5okL0GUCoCdYflO1LTaz/12I=; b=FEzc0nJISJ7RwMZsT8AhK+wJtUOe+StmRc9yajntkuMYhVKh29O0sfxp0CIB7FcRAhHNCme7 VuZ8l963S+XNBMVvPaD45gw8TmSkoU1Vf5UfnsPVu0xdt0zFK78DYoOGIzhDHPMpIMSl4Wmr 43GwPEYNZuAISH0O+nw9XoQnsR4= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI4ZmE2ZSIsICJhbHNhLWRldmVsQGFsc2EtcHJvamVjdC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e9179e9.7f266d4e3848-smtp-out-n05; Sat, 11 Apr 2020 08:03:53 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 69BD6C432C2; Sat, 11 Apr 2020 08:03:53 +0000 (UTC) Received: from c-ajitp-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ajitp) by smtp.codeaurora.org (Postfix) with ESMTPSA id 857D6C433CB; Sat, 11 Apr 2020 08:03:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 857D6C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=ajitp@codeaurora.org From: Ajit Pandey To: alsa-devel@alsa-project.org, broonie@kernel.org, devicetree@vger.kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, srinivas.kandagatla@linaro.org Subject: [PATCH 02/11] ASoC: qcom: lpass: Add struct lpass_dai to store dai clocks pointer Date: Sat, 11 Apr 2020 13:32:42 +0530 Message-Id: <1586592171-31644-3-git-send-email-ajitp@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> References: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> X-Mailman-Approved-At: Tue, 14 Apr 2020 09:41:46 +0200 Cc: Ajit Pandey , linux-kernel@vger.kernel.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" lpass_dai will store clocks related to respective dai's and it will be initialized during probe based on variant clock names. Signed-off-by: Ajit Pandey --- sound/soc/qcom/lpass-cpu.c | 89 ++++++++++++++++++++++++++-------------------- sound/soc/qcom/lpass.h | 18 +++++----- 2 files changed, 61 insertions(+), 46 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index dbce7e9..492f27b 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -23,13 +23,15 @@ static int lpass_cpu_daiops_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); - int ret; - - ret = clk_set_rate(drvdata->mi2s_osr_clk[dai->driver->id], freq); - if (ret) - dev_err(dai->dev, "error setting mi2s osrclk to %u: %d\n", - freq, ret); + struct lpass_dai *dai_data = drvdata->dai_priv[dai->driver->id]; + int ret = 0; + if (dai_data->osr_clk != NULL) { + ret = clk_set_rate(dai_data->osr_clk, freq); + if (ret) + dev_err(dai->dev, "error setting mi2s osrclk to %u:%d\n", + freq, ret); + } return ret; } @@ -37,18 +39,22 @@ static int lpass_cpu_daiops_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); + struct lpass_dai *dai_data = drvdata->dai_priv[dai->driver->id]; int ret; - ret = clk_prepare_enable(drvdata->mi2s_osr_clk[dai->driver->id]); - if (ret) { - dev_err(dai->dev, "error in enabling mi2s osr clk: %d\n", ret); - return ret; + if (dai_data->osr_clk != NULL) { + ret = clk_prepare_enable(dai_data->osr_clk); + if (ret) { + dev_err(dai->dev, + "error in enabling mi2s osr clk: %d\n", ret); + return ret; + } } - ret = clk_prepare_enable(drvdata->mi2s_bit_clk[dai->driver->id]); + ret = clk_prepare_enable(dai_data->bit_clk); if (ret) { dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret); - clk_disable_unprepare(drvdata->mi2s_osr_clk[dai->driver->id]); + clk_disable_unprepare(dai_data->osr_clk); return ret; } @@ -59,16 +65,18 @@ static void lpass_cpu_daiops_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); + struct lpass_dai *dai_data = drvdata->dai_priv[dai->driver->id]; - clk_disable_unprepare(drvdata->mi2s_bit_clk[dai->driver->id]); + clk_disable_unprepare(dai_data->bit_clk); - clk_disable_unprepare(drvdata->mi2s_osr_clk[dai->driver->id]); + clk_disable_unprepare(dai_data->osr_clk); } static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); + struct lpass_dai *dai_data = drvdata->dai_priv[dai->driver->id]; snd_pcm_format_t format = params_format(params); unsigned int channels = params_channels(params); unsigned int rate = params_rate(params); @@ -163,8 +171,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, return ret; } - ret = clk_set_rate(drvdata->mi2s_bit_clk[dai->driver->id], - rate * bitwidth * 2); + ret = clk_set_rate(dai_data->bit_clk, rate * bitwidth * 2); if (ret) { dev_err(dai->dev, "error setting mi2s bitclk to %u: %d\n", rate * bitwidth * 2, ret); @@ -413,6 +420,25 @@ static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg) .cache_type = REGCACHE_FLAT, }; +static int lpass_init_dai_clocks(struct device *dev, + struct lpass_data *drvdata) +{ + struct lpass_dai *dai; + struct lpass_variant *v = drvdata->variant; + int i; + + for (i = 0; i < v->num_dai; i++) { + + dai = drvdata->dai_priv[i]; + + dai->osr_clk = devm_clk_get_optional(dev, + v->dai_osr_clk_names[i]); + dai->bit_clk = devm_clk_get(dev, v->dai_bit_clk_names[i]); + } + + return 0; +} + int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) { struct lpass_data *drvdata; @@ -421,7 +447,7 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) struct lpass_variant *variant; struct device *dev = &pdev->dev; const struct of_device_id *match; - int ret, i, dai_id; + int ret, i; dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0); if (dsp_of_node) { @@ -467,28 +493,15 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) variant->init(pdev); for (i = 0; i < variant->num_dai; i++) { - dai_id = variant->dai_driver[i].id; - drvdata->mi2s_osr_clk[dai_id] = devm_clk_get(&pdev->dev, - variant->dai_osr_clk_names[i]); - if (IS_ERR(drvdata->mi2s_osr_clk[dai_id])) { - dev_warn(&pdev->dev, - "%s() error getting optional %s: %ld\n", - __func__, - variant->dai_osr_clk_names[i], - PTR_ERR(drvdata->mi2s_osr_clk[dai_id])); - - drvdata->mi2s_osr_clk[dai_id] = NULL; - } + drvdata->dai_priv[i] = devm_kzalloc(dev, + sizeof(struct lpass_dai), + GFP_KERNEL); + } - drvdata->mi2s_bit_clk[dai_id] = devm_clk_get(&pdev->dev, - variant->dai_bit_clk_names[i]); - if (IS_ERR(drvdata->mi2s_bit_clk[dai_id])) { - dev_err(&pdev->dev, - "error getting %s: %ld\n", - variant->dai_bit_clk_names[i], - PTR_ERR(drvdata->mi2s_bit_clk[dai_id])); - return PTR_ERR(drvdata->mi2s_bit_clk[dai_id]); - } + ret = lpass_init_dai_clocks(dev, drvdata); + if (ret) { + dev_err(&pdev->dev, "error intializing dai clock: %d\n", ret); + return ret; } drvdata->ahbix_clk = devm_clk_get(&pdev->dev, "ahbix-clk"); diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index 17113d3..b729686 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -13,9 +13,14 @@ #include #include -#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 -#define LPASS_MAX_MI2S_PORTS (8) -#define LPASS_MAX_DMA_CHANNELS (8) +#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 +#define LPASS_MAX_MI2S_PORTS (8) +#define LPASS_MAX_DMA_CHANNELS (8) + +struct lpass_dai { + struct clk *osr_clk; + struct clk *bit_clk; +}; /* Both the CPU DAI and platform drivers will access this data */ struct lpass_data { @@ -23,11 +28,8 @@ struct lpass_data { /* AHB-I/X bus clocks inside the low-power audio subsystem (LPASS) */ struct clk *ahbix_clk; - /* MI2S system clock */ - struct clk *mi2s_osr_clk[LPASS_MAX_MI2S_PORTS]; - - /* MI2S bit clock (derived from system clock by a divider */ - struct clk *mi2s_bit_clk[LPASS_MAX_MI2S_PORTS]; + /* MI2S dai specific configuration */ + struct lpass_dai *dai_priv[LPASS_MAX_MI2S_PORTS]; /* low-power audio interface (LPAIF) registers */ void __iomem *lpaif; From patchwork Sat Apr 11 08:02:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Pandey X-Patchwork-Id: 193043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8CCFC2BA19 for ; Tue, 14 Apr 2020 07:45:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7459E206B6 for ; Tue, 14 Apr 2020 07:45:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="V9PLzCfI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="pwjskvPU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7459E206B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D743616A2; Tue, 14 Apr 2020 09:44:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D743616A2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1586850334; bh=y28UbxWdvqoty5hr2urcEAnMd+Ed8EBk5a2sKzxEBMA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=V9PLzCfI+Y0t4KZVFxlMSjBTNPIXk2PTpXHn3zA18QusNxLO8iaXK7JJ5m+wd68ga D1T76qYnIatRlsLCyKNDwbXHwZRov1nUMn4Pzl1ginI8AK2GAG4lzrjA+9qrcEm5V1 18aGsrCKwycIVfuZor9FkTZPhMwisVGvut++n3nU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 004BBF80291; Tue, 14 Apr 2020 09:42:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B3766F801DA; Sat, 11 Apr 2020 10:04:07 +0200 (CEST) Received: from mail27.static.mailgun.info (mail27.static.mailgun.info [104.130.122.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CF670F800CB for ; Sat, 11 Apr 2020 10:04:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CF670F800CB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="pwjskvPU" DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586592244; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Y8q86WTB5/2WAKeKfT6xOfI6cCwvGx47c3+wU560RYE=; b=pwjskvPUzCSZlnEH65KwTMD8u7t0ZHSsA3U7YBErrTcqtOiR3J0Fb8dsNQaBIFqynCwvvuub aDzyJd6UnJBGWscuaS+51Ip9ik+Yfz/FAvPHbprIWU+8kz54yFwYR8rkxnyZLG44YD6pDZuZ /EA3V/e9DLPCctlTk2K90LuQ4r8= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI4ZmE2ZSIsICJhbHNhLWRldmVsQGFsc2EtcHJvamVjdC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e9179f3.7f70714401b8-smtp-out-n05; Sat, 11 Apr 2020 08:04:03 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 41875C432C2; Sat, 11 Apr 2020 08:04:02 +0000 (UTC) Received: from c-ajitp-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ajitp) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8C4B2C433F2; Sat, 11 Apr 2020 08:03:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8C4B2C433F2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=ajitp@codeaurora.org From: Ajit Pandey To: alsa-devel@alsa-project.org, broonie@kernel.org, devicetree@vger.kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, srinivas.kandagatla@linaro.org Subject: [PATCH 03/11] ASoC: qcom: Add common array to initialize soc based core clocks Date: Sat, 11 Apr 2020 13:32:43 +0530 Message-Id: <1586592171-31644-4-git-send-email-ajitp@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> References: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> X-Mailman-Approved-At: Tue, 14 Apr 2020 09:41:46 +0200 Cc: Ajit Pandey , linux-kernel@vger.kernel.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" lpass variants have their own soc specific clocks that needs to be enable for MI2S audio support. Added a common variable in drvdata to initialize such clocks using bulk clk api. Such clock names is still defined in variants specific data and needs to fetched during init. Signed-off-by: Ajit Pandey --- sound/soc/qcom/lpass-apq8016.c | 39 ++++++++++++++++++--------------------- sound/soc/qcom/lpass.h | 10 +++++++--- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index 6575da5..cef4661 100644 --- a/sound/soc/qcom/lpass-apq8016.c +++ b/sound/soc/qcom/lpass-apq8016.c @@ -161,33 +161,26 @@ static int apq8016_lpass_free_dma_channel(struct lpass_data *drvdata, int chan) static int apq8016_lpass_init(struct platform_device *pdev) { struct lpass_data *drvdata = platform_get_drvdata(pdev); + struct lpass_variant *variant = drvdata->variant; struct device *dev = &pdev->dev; - int ret; + int ret, i; - drvdata->pcnoc_mport_clk = devm_clk_get(dev, "pcnoc-mport-clk"); - if (IS_ERR(drvdata->pcnoc_mport_clk)) { - dev_err(&pdev->dev, "error getting pcnoc-mport-clk: %ld\n", - PTR_ERR(drvdata->pcnoc_mport_clk)); - return PTR_ERR(drvdata->pcnoc_mport_clk); - } + drvdata->clks = devm_kcalloc(dev, variant->num_clks, + sizeof(*drvdata->clks), GFP_KERNEL); + drvdata->num_clks = variant->num_clks; + + for (i = 0; i < drvdata->num_clks; i++) + drvdata->clks[i].id = variant->clk_name[i]; - ret = clk_prepare_enable(drvdata->pcnoc_mport_clk); + ret = devm_clk_bulk_get(dev, drvdata->num_clks, drvdata->clks); if (ret) { - dev_err(&pdev->dev, "Error enabling pcnoc-mport-clk: %d\n", - ret); + dev_err(dev, "Failed to get clocks %d\n", ret); return ret; } - drvdata->pcnoc_sway_clk = devm_clk_get(dev, "pcnoc-sway-clk"); - if (IS_ERR(drvdata->pcnoc_sway_clk)) { - dev_err(&pdev->dev, "error getting pcnoc-sway-clk: %ld\n", - PTR_ERR(drvdata->pcnoc_sway_clk)); - return PTR_ERR(drvdata->pcnoc_sway_clk); - } - - ret = clk_prepare_enable(drvdata->pcnoc_sway_clk); + ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); if (ret) { - dev_err(&pdev->dev, "Error enabling pcnoc_sway_clk: %d\n", ret); + dev_err(dev, "ao8016 clk_enable failed\n"); return ret; } @@ -198,8 +191,7 @@ static int apq8016_lpass_exit(struct platform_device *pdev) { struct lpass_data *drvdata = platform_get_drvdata(pdev); - clk_disable_unprepare(drvdata->pcnoc_mport_clk); - clk_disable_unprepare(drvdata->pcnoc_sway_clk); + clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); return 0; } @@ -220,6 +212,11 @@ static int apq8016_lpass_exit(struct platform_device *pdev) .wrdma_reg_stride = 0x1000, .wrdma_channel_start = 5, .wrdma_channels = 2, + .clk_name = (const char*[]) { + "pcnoc-mport-clk", + "pcnoc-sway-clk", + }, + .num_clks = 2, .dai_driver = apq8016_lpass_cpu_dai_driver, .num_dai = ARRAY_SIZE(apq8016_lpass_cpu_dai_driver), .dai_osr_clk_names = (const char *[]) { diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index b729686..279cd02 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -49,9 +49,9 @@ struct lpass_data { /* used it for handling interrupt per dma channel */ struct snd_pcm_substream *substream[LPASS_MAX_DMA_CHANNELS]; - /* 8016 specific */ - struct clk *pcnoc_mport_clk; - struct clk *pcnoc_sway_clk; + /* SOC specific clock list */ + struct clk_bulk_data *clks; + int num_clks; }; @@ -87,6 +87,10 @@ struct lpass_variant { int num_dai; const char * const *dai_osr_clk_names; const char * const *dai_bit_clk_names; + + /* SOC specific clocks configuration */ + const char **clk_name; + int num_clks; }; /* register the platform driver from the CPU DAI driver */ From patchwork Sat Apr 11 08:02:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Pandey X-Patchwork-Id: 193042 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80F10C2BA19 for ; Tue, 14 Apr 2020 07:46:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 096A0206B6 for ; Tue, 14 Apr 2020 07:46:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ggcq8X/Z"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="pZ18SmGR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 096A0206B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6012C1685; Tue, 14 Apr 2020 09:45:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6012C1685 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1586850409; bh=GTY/6od8qqyBypWNBke+awRbTCkmxD1Uaj4Vd7knGSk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ggcq8X/Zd45LRpXGQ6LV71loBxT9yGxZP2oT9jCzGd3iWC1WnmF7+znltenwGrIVg 4s3QsGXB0c2Lmn0zAiQN2epL50lPjYCTVJeh4bt5gzJYvrceVlTr4UpU0xZfV58mDu UqrVVL/ehJnzd1gO1r00vvZtGCc5fbtyT4LwQX/Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 67E23F802A7; Tue, 14 Apr 2020 09:42:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5A2FEF80213; Sat, 11 Apr 2020 10:04:27 +0200 (CEST) Received: from mail26.static.mailgun.info (mail26.static.mailgun.info [104.130.122.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EA75DF801D8 for ; Sat, 11 Apr 2020 10:04:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EA75DF801D8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="pZ18SmGR" DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586592265; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=UvI36xKVTG9KhWdViCLUZ8fjtO3Tz0+ISM05HTaavuQ=; b=pZ18SmGRGnR7U3o05rhiCevzJQo430gKg2dhhZyUp6RAIIxkxz/MHVyQcVQSapwg8q9HAKvd DDYV/jG7zIoiZoEVNACAnKah34BDlTkxOcjzgx+FawWrwPIx3myKdqPEQqbkNKopGx6Bo0cz RzYDIf1DErMehLpIoasfRx2DWvk= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI4ZmE2ZSIsICJhbHNhLWRldmVsQGFsc2EtcHJvamVjdC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e917a04.7f5a977c3d50-smtp-out-n03; Sat, 11 Apr 2020 08:04:20 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7CF3EC4478C; Sat, 11 Apr 2020 08:04:19 +0000 (UTC) Received: from c-ajitp-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ajitp) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3C6D9C433CB; Sat, 11 Apr 2020 08:04:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3C6D9C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=ajitp@codeaurora.org From: Ajit Pandey To: alsa-devel@alsa-project.org, broonie@kernel.org, devicetree@vger.kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, srinivas.kandagatla@linaro.org Subject: [PATCH 06/11] dt-bindings: sound: Add bindings related to lpass-cpu configuration Date: Sat, 11 Apr 2020 13:32:46 +0530 Message-Id: <1586592171-31644-7-git-send-email-ajitp@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> References: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> X-Mailman-Approved-At: Tue, 14 Apr 2020 09:41:46 +0200 Cc: Ajit Pandey , linux-kernel@vger.kernel.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add header defining dts properties related to lpass cpu MI2S dai's. Signed-off-by: Ajit Pandey --- include/dt-bindings/sound/qcom,lpass.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/dt-bindings/sound/qcom,lpass.h diff --git a/include/dt-bindings/sound/qcom,lpass.h b/include/dt-bindings/sound/qcom,lpass.h new file mode 100644 index 00000000..4e6c6bc --- /dev/null +++ b/include/dt-bindings/sound/qcom,lpass.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * + * lpass.h -- DT bindings properties related to LPASS MI2S dai's + */ + +#ifndef _DT_BINDINGS_LPASS_H +#define _DT_BINDINGS_LPASS_H + +/* MI2S dai id */ +#define MI2S_PRIMARY 0 +#define MI2S_SECONDARY 1 +#define MI2S_TERTIARY 2 +#define MI2S_QUATERNARY 3 + +/* MI2S dai's data line mask */ +#define SD0 1 +#define SD1 2 +#define SD2 3 +#define SD3 4 + +/*MI2S dai' loopback mask */ +#define DISABLE 0 +#define ENABLE 1 + +/* MI2S dai's wssrc mask */ +#define INTERNAL 0 +#define EXTERNAL 1 + +#endif /* __DT_BINDINGS_LPASS_H__ */ From patchwork Sat Apr 11 08:02:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Pandey X-Patchwork-Id: 193040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5163C2BA19 for ; Tue, 14 Apr 2020 07:48:57 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3DBBD2074D for ; Tue, 14 Apr 2020 07:48:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="iO65M5oQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="MFiiv7x5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3DBBD2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7FC6D1696; Tue, 14 Apr 2020 09:48:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7FC6D1696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1586850535; bh=+4hsKxtTfGGuoBZKHyH71tYIlzafr/KQZR/SCmrDRYU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iO65M5oQp8jRsSwafV0QouakIAnODBc+vWwftnCMOP2jUnkb8gV6ZNxFgG1GXhqbU lV1f51KtvDqTPoIiXKwlpdcFRHqToM5bFu/wBQcwqLCfuWYBDKpuqPelv8abaTkvow gwbb4QIwQUp2doIoIaXhdnPsdii7kj8sGqqWOq8Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BFB36F802E2; Tue, 14 Apr 2020 09:42:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E8C4F80216; Sat, 11 Apr 2020 10:04:30 +0200 (CEST) Received: from mail27.static.mailgun.info (mail27.static.mailgun.info [104.130.122.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A13BCF800CB for ; Sat, 11 Apr 2020 10:04:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A13BCF800CB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="MFiiv7x5" DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586592268; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=nn24KJxCv5CBH4kdVxNd2V5W0FeWkwt+MwdO1L8CEGs=; b=MFiiv7x5XY9ysb/XhktXocRsy4L7tW+dCRXPaObzgLtLvshyHcQrHUZlcgIDNyDPGV3cX81p Gu8hGmtSNT4uSeiYMvnIXS4dgOT3k4JHPTgdDd7GjvvYg1faOBLdb9D6wnE2P90l4XwgAhET AB2DplJd+2YDqggGreFsR0wMi6k= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI4ZmE2ZSIsICJhbHNhLWRldmVsQGFsc2EtcHJvamVjdC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e917a0a.7f930d4eb420-smtp-out-n04; Sat, 11 Apr 2020 08:04:26 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 69024C44791; Sat, 11 Apr 2020 08:04:25 +0000 (UTC) Received: from c-ajitp-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ajitp) by smtp.codeaurora.org (Postfix) with ESMTPSA id 75C85C43636; Sat, 11 Apr 2020 08:04:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 75C85C43636 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=ajitp@codeaurora.org From: Ajit Pandey To: alsa-devel@alsa-project.org, broonie@kernel.org, devicetree@vger.kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, srinivas.kandagatla@linaro.org Subject: [PATCH 07/11] Documentation: dt-bindings: sound: Add details for new dai properties Date: Sat, 11 Apr 2020 13:32:47 +0530 Message-Id: <1586592171-31644-8-git-send-email-ajitp@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> References: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> X-Mailman-Approved-At: Tue, 14 Apr 2020 09:41:47 +0200 Cc: Ajit Pandey , linux-kernel@vger.kernel.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add changes related to new sub node defining MI2S dai's properties. Such properties needs to be configured via board specific dts files. Signed-off-by: Ajit Pandey --- .../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml index a87a406..727ec03 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml @@ -16,6 +16,8 @@ description: | configure Low-Power Audio Interface(LPAIF) core registers across different IP versions. + See also dt-bindings/sound/qcom,lpass.h. + properties: compatible: enum: @@ -69,6 +71,30 @@ properties: '#sound-dai-cells': const: 1 + dai-name: + - description: Each node represents an MI2S dai and conatins dai specific + properties that may change with board layout & dai connections. + - type: object + - properties: + id: + - description: dai id among one of value defined in header + - type: u32 + qcom,spkmode-mask: + - description: mask defining data lines used for speaker + - type: u32 + qcom,micmode-mask: + - description: mask defining data lines used for mic + - type: u32 + qcom,wssrc-mask: + - description: mask defining word-select source internal/extrnal on dai + - type: u32 + qcom,loopback-mask: + - description: mask defining loopback enable/disable on dai + - type: u32 + + required: + - id + required: - compatible - reg @@ -101,3 +127,10 @@ examples: #sound-dai-cells = <1>; qcom,adsp = <&adsp>; + prim-mi2s@0 { + id = ; + qcom,spkmode-mask = ; + qcom,micmode-mask = ; + qcom,wssrc-mask = ; + qcom,loopback-mask = ; + }; From patchwork Sat Apr 11 08:02:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Pandey X-Patchwork-Id: 193039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D148EC2BA19 for ; Tue, 14 Apr 2020 07:50:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BBE2206D5 for ; Tue, 14 Apr 2020 07:50:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="QXybH3kl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="tn6HNak1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BBE2206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AE29A1696; Tue, 14 Apr 2020 09:49:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AE29A1696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1586850602; bh=Ly6GyzOS21YKoRiNGPxinmTHsrHqHxJEX/JZJ3eqoi8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QXybH3kl5ZvBjapKQVo+/B6XpISp37RJbUXhvuv4dZ8XkStNCOk75H3sdIRHmCsVE EQFZPCseyrkhwYlz2Pzc8Wl2O9qEZHBO6BtM4BccVOAKB6ztxTVf7+3OqthZEzAhtS wlHpJoD1oqXOoEDueIYguOYjyRZcQtsZqxK1LCy0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A5D60F802F9; Tue, 14 Apr 2020 09:42:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 45A18F801DA; Sat, 11 Apr 2020 10:04:40 +0200 (CEST) Received: from mail26.static.mailgun.info (mail26.static.mailgun.info [104.130.122.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D438FF800B9 for ; Sat, 11 Apr 2020 10:04:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D438FF800B9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="tn6HNak1" DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586592278; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=CGSSIIgOQonIzRJ2aP9akavKHcdXJYuY2r+uW6Fff4s=; b=tn6HNak1VPeBxIfTi5dm/ZQ7JNhW2lzLRSxJjY1kccQPQH4tI4LDSVb3kNc8IcpMAyQVRZwK abwLk6r9B1zVFYG11j6LAtgOxVRLNhgbEhMV8SZTm3PazRUtCEATlVmr50HMvUOZI7Q4qMI1 mG6SuuFY9sV7hV2bte7Wd8qJm6U= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI4ZmE2ZSIsICJhbHNhLWRldmVsQGFsc2EtcHJvamVjdC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e917a14.7f0504ab22d0-smtp-out-n05; Sat, 11 Apr 2020 08:04:36 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AEFD3C432C2; Sat, 11 Apr 2020 08:04:35 +0000 (UTC) Received: from c-ajitp-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ajitp) by smtp.codeaurora.org (Postfix) with ESMTPSA id F031EC43636; Sat, 11 Apr 2020 08:04:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F031EC43636 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=ajitp@codeaurora.org From: Ajit Pandey To: alsa-devel@alsa-project.org, broonie@kernel.org, devicetree@vger.kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, srinivas.kandagatla@linaro.org Subject: [PATCH 09/11] device-tree: bindings: sound: lpass-cpu: Add new compatible soc Date: Sat, 11 Apr 2020 13:32:49 +0530 Message-Id: <1586592171-31644-10-git-send-email-ajitp@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> References: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> X-Mailman-Approved-At: Tue, 14 Apr 2020 09:41:47 +0200 Cc: Ajit Pandey , linux-kernel@vger.kernel.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" SC7180 soc varaints of LPASS uses lpass-cpu node but required few extra devictree configuration. Update bindings documents with sc7180 compatible string specific dts properties. Signed-off-by: Ajit Pandey --- .../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml index 727ec03..84bd95c 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml @@ -23,6 +23,7 @@ properties: enum: - qcom,lpass-cpu - qcom,apq8016-lpass-cpu + - qcom,lpass-cpu-sc7180 reg: items: @@ -68,6 +69,14 @@ properties: maxItems: 1 description: Phandle for the audio DSP node + iommus: + maxItems: 1 + description: Phandle to apps_smmu node with sid mask + + power-domains: + maxItems: 1 + description: Phandle for power domain node + '#sound-dai-cells': const: 1 @@ -108,6 +117,17 @@ required: optional: - qcom,adsp +if: + properties: + compatible: + contains: + const: qcom,lpass-cpu-sc7180 + +then: + required: + - iommus + - power-domains + examples: lpass@28100000 { compatible = "qcom,lpass-cpu"; @@ -120,7 +140,10 @@ examples: "mi2s-bit-clk"; interrupts = <0 85 1>; - interrupt-names = "lpass-irq-lpaif"; + interrupt-names = "lpass-irq-lpaif"; + + iommus = <&apps_smmu 0x1020 0>; + power-domains = <&lpass_hm LPASS_CORE_HM_GDSCR>; reg = <0x28100000 0x10000>; reg-names = "lpass-lpaif"; From patchwork Sat Apr 11 08:02:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Pandey X-Patchwork-Id: 193038 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2C94C2BA19 for ; Tue, 14 Apr 2020 07:51:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62124206D5 for ; Tue, 14 Apr 2020 07:51:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Ze5UlwKt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="Oncp7HXG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62124206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C43C51696; Tue, 14 Apr 2020 09:50:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C43C51696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1586850671; bh=tmC+2WB6MdGWl5YPS+WVqv9Gs6/NtV/mFVoqOxl4AxU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ze5UlwKtOe4jISxsmHXx5UVzuaSSKXJvyKtZsS13qGSHBCGuHgZWy77ELpC/aGTCl vATxzqiCxiF/BY3FjilhaF1ZmlPEoE47dYEieZ9fucVK2iZo91gPN/wk9wGBkztKXk mlrsV7yhxja26GfLuJ5RPKsyQSe+/s0qIXtdAofI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 11839F80306; Tue, 14 Apr 2020 09:42:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 39A54F801F9; Sat, 11 Apr 2020 10:04:52 +0200 (CEST) Received: from mail26.static.mailgun.info (mail26.static.mailgun.info [104.130.122.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C2AA8F800B9 for ; Sat, 11 Apr 2020 10:04:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C2AA8F800B9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="Oncp7HXG" DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586592290; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=rrzX+ketE8liRSQeYxzXWxe01TDmOvv8yvmqAlD4FDc=; b=Oncp7HXGaEoFVafsCAF+NhPrRw2MldCBGl9fOJxxs9IqMktX/Oefqxvbgvx0RwYFusVitJZX 33ssUs+3EwENWzEYZSLJXPT8Q0Ihx/ZTWgv5Z7OTrwXLrsZozNKpOQCZEEeCtvWJ4DA6p3Bj zCUpDgSIXOf3u4QohgG6yDXcOKE= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI4ZmE2ZSIsICJhbHNhLWRldmVsQGFsc2EtcHJvamVjdC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e917a1f.7f590b6443b0-smtp-out-n03; Sat, 11 Apr 2020 08:04:47 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 9E882C4478C; Sat, 11 Apr 2020 08:04:46 +0000 (UTC) Received: from c-ajitp-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ajitp) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0A6C2C43637; Sat, 11 Apr 2020 08:04:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0A6C2C43637 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=ajitp@codeaurora.org From: Ajit Pandey To: alsa-devel@alsa-project.org, broonie@kernel.org, devicetree@vger.kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, srinivas.kandagatla@linaro.org Subject: [PATCH 11/11] ASoC: qcom: lpass-platform: Replace card->dev with component->dev Date: Sat, 11 Apr 2020 13:32:51 +0530 Message-Id: <1586592171-31644-12-git-send-email-ajitp@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> References: <1586592171-31644-1-git-send-email-ajitp@codeaurora.org> X-Mailman-Approved-At: Tue, 14 Apr 2020 09:41:47 +0200 Cc: Ajit Pandey , linux-kernel@vger.kernel.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" We are allocating dma memory for component->dev but trying to mmap such memory for substream->pcm->card->dev. Replace device argument in mmap with component->dev to fix this. Signed-off-by: Ajit Pandey --- sound/soc/qcom/lpass-platform.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 821599e..9ab2dd5 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -401,9 +401,8 @@ static int lpass_platform_pcmops_mmap(struct snd_soc_component *component, { struct snd_pcm_runtime *runtime = substream->runtime; - return dma_mmap_coherent(substream->pcm->card->dev, vma, - runtime->dma_area, runtime->dma_addr, - runtime->dma_bytes); + return dma_mmap_coherent(component->dev, vma, runtime->dma_area, + runtime->dma_addr, runtime->dma_bytes); } static irqreturn_t lpass_dma_interrupt_handler(