From patchwork Mon Aug 23 10:48:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452371 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 82573C4338F for ; Mon, 23 Aug 2021 10:52:11 +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 BCAA86136F for ; Mon, 23 Aug 2021 10:52:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BCAA86136F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 5022686F; Mon, 23 Aug 2021 12:51:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5022686F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629715929; bh=zUm1EOg0MxY2uJi9psofE35YET9r8M+vKNX3XtaBhCE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FmVlawsqP10UT8ZQxp9qiFZnPfpt6EEzgJVwKLjOmJuT1PDODTzRPZJh6/ip2aYSb c2oyfESp+FLXp1zY2QyqFUt5BgkYwl+guXIn+gCo3tJJOwoLhcj86BvbieTz5tVxfz DfsB0m/gssIIyoUTu41pnAqbLl/t/WnrXf1iHvVw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1D2FBF804F2; Mon, 23 Aug 2021 12:49:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 34CB7F804EC; Mon, 23 Aug 2021 12:49:45 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.132]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A8AA3F80430 for ; Mon, 23 Aug 2021 12:49:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A8AA3F80430 Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id ED1D8FB5D6; Mon, 23 Aug 2021 18:49:33 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P32763T139760957703936S1629715760494266_; Mon, 23 Aug 2021 18:49:24 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 10 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH v1 01/15] ASoC: rockchip: i2s: Add support for set bclk ratio Date: Mon, 23 Aug 2021 18:48:15 +0800 Message-Id: <1629715710-21137-2-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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" This patch adds support for set bclk ratio from machine driver. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index c7dc350..c9d5c52 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -49,6 +49,7 @@ struct rk_i2s_dev { bool rx_start; bool is_master_mode; const struct rk_i2s_pins *pins; + unsigned int bclk_ratio; }; static int i2s_runtime_suspend(struct device *dev) @@ -278,7 +279,7 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, if (i2s->is_master_mode) { mclk_rate = clk_get_rate(i2s->mclk); - bclk_rate = 2 * 32 * params_rate(params); + bclk_rate = i2s->bclk_ratio * params_rate(params); if (bclk_rate == 0 || mclk_rate % bclk_rate) return -EINVAL; @@ -413,6 +414,16 @@ static int rockchip_i2s_trigger(struct snd_pcm_substream *substream, return ret; } +static int rockchip_i2s_set_bclk_ratio(struct snd_soc_dai *dai, + unsigned int ratio) +{ + struct rk_i2s_dev *i2s = to_info(dai); + + i2s->bclk_ratio = ratio; + + return 0; +} + static int rockchip_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, int clk_id, unsigned int freq, int dir) { @@ -441,6 +452,7 @@ static int rockchip_i2s_dai_probe(struct snd_soc_dai *dai) static const struct snd_soc_dai_ops rockchip_i2s_dai_ops = { .hw_params = rockchip_i2s_hw_params, + .set_bclk_ratio = rockchip_i2s_set_bclk_ratio, .set_sysclk = rockchip_i2s_set_sysclk, .set_fmt = rockchip_i2s_set_fmt, .trigger = rockchip_i2s_trigger, @@ -638,6 +650,8 @@ static int rockchip_i2s_probe(struct platform_device *pdev) i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; i2s->capture_dma_data.maxburst = 4; + i2s->bclk_ratio = 64; + dev_set_drvdata(&pdev->dev, i2s); pm_runtime_enable(&pdev->dev); From patchwork Mon Aug 23 10:48:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452365 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 78808C4338F for ; Mon, 23 Aug 2021 10:51:08 +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 A7F8F6136F for ; Mon, 23 Aug 2021 10:51:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A7F8F6136F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 E426F15DC; Mon, 23 Aug 2021 12:50:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E426F15DC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629715866; bh=eGjMyhszweZsejR+hAy3m2tq4y9b7yZNPruQSBakDxE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Fd8gAE60s4OdEZ2zjQb0frFJg4rV0I74nJUKYLDyo1G7KFqKtxgCSpJ1RJLmB6Zfd I8wTNjFM6RiwKERs2C5QtmzP79e62/10Mbx045Dqv8YylO5V8lDkACRFKXO4t2/cG9 siqcymEnqjFduBY1khu4pzRT3sOXnPbFs3QNJhqg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1B994F8020C; Mon, 23 Aug 2021 12:49:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2A6D8F80431; Mon, 23 Aug 2021 12:49:38 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.131]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CE492F8016E for ; Mon, 23 Aug 2021 12:49:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CE492F8016E Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id F199AC29AB; Mon, 23 Aug 2021 18:49:24 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P32763T139760957703936S1629715760494266_; Mon, 23 Aug 2021 18:49:25 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 10 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH v1 02/15] ASoC: rockchip: i2s: Fixup clk div error Date: Mon, 23 Aug 2021 18:48:16 +0800 Message-Id: <1629715710-21137-3-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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" MCLK maybe not precise as required because of PLL, but which still can be used and no side effect. so, using DIV_ROUND_CLOSEST instead div. e.g. set mclk to 11289600 Hz, but get 11289598 Hz. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index c9d5c52..05fce2c 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -280,10 +280,10 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, if (i2s->is_master_mode) { mclk_rate = clk_get_rate(i2s->mclk); bclk_rate = i2s->bclk_ratio * params_rate(params); - if (bclk_rate == 0 || mclk_rate % bclk_rate) + if (!bclk_rate) return -EINVAL; - div_bclk = mclk_rate / bclk_rate; + div_bclk = DIV_ROUND_CLOSEST(mclk_rate, bclk_rate); div_lrck = bclk_rate / params_rate(params); regmap_update_bits(i2s->regmap, I2S_CKR, I2S_CKR_MDIV_MASK, From patchwork Mon Aug 23 10:48:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452367 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 C3A69C4338F for ; Mon, 23 Aug 2021 10:51:22 +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 4C2D060F4C for ; Mon, 23 Aug 2021 10:51:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4C2D060F4C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 695351658; Mon, 23 Aug 2021 12:50:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 695351658 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629715880; bh=iL+6jtKIyPZBae727d+wEUHISL1KJHkVNnGVzCMjhh8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DjqLqX4t+hpFh0INgdAvzXyAVV6jCijuTMrUFujr4G2tGKhifwEpHvohjBhZhRMlU ICU+3XAeZbUD3pzjhlPKa9foQE6StodUsGT4ul1N0+dSfdY7eMYBrS/9+NIB1Qnj1y MHjsGbvi2Zh796hTu0E4+7YZwpeVF+8NFK77sZtI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0DCF9F804E6; Mon, 23 Aug 2021 12:49:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7DBFF80431; Mon, 23 Aug 2021 12:49:39 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.131]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 826D0F8020C for ; Mon, 23 Aug 2021 12:49:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 826D0F8020C Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id 0D14CC2A58; Mon, 23 Aug 2021 18:49:26 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P32763T139760957703936S1629715760494266_; Mon, 23 Aug 2021 18:49:26 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 10 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH v1 03/15] ASoC: rockchip: i2s: Improve dma data transfer efficiency Date: Mon, 23 Aug 2021 18:48:17 +0800 Message-Id: <1629715710-21137-4-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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" This patch changes dma data burst from 4 to 8 to improve data transfer efficiency. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 05fce2c..2e0047d 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -644,11 +644,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev) i2s->playback_dma_data.addr = res->start + I2S_TXDR; i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - i2s->playback_dma_data.maxburst = 4; + i2s->playback_dma_data.maxburst = 8; i2s->capture_dma_data.addr = res->start + I2S_RXDR; i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - i2s->capture_dma_data.maxburst = 4; + i2s->capture_dma_data.maxburst = 8; i2s->bclk_ratio = 64; From patchwork Mon Aug 23 10:48:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452369 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=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, 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 2B0F8C4338F for ; Mon, 23 Aug 2021 10:51:44 +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 9F44C6136F for ; Mon, 23 Aug 2021 10:51:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F44C6136F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 3AE2D84A; Mon, 23 Aug 2021 12:50:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3AE2D84A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629715902; bh=4SVfO3HmcS1s+YzpJ2Qq68dPOk7ES9cibvhw0CDjhaE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sf1RswSv3OUxUBsw13Y9QBBuRSNp9/sgR0zAV6R8BHOgM0wIcF0rnBKesfsH2LI+M Fq1y/fUupvutp09kqAhgjzbuveAVFbD9/uokc7mCsPBgrhBPQqSREx9rsq8VF68fuo uWDd+JEhKUAhg/rAw86YmrHsA2FIKGkzNiBn/hEU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 91CE6F80430; Mon, 23 Aug 2021 12:49:45 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D83F8F804ED; Mon, 23 Aug 2021 12:49:43 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.135]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1DBD0F80217 for ; Mon, 23 Aug 2021 12:49:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1DBD0F80217 Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id ECAB3B2FDF; Mon, 23 Aug 2021 18:49:25 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P32763T139760957703936S1629715760494266_; Mon, 23 Aug 2021 18:49:26 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 10 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH v1 04/15] ASoC: rockchip: i2s: Fix regmap_ops hang Date: Mon, 23 Aug 2021 18:48:18 +0800 Message-Id: <1629715710-21137-5-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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" API 'set_fmt' maybe called when PD is off, in the situation, any register access will hang the system. so, enable PD before r/w register. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 2e0047d..90877e8 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -187,7 +187,9 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, { struct rk_i2s_dev *i2s = to_info(cpu_dai); unsigned int mask = 0, val = 0; + int ret = 0; + pm_runtime_get_sync(cpu_dai->dev); mask = I2S_CKR_MSS_MASK; switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBS_CFS: @@ -200,7 +202,8 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, i2s->is_master_mode = false; break; default: - return -EINVAL; + ret = -EINVAL; + goto err_pm_put; } regmap_update_bits(i2s->regmap, I2S_CKR, mask, val); @@ -214,7 +217,8 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, val = I2S_CKR_CKP_POS; break; default: - return -EINVAL; + ret = -EINVAL; + goto err_pm_put; } regmap_update_bits(i2s->regmap, I2S_CKR, mask, val); @@ -237,7 +241,8 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, val = I2S_TXCR_TFS_PCM | I2S_TXCR_PBM_MODE(1); break; default: - return -EINVAL; + ret = -EINVAL; + goto err_pm_put; } regmap_update_bits(i2s->regmap, I2S_TXCR, mask, val); @@ -260,12 +265,16 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, val = I2S_RXCR_TFS_PCM | I2S_RXCR_PBM_MODE(1); break; default: - return -EINVAL; + ret = -EINVAL; + goto err_pm_put; } regmap_update_bits(i2s->regmap, I2S_RXCR, mask, val); - return 0; +err_pm_put: + pm_runtime_put(cpu_dai->dev); + + return ret; } static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, From patchwork Mon Aug 23 10:53:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452387 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=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, 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 97FB7C4320A for ; Mon, 23 Aug 2021 10:54:56 +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 231656137F for ; Mon, 23 Aug 2021 10:54:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 231656137F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 BB32715E5; Mon, 23 Aug 2021 12:54:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BB32715E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716094; bh=rTgsMQMwExilhNb/5H8nlkhU3YvXi9RLpk2ZCbXbG8Q=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KBk4KAwIsottkK+6nDvKW2P2Uq/vx44UEJzIOBOA56HbLsQZFVwC7bsXnbv0qxSXD p7YWkP0xx6tTcKSoWnt9GoNMINlxs96qU1yHE3dkH87tmhEVQe/sYBSUDa3jEwPTzu GzErdwCQo0oWxDMJrm4XJnwYCVdZ4FxfJugRAyAI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8C349F80424; Mon, 23 Aug 2021 12:53:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E5365F80240; Mon, 23 Aug 2021 12:53:25 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.134]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 879A3F800B6 for ; Mon, 23 Aug 2021 12:53:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 879A3F800B6 Received: from localhost (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id 2AAADCFC99; Mon, 23 Aug 2021 18:53:13 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P22031T140205908551424S1629715992162978_; Mon, 23 Aug 2021 18:53:13 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 05/15] ASoC: rockchip: i2s: Fix concurrency between tx/rx Date: Mon, 23 Aug 2021 18:53:00 +0800 Message-Id: <1629715990-21372-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch adds lock to fix comcurrency between tx/rx to fix 'rockchip-i2s ff070000.i2s; fail to clear' Considering the situation; tx stream rx stream | | | disable enable | | reset After this patch: lock | tx stream | enable | unlock -------- --------- lock | rx stream | disable | reset | unlock Change-Id: Ia156144490a61f4fa9823b1313588e44688f4bce Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index dfa0a5e..b8e35a9 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -52,6 +53,9 @@ struct rk_i2s_dev { unsigned int bclk_ratio; }; +/* tx/rx ctrl lock */ +static DEFINE_SPINLOCK(lock); + static int i2s_runtime_suspend(struct device *dev) { struct rk_i2s_dev *i2s = dev_get_drvdata(dev); @@ -93,6 +97,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) unsigned int val = 0; int retry = 10; + spin_lock(&lock); if (on) { regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_TDE_ENABLE, I2S_DMACR_TDE_ENABLE); @@ -133,6 +138,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) } } } + spin_unlock(&lock); } static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) @@ -140,6 +146,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) unsigned int val = 0; int retry = 10; + spin_lock(&lock); if (on) { regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_RDE_ENABLE, I2S_DMACR_RDE_ENABLE); @@ -180,6 +187,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) } } } + spin_unlock(&lock); } static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, From patchwork Mon Aug 23 10:53:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452373 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=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, 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 560A9C4338F for ; Mon, 23 Aug 2021 10:54:19 +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 C13056137F for ; Mon, 23 Aug 2021 10:54:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C13056137F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 5EA9E84A; Mon, 23 Aug 2021 12:53:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5EA9E84A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716057; bh=dJDLORAYlSbLl65uw3NSpmdV2TE5AX00LZK9tRf547U=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GYWk9Cr5rjBF20QOwegc5whXLTim3uEBV4ZiuCZzQF1Do2rsJcx5AVKahNdDvR3UQ FyFvOATJidz0Fue5CL70+eMRXWqqNXtnuEtr41Rf2ioEzih35lgCiyeKtQVBfAesZv XzzcGCcPgaUWZMMOZdvf0GTMskK55Woiyk8Onjkk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EDAB5F8020C; Mon, 23 Aug 2021 12:53:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5AFC1F80424; Mon, 23 Aug 2021 12:53:24 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.132]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1FB4BF8016E for ; Mon, 23 Aug 2021 12:53:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1FB4BF8016E Received: from localhost (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id 24369FB68B; Mon, 23 Aug 2021 18:53:14 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P22031T140205908551424S1629715992162978_; Mon, 23 Aug 2021 18:53:13 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 06/15] ASoC: rockchip: i2s: Reset the controller if soft reset failed Date: Mon, 23 Aug 2021 18:53:01 +0800 Message-Id: <1629715990-21372-2-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch brings i2s back to normal by resetting i2s m/h when the soft reset failed. Change-Id: I2fd47039b522ac89499b4a2912d5ffb7a469e75e Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index b8e35a9..a91f874d 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,8 @@ struct rk_i2s_dev { struct regmap *regmap; struct regmap *grf; + struct reset_control *reset_m; + struct reset_control *reset_h; /* * Used to indicate the tx/rx status. @@ -92,6 +95,20 @@ static inline struct rk_i2s_dev *to_info(struct snd_soc_dai *dai) return snd_soc_dai_get_drvdata(dai); } +static void rockchip_i2s_reset(struct rk_i2s_dev *i2s) +{ + dev_warn(i2s->dev, "Reset controller.\n"); + + reset_control_assert(i2s->reset_m); + reset_control_assert(i2s->reset_h); + udelay(1); + reset_control_deassert(i2s->reset_m); + reset_control_deassert(i2s->reset_h); + + regcache_mark_dirty(i2s->regmap); + regcache_sync(i2s->regmap); +} + static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) { unsigned int val = 0; @@ -132,7 +149,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) regmap_read(i2s->regmap, I2S_CLR, &val); retry--; if (!retry) { - dev_warn(i2s->dev, "fail to clear\n"); + rockchip_i2s_reset(i2s); break; } } @@ -181,7 +198,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) regmap_read(i2s->regmap, I2S_CLR, &val); retry--; if (!retry) { - dev_warn(i2s->dev, "fail to clear\n"); + rockchip_i2s_reset(i2s); break; } } @@ -629,6 +646,14 @@ static int rockchip_i2s_probe(struct platform_device *pdev) i2s->pins = of_id->data; } + i2s->reset_m = devm_reset_control_get_optional(&pdev->dev, "reset-m"); + if (IS_ERR(i2s->reset_m)) + return PTR_ERR(i2s->reset_m); + + i2s->reset_h = devm_reset_control_get_optional(&pdev->dev, "reset-h"); + if (IS_ERR(i2s->reset_h)) + return PTR_ERR(i2s->reset_h); + /* try to prepare related clocks */ i2s->hclk = devm_clk_get(&pdev->dev, "i2s_hclk"); if (IS_ERR(i2s->hclk)) { From patchwork Mon Aug 23 10:53:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452391 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 4795BC4338F for ; Mon, 23 Aug 2021 10:55:24 +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 AD7206138B for ; Mon, 23 Aug 2021 10:55:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AD7206138B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 40452851; Mon, 23 Aug 2021 12:54:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 40452851 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716122; bh=gHWltNSJMJTJMbAVsPA4auVYqGcTY4XXOcSpM9rPorg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=isftypbAs+FYKYxyDTT69wb56LnDHdO3AfE2lngxD3f+T+aniaaQhqwRfuUhilvgH MWSPTfrsVR9vTYqvQjEqMPXdfKeAs5P6YKcVWqIxdkv0Ly/N65SbjT7sR+4+1Amq8a h9ze/AMzmV/9bZ1uO+KlHBpmMrcoAm6ygEbDAQwI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8026CF804F1; Mon, 23 Aug 2021 12:53:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BB0E9F804F2; Mon, 23 Aug 2021 12:53:30 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.132]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D2265F80229 for ; Mon, 23 Aug 2021 12:53:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D2265F80229 Received: from localhost (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id 4095EFB6AB; Mon, 23 Aug 2021 18:53:14 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P22031T140205908551424S1629715992162978_; Mon, 23 Aug 2021 18:53:14 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <2af52c7c577ea47b6900241cd22863f2> X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 07/15] ASoC: dt-bindings: rockchip: Document reset property for i2s Date: Mon, 23 Aug 2021 18:53:02 +0800 Message-Id: <1629715990-21372-3-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch documents reset property for i2s. Signed-off-by: Sugar Zhang Change-Id: Idaaaa0583ddf2254589ab465766322f210db58a7 --- Documentation/devicetree/bindings/sound/rockchip-i2s.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml index 245895b..9f9cc48 100644 --- a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml @@ -61,6 +61,14 @@ properties: power-domains: maxItems: 1 + reset-names: + items: + - const: reset-m + - const: reset-h + + resets: + maxItems: 2 + rockchip,capture-channels: $ref: /schemas/types.yaml#/definitions/uint32 default: 2 From patchwork Mon Aug 23 10:53:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452393 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 ECD9AC4338F for ; Mon, 23 Aug 2021 10:55: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 C9FFD608FE for ; Mon, 23 Aug 2021 10:55:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C9FFD608FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 6D7901658; Mon, 23 Aug 2021 12:55:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6D7901658 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716155; bh=7C2s01tuJIgnW59/fuyzV2T2i2DEcWQtutfCsntC8ls=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kp+BihBwqRkL2tfh8JWFvGDAwDxzBotslXB1uID1yyyw8HmarBbpqUUc5RIpK4my4 wKIuZU3Jz0eBjZMXk86vLtsVUQLbw5ZyXYdI6GodMWrHslO7VqNi70K4sxRvH2DttZ f+9CQXFAHHKfR7Q3+gemXshGo7OmOjCQKN/thfFU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 340BCF804F2; Mon, 23 Aug 2021 12:53:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C8833F80217; Mon, 23 Aug 2021 12:53:30 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.131]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B404EF80217 for ; Mon, 23 Aug 2021 12:53:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B404EF80217 Received: from localhost (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id 46BA0C2A50; Mon, 23 Aug 2021 18:53:15 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P22031T140205908551424S1629715992162978_; Mon, 23 Aug 2021 18:53:14 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 7 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 08/15] ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B Date: Mon, 23 Aug 2021 18:53:03 +0800 Message-Id: <1629715990-21372-4-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, Xiaotan Luo , devicetree@vger.kernel.org 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" From: Xiaotan Luo - DSP_A: PCM delay 1 bit mode, L data MSB after FRM LRC - DSP_B: PCM no delay mode, L data MSB during FRM LRC Change-Id: I198519c431815de3ca1fc154da78773ca705f0e0 Signed-off-by: Xiaotan Luo Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index a91f874d..8a432ae 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -259,12 +259,12 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, case SND_SOC_DAIFMT_I2S: val = I2S_TXCR_IBM_NORMAL; break; - case SND_SOC_DAIFMT_DSP_A: /* PCM no delay mode */ - val = I2S_TXCR_TFS_PCM; - break; - case SND_SOC_DAIFMT_DSP_B: /* PCM delay 1 mode */ + case SND_SOC_DAIFMT_DSP_A: /* PCM delay 1 bit mode */ val = I2S_TXCR_TFS_PCM | I2S_TXCR_PBM_MODE(1); break; + case SND_SOC_DAIFMT_DSP_B: /* PCM no delay mode */ + val = I2S_TXCR_TFS_PCM; + break; default: ret = -EINVAL; goto err_pm_put; @@ -283,12 +283,12 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, case SND_SOC_DAIFMT_I2S: val = I2S_RXCR_IBM_NORMAL; break; - case SND_SOC_DAIFMT_DSP_A: /* PCM no delay mode */ - val = I2S_RXCR_TFS_PCM; - break; - case SND_SOC_DAIFMT_DSP_B: /* PCM delay 1 mode */ + case SND_SOC_DAIFMT_DSP_A: /* PCM delay 1 bit mode */ val = I2S_RXCR_TFS_PCM | I2S_RXCR_PBM_MODE(1); break; + case SND_SOC_DAIFMT_DSP_B: /* PCM no delay mode */ + val = I2S_RXCR_TFS_PCM; + break; default: ret = -EINVAL; goto err_pm_put; From patchwork Mon Aug 23 10:53:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452389 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 A7A0EC4338F for ; Mon, 23 Aug 2021 10:55:12 +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 359B16135F for ; Mon, 23 Aug 2021 10:55:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 359B16135F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 A4EBA1662; Mon, 23 Aug 2021 12:54:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A4EBA1662 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716110; bh=djH4chU8MtySjlTcVXRmGQKZ8BYfqqRqG9TEZ+6w1ao=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=epQHRoPiRjzpq+EOagALwwcnhG1A2EPOhP2MqyXx6Jyj4naR9XXTCze20/91rNwMH R2/uUE3lyEg9YZm5vHMikg0RQucV2mDXbUkVScjfd4LR5GyXcbJO+yEq4EeVdAqqXr BBD/Jjvj18BJh5nmoxLY4bEdS2k5xE9kUd8f+4E0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7AEA2F804EC; Mon, 23 Aug 2021 12:53:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 048C3F804E7; Mon, 23 Aug 2021 12:53:29 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.132]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7B5EBF80430 for ; Mon, 23 Aug 2021 12:53:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7B5EBF80430 Received: from localhost (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id 89B59FB6AB; Mon, 23 Aug 2021 18:53:21 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P22031T140205908551424S1629715992162978_; Mon, 23 Aug 2021 18:53:15 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 09/15] ASoC: rockchip: i2s: Add property to specify play/cap capability Date: Mon, 23 Aug 2021 18:53:04 +0800 Message-Id: <1629715990-21372-5-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" - 'rockchip,playback-only': support playback only. - 'rockchip,capture-only': support capture only. Signed-off-by: Sugar Zhang Change-Id: Ie022214de4e42bba5ba898ea39a4e39807e8d4ab --- sound/soc/rockchip/rockchip_i2s.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 8a432ae..cedfe47 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -721,6 +721,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev) soc_dai->capture.channels_max = val; } + if (of_property_read_bool(node, "rockchip,playback-only")) + soc_dai->capture.channels_min = 0; + else if (of_property_read_bool(node, "rockchip,capture-only")) + soc_dai->playback.channels_min = 0; + ret = devm_snd_soc_register_component(&pdev->dev, &rockchip_i2s_component, soc_dai, 1); From patchwork Mon Aug 23 10:54:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452397 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 24E43C4338F for ; Mon, 23 Aug 2021 10:56:38 +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 5171B61186 for ; Mon, 23 Aug 2021 10:56:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5171B61186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 E580785D; Mon, 23 Aug 2021 12:55:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E580785D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716196; bh=5tfLMz1HYG+HI7IvjvJ6mAmPAty8sELYQqkyM8Nlr8o=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lfD5NKPEfiHL4bDmLk7NhXVEB9M4OQhCNavLaIAacw7GYDR+0XeDVhQWfR7a++b/3 PRD7qVCtFPo/GQ06RBQjeF7+JuionEFew0ZZR5ywqFylUKRxlgzo2zk/TaDuiIPjUV 2NbaZdUuJTTKpJmWu8uJZPzrgDZyC8ufDdzqLggI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3D6EAF804FF; Mon, 23 Aug 2021 12:54:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65B66F80431; Mon, 23 Aug 2021 12:54:49 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.130]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 29A20F80240 for ; Mon, 23 Aug 2021 12:54:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29A20F80240 Received: from localhost (unknown [192.168.167.225]) by lucky1.263xmail.com (Postfix) with ESMTP id B3BAED777E; Mon, 23 Aug 2021 18:54:38 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P10596T140297356953344S1629716077595046_; Mon, 23 Aug 2021 18:54:38 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 10/15] ASoC: dt-bindings: rockchip: i2s: Document property for playback/capture Date: Mon, 23 Aug 2021 18:54:31 +0800 Message-Id: <1629716076-21465-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch documents property for playback-only and capture-only. Signed-off-by: Sugar Zhang Change-Id: I06a38e0e9fb8c4386cda3e5f6bc974a68180a426 --- Documentation/devicetree/bindings/sound/rockchip-i2s.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml index 9f9cc48..005b6e6 100644 --- a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml @@ -81,6 +81,16 @@ properties: description: Max playback channels, if not set, 8 channels default. + rockchip,capture-only: + type: boolean + description: + Specify that the controller has capture only capability. + + rockchip,playback-only: + type: boolean + description: + Specify that the controller has playback only capability. + rockchip,grf: $ref: /schemas/types.yaml#/definitions/phandle description: From patchwork Mon Aug 23 10:54:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452395 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 AF5EEC4338F for ; Mon, 23 Aug 2021 10:56:11 +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 D41B961186 for ; Mon, 23 Aug 2021 10:56:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D41B961186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 6E47C167A; Mon, 23 Aug 2021 12:55:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6E47C167A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716169; bh=F1v0KJqe1miw68YlrI9px6GhghiX/DEPC6wu4gzLQAE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KbxsSNCRsZcFXNH5ntZe5AcXs6eVdfBsS6pbwYqrPNsvQ8aL3CM8J+ng0Zh8tOqsM kDOdToDoB1JOZED7eQzbWKraMFx71mMvPCY/wqY/DNNh47xcFize3zIfDyB0cPpZ5e ggcn97geLJRRYYk03z8kD3pBqpXu5f1Ba1Wd5gRw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9CAB8F80431; Mon, 23 Aug 2021 12:54:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BFFB7F804E6; Mon, 23 Aug 2021 12:54:48 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.132]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 602CCF8020C for ; Mon, 23 Aug 2021 12:54:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 602CCF8020C Received: from localhost (unknown [192.168.167.225]) by lucky1.263xmail.com (Postfix) with ESMTP id F36DBFB5F6; Mon, 23 Aug 2021 18:54:38 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P10596T140297356953344S1629716077595046_; Mon, 23 Aug 2021 18:54:39 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <7744b2575fba8ab9f2f9be421384bba5> X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 11/15] ASoC: rockchip: i2s: Add compatible for more SoCs Date: Mon, 23 Aug 2021 18:54:32 +0800 Message-Id: <1629716076-21465-2-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch adds more compatible strings for SoCs. Signed-off-by: Sugar Zhang Change-Id: I980a7c34a7f6c82a066a37e7f97fa4e69cbae583 --- sound/soc/rockchip/rockchip_i2s.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index cedfe47..a0f2778 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -613,10 +613,20 @@ static const struct rk_i2s_pins rk3399_i2s_pins = { }; static const struct of_device_id rockchip_i2s_match[] __maybe_unused = { + { .compatible = "rockchip,px30-i2s", }, + { .compatible = "rockchip,rk1808-i2s", }, + { .compatible = "rockchip,rk3036-i2s", }, { .compatible = "rockchip,rk3066-i2s", }, + { .compatible = "rockchip,rk3128-i2s", }, { .compatible = "rockchip,rk3188-i2s", }, + { .compatible = "rockchip,rk3228-i2s", }, { .compatible = "rockchip,rk3288-i2s", }, + { .compatible = "rockchip,rk3308-i2s", }, + { .compatible = "rockchip,rk3328-i2s", }, + { .compatible = "rockchip,rk3366-i2s", }, + { .compatible = "rockchip,rk3368-i2s", }, { .compatible = "rockchip,rk3399-i2s", .data = &rk3399_i2s_pins }, + { .compatible = "rockchip,rv1126-i2s", }, {}, }; From patchwork Mon Aug 23 10:54:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452401 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 E9F32C4338F for ; Mon, 23 Aug 2021 10:57:12 +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 2FCFB61186 for ; Mon, 23 Aug 2021 10:57:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2FCFB61186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 ABC42166F; Mon, 23 Aug 2021 12:56:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz ABC42166F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716230; bh=hFFJFye5Q0MdgLl7LPD9IpqQWOtILyF14BdDLmTihL4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=f4MV3dJlfYetMlsNiQ4x9yXO39LHBC/SzGmzAdU+EGVBbKhM7++dOUCp3R8mEk8+G QnW+qjP7XbRLgFhfDgp9ofmTM50Cfhyr9aCcHzEjVYQP+OwCVzzNHx7dCwibNjqG4e OnSJ96EkMCADKQMr39uKcGDtP2++6XCFbMbHU/ec= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 975BFF80510; Mon, 23 Aug 2021 12:54:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9D101F8050F; Mon, 23 Aug 2021 12:54:54 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.131]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2AFDFF800B6 for ; Mon, 23 Aug 2021 12:54:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2AFDFF800B6 Received: from localhost (unknown [192.168.167.225]) by lucky1.263xmail.com (Postfix) with ESMTP id B2D74C2960; Mon, 23 Aug 2021 18:54:39 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P10596T140297356953344S1629716077595046_; Mon, 23 Aug 2021 18:54:39 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <4dc6fe9b0e9db139991f7079a2cfe765> X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 12/15] ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs Date: Mon, 23 Aug 2021 18:54:33 +0800 Message-Id: <1629716076-21465-3-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch adds compatible strings for more SoCs. Signed-off-by: Sugar Zhang Change-Id: Id1f32a4518c01e0d50c5702a557912e165904995 --- Documentation/devicetree/bindings/sound/rockchip-i2s.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml index 005b6e6..11e911a 100644 --- a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml @@ -20,7 +20,9 @@ properties: - items: - enum: - rockchip,px30-i2s + - rockchip,rk1808-i2s - rockchip,rk3036-i2s + - rockchip,rk3128-i2s - rockchip,rk3188-i2s - rockchip,rk3228-i2s - rockchip,rk3288-i2s @@ -29,6 +31,7 @@ properties: - rockchip,rk3366-i2s - rockchip,rk3368-i2s - rockchip,rk3399-i2s + - rockchip,rv1126-i2s - const: rockchip,rk3066-i2s reg: From patchwork Mon Aug 23 10:54:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452403 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 40382C4338F for ; Mon, 23 Aug 2021 10:57:33 +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 57BDD61186 for ; Mon, 23 Aug 2021 10:57:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 57BDD61186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 CFE2F1677; Mon, 23 Aug 2021 12:56:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CFE2F1677 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716250; bh=YRTd6krr8RQ+NyDwXHRRo0tJId+rbFXN2ybOtyD9aHA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iTp8gZhuytJc6Sf36OdEZHY/LdEE0UzpyQU4zon78KwmYZ5JocVXt1q44orUb9gHO GlJSrqsz/Uie/2uhK3Cz+jP2F1KWmxpr1/wm8IzMw3SGwThBSQBVcxt11IR1gymCSN 2/tvcp1MZBCKMMzN8kynk/TNyor/vKTOQ6JqwfwI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1E53CF80517; Mon, 23 Aug 2021 12:55:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 69A52F80424; Mon, 23 Aug 2021 12:54:55 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.132]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6839BF80240 for ; Mon, 23 Aug 2021 12:54:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6839BF80240 Received: from localhost (unknown [192.168.167.225]) by lucky1.263xmail.com (Postfix) with ESMTP id 1E70EFB689; Mon, 23 Aug 2021 18:54:45 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P10596T140297356953344S1629716077595046_; Mon, 23 Aug 2021 18:54:39 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <7521e69a4dbeb53b84cf502e8c7b8d39> X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 13/15] ASoC: rockchip: i2s: Add support for frame inversion Date: Mon, 23 Aug 2021 18:54:34 +0800 Message-Id: <1629716076-21465-4-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch adds support for frame inversion. Change-Id: Ic77122501224cec45200ae64416745a82fb67d76 Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 20 +++++++++++++++++--- sound/soc/rockchip/rockchip_i2s.h | 10 ++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index a0f2778..6ccb62e 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -233,13 +233,27 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, regmap_update_bits(i2s->regmap, I2S_CKR, mask, val); - mask = I2S_CKR_CKP_MASK; + mask = I2S_CKR_CKP_MASK | I2S_CKR_TLP_MASK | I2S_CKR_RLP_MASK; switch (fmt & SND_SOC_DAIFMT_INV_MASK) { case SND_SOC_DAIFMT_NB_NF: - val = I2S_CKR_CKP_NEG; + val = I2S_CKR_CKP_NORMAL | + I2S_CKR_TLP_NORMAL | + I2S_CKR_RLP_NORMAL; + break; + case SND_SOC_DAIFMT_NB_IF: + val = I2S_CKR_CKP_NORMAL | + I2S_CKR_TLP_INVERTED | + I2S_CKR_RLP_INVERTED; break; case SND_SOC_DAIFMT_IB_NF: - val = I2S_CKR_CKP_POS; + val = I2S_CKR_CKP_INVERTED | + I2S_CKR_TLP_NORMAL | + I2S_CKR_RLP_NORMAL; + break; + case SND_SOC_DAIFMT_IB_IF: + val = I2S_CKR_CKP_INVERTED | + I2S_CKR_TLP_INVERTED | + I2S_CKR_RLP_INVERTED; break; default: ret = -EINVAL; diff --git a/sound/soc/rockchip/rockchip_i2s.h b/sound/soc/rockchip/rockchip_i2s.h index fcaae24..251851b 100644 --- a/sound/soc/rockchip/rockchip_i2s.h +++ b/sound/soc/rockchip/rockchip_i2s.h @@ -88,15 +88,17 @@ #define I2S_CKR_MSS_SLAVE (1 << I2S_CKR_MSS_SHIFT) #define I2S_CKR_MSS_MASK (1 << I2S_CKR_MSS_SHIFT) #define I2S_CKR_CKP_SHIFT 26 -#define I2S_CKR_CKP_NEG (0 << I2S_CKR_CKP_SHIFT) -#define I2S_CKR_CKP_POS (1 << I2S_CKR_CKP_SHIFT) +#define I2S_CKR_CKP_NORMAL (0 << I2S_CKR_CKP_SHIFT) +#define I2S_CKR_CKP_INVERTED (1 << I2S_CKR_CKP_SHIFT) #define I2S_CKR_CKP_MASK (1 << I2S_CKR_CKP_SHIFT) #define I2S_CKR_RLP_SHIFT 25 #define I2S_CKR_RLP_NORMAL (0 << I2S_CKR_RLP_SHIFT) -#define I2S_CKR_RLP_OPPSITE (1 << I2S_CKR_RLP_SHIFT) +#define I2S_CKR_RLP_INVERTED (1 << I2S_CKR_RLP_SHIFT) +#define I2S_CKR_RLP_MASK (1 << I2S_CKR_RLP_SHIFT) #define I2S_CKR_TLP_SHIFT 24 #define I2S_CKR_TLP_NORMAL (0 << I2S_CKR_TLP_SHIFT) -#define I2S_CKR_TLP_OPPSITE (1 << I2S_CKR_TLP_SHIFT) +#define I2S_CKR_TLP_INVERTED (1 << I2S_CKR_TLP_SHIFT) +#define I2S_CKR_TLP_MASK (1 << I2S_CKR_TLP_SHIFT) #define I2S_CKR_MDIV_SHIFT 16 #define I2S_CKR_MDIV(x) ((x - 1) << I2S_CKR_MDIV_SHIFT) #define I2S_CKR_MDIV_MASK (0xff << I2S_CKR_MDIV_SHIFT) From patchwork Mon Aug 23 10:54:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452399 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 3F570C4338F for ; Mon, 23 Aug 2021 10:56:53 +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 427D86138B for ; Mon, 23 Aug 2021 10:56:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 427D86138B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 CC414166C; Mon, 23 Aug 2021 12:56:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CC414166C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716210; bh=iwoMbWscxV87mTZ+5gRvlznEmWEiN3jnlnjub3xOJ70=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GSy5XsOriWRRtMokKbKT/9Krp4ax1X8vvrrHolUUZEYsgH6gHlgCkBu3PR7YQpzz4 azCvtm5YB3asCSIfEYSgtfEBYF+7Fz82ba141sSrJlfGZ5v3VlYNeGHBQTOw0qng5Z 3Ek2dn03W9jVrk+UTVg/vJujWVXwQYkPhX5X/H9I= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 13DDBF80240; Mon, 23 Aug 2021 12:54:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5057AF80510; Mon, 23 Aug 2021 12:54:54 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.130]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 464D2F8016E for ; Mon, 23 Aug 2021 12:54:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 464D2F8016E Received: from localhost (unknown [192.168.167.225]) by lucky1.263xmail.com (Postfix) with ESMTP id ECCEED77B4; Mon, 23 Aug 2021 18:54:40 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P10596T140297356953344S1629716077595046_; Mon, 23 Aug 2021 18:54:40 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <248984a6adda567a47d2b68276e71ebc> X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 7 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 14/15] ASoC: rockchip: i2s: Add support for 'rockchip, clk-trcm' property Date: Mon, 23 Aug 2021 18:54:35 +0800 Message-Id: <1629716076-21465-5-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, Xing Zheng , devicetree@vger.kernel.org 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" From: Xing Zheng If there is only one lrck (tx or rx) by hardware, we need to use 'rockchip,clk-trcm' to specify which lrck can be used. Change-Id: I3bf8d87a6bc8c45e183040012d87d8be21a4c133 Signed-off-by: Xing Zheng Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 6ccb62e..b9d9c88 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -54,6 +54,7 @@ struct rk_i2s_dev { bool is_master_mode; const struct rk_i2s_pins *pins; unsigned int bclk_ratio; + unsigned int clk_trcm; }; /* tx/rx ctrl lock */ @@ -321,7 +322,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct rk_i2s_dev *i2s = to_info(dai); - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); unsigned int val = 0; unsigned int mclk_rate, bclk_rate, div_bclk, div_lrck; @@ -421,13 +421,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_RDL_MASK, I2S_DMACR_RDL(16)); - val = I2S_CKR_TRCM_TXRX; - if (dai->driver->symmetric_rate && rtd->dai_link->symmetric_rate) - val = I2S_CKR_TRCM_TXONLY; - - regmap_update_bits(i2s->regmap, I2S_CKR, - I2S_CKR_TRCM_MASK, - val); return 0; } @@ -531,7 +524,6 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = { SNDRV_PCM_FMTBIT_S32_LE), }, .ops = &rockchip_i2s_dai_ops, - .symmetric_rate = 1, }; static const struct snd_soc_component_driver rockchip_i2s_component = { @@ -750,6 +742,18 @@ static int rockchip_i2s_probe(struct platform_device *pdev) else if (of_property_read_bool(node, "rockchip,capture-only")) soc_dai->playback.channels_min = 0; + i2s->clk_trcm = I2S_CKR_TRCM_TXRX; + if (!of_property_read_u32(node, "rockchip,clk-trcm", &val)) { + if (val >= 0 && val <= 2) { + i2s->clk_trcm = val << I2S_CKR_TRCM_SHIFT; + if (i2s->clk_trcm) + soc_dai->symmetric_rate = 1; + } + } + + regmap_update_bits(i2s->regmap, I2S_CKR, + I2S_CKR_TRCM_MASK, i2s->clk_trcm); + ret = devm_snd_soc_register_component(&pdev->dev, &rockchip_i2s_component, soc_dai, 1); From patchwork Mon Aug 23 10:55:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 12452405 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 64A81C4320A for ; Mon, 23 Aug 2021 10:58:00 +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 6991461186 for ; Mon, 23 Aug 2021 10:57:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6991461186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 0AF5E1671; Mon, 23 Aug 2021 12:57:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0AF5E1671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629716278; bh=a0IAx3MhqXimYVYa+3Cwh2yg++mF6GYuwuJ7HVmNil0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mQKNa2CEwteX9OQ6mC9h0W33BpTxv+WHCpLc4IqV0wYiu3QyqfVTIt+1cyu8pmpWu undmMOb95kPqM5VAaPxkP1Q/L0awOcm7GBScuVPrw80tbHgfuop5tOBCJj0sdZI3ka /3izEW1G86LUKsbJ3bs11POaCMmFVO+Fzj8WJsmE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 62B01F80217; Mon, 23 Aug 2021 12:55:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C0F5BF804E5; Mon, 23 Aug 2021 12:55:49 +0200 (CEST) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.135]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 778BAF80430 for ; Mon, 23 Aug 2021 12:55:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 778BAF80430 Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id DCD88B3093; Mon, 23 Aug 2021 18:55:34 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P704T139881101649664S1629716134945191_; Mon, 23 Aug 2021 18:55:36 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Sugar Zhang To: broonie@kernel.org, heiko@sntech.de Subject: [PATCH 15/15] ASoC: dt-bindings: rockchip: i2s: Document property 'clk-trcm' Date: Mon, 23 Aug 2021 18:55:32 +0800 Message-Id: <1629716132-21544-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> References: <1629715710-21137-1-git-send-email-sugar.zhang@rock-chips.com> Cc: Sugar Zhang , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" This patch documents property 'rockchip,clk-trcm' which is used to specify the lrck. Signed-off-by: Sugar Zhang Change-Id: I648142c57c568bbed209f2b9188b1f539a3285b2 --- Documentation/devicetree/bindings/sound/rockchip-i2s.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml index 11e911a..8d9dfed 100644 --- a/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/rockchip-i2s.yaml @@ -72,6 +72,15 @@ properties: resets: maxItems: 2 + rockchip,clk-trcm: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 0 + description: + tx and rx lrck/bclk common use. + 0: both tx_lrck/bclk and rx_lrck/bclk are used + 1: only tx_lrck/bclk is used + 2: only rx_lrck/bclk is used + rockchip,capture-channels: $ref: /schemas/types.yaml#/definitions/uint32 default: 2