From patchwork Thu Apr 4 03:48:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DC871575 for ; Thu, 4 Apr 2019 03:56:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74826204BA for ; Thu, 4 Apr 2019 03:56:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67CBD286D5; Thu, 4 Apr 2019 03:56:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1A38B204BA for ; Thu, 4 Apr 2019 03:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Fr9teKkrzrElcyVp3y+MW0aHvQZ/BB4Q7x2yRrIB4W4=; b=swIfzAaTXghKMVpmk5GyS+82Xc EzmOUJ/B9fP12am3Ef0HbzO9WqTXZ9Akjf4nfRsh3udNaIFlIN5fJZFdhFt2aAY46ttKD0Lgbt9JW SVwsL46dmgiXW0BFbZzEmkeiap8bM+aSS572BE/jol73Hfoyp5XR8vaNNg5MElfkznLLOknfDOBzm zsB0kycYyXo4eeriGxRIf3FiUaFjSOu34tsW5GivPEEPhXDHIDDI8EN8wdvWbPZr5AoXrLV9wklRQ rsN5LqiARUHeva+UhcvnHAJHVdhXwXy1+VQ/JteArAXCc1fgAlvg/YSXIrpk4I6hwPoZzedwF/XR5 16U0kZEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtU2-0005h6-Dj; Thu, 04 Apr 2019 03:56:10 +0000 Received: from regular1.263xmail.com ([211.150.70.202]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtTv-0005a8-6A; Thu, 04 Apr 2019 03:56:04 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.29]) by regular1.263xmail.com (Postfix) with ESMTP id ECB1E2AE; Thu, 4 Apr 2019 11:48:43 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P10405T140418540381952S1554349718945207_; Thu, 04 Apr 2019 11:48:42 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <897e75b0a0753d512c793d62121d060f> 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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 05/12] ASoC: rockchip: pdm: change dma burst to 8 Date: Thu, 4 Apr 2019 11:48:11 +0800 Message-Id: <1554349691-23450-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_205603_421749_22DF19AC X-CRM114-Status: UNSURE ( 9.74 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch decreases the transfer bursts to avoid the fifo overrun. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index abbb6d7..c50494b 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -24,7 +24,7 @@ #include "rockchip_pdm.h" -#define PDM_DMA_BURST_SIZE (16) /* size * width: 16*4 = 64 bytes */ +#define PDM_DMA_BURST_SIZE (8) /* size * width: 8*4 = 32 bytes */ struct rk_pdm_dev { struct device *dev; From patchwork Thu Apr 4 03:51:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B83E313B5 for ; Thu, 4 Apr 2019 03:51:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BF8C28762 for ; Thu, 4 Apr 2019 03:51:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A37E28A3C; Thu, 4 Apr 2019 03:51:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F384B28A3B for ; Thu, 4 Apr 2019 03:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BBT0c/STyOSdtEvcAN8nG0HCHTAODP6JIkqCUYtagkI=; b=Vrra+QPEYo9hYGivgmWKppOe6z //ycR0m3/FUvrfTy5kULoPLrRraSQ+PP47OtP/YLhwdv1MWH3yIlrD+CTWozPYTNCNdCuTNws6tSW /2BF4sQg9nNtCssJPbKynkPXHyhHrS0El0b7FYzaCBosbyO5aT1THuttFf+2UXeBJW6yhIgGEFxqA f7fmeCKQdCaktXNlvQT5sM0Gl7FGrpYLESrKTiJ2ShDhuH+FThTlK3LYTkB2TaJDkYqupftFP/3D7 VN04+h+eedgtt+B7/u8+oxyqSQacdQSMHWIiXPwkV9euV6MfPKbReyDUp4baLRWSRi0vdbiHXYAke 2JARGz1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtPh-0002Lm-O7; Thu, 04 Apr 2019 03:51:41 +0000 Received: from regular1.263xmail.com ([211.150.70.203]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtPV-0002BG-6a; Thu, 04 Apr 2019 03:51:33 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.228]) by regular1.263xmail.com (Postfix) with ESMTP id 47DA43E9; Thu, 4 Apr 2019 11:51:25 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P10068T139956624271104S1554349882632874_; Thu, 04 Apr 2019 11:51:24 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <884880fc7e9e10ed45848acbefede9f0> 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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 06/12] ASoC: rockchip: pdm: fixup pdm fractional div Date: Thu, 4 Apr 2019 11:51:09 +0800 Message-Id: <1554349869-23623-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_205129_640266_5A0D674F X-CRM114-Status: GOOD ( 16.68 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support fractional div for rk3308. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 172 ++++++++++++++++++++++++++++---------- sound/soc/rockchip/rockchip_pdm.h | 9 ++ 2 files changed, 139 insertions(+), 42 deletions(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index c50494b..4f93a74 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -17,14 +17,23 @@ #include #include #include +#include #include +#include #include +#include #include #include #include "rockchip_pdm.h" #define PDM_DMA_BURST_SIZE (8) /* size * width: 8*4 = 32 bytes */ +#define PDM_SIGNOFF_CLK_RATE (100000000) + +enum rk_pdm_version { + RK_PDM_RK3229, + RK_PDM_RK3308, +}; struct rk_pdm_dev { struct device *dev; @@ -32,22 +41,51 @@ struct rk_pdm_dev { struct clk *hclk; struct regmap *regmap; struct snd_dmaengine_dai_dma_data capture_dma_data; + struct reset_control *reset; + enum rk_pdm_version version; }; struct rk_pdm_clkref { unsigned int sr; unsigned int clk; + unsigned int clk_out; +}; + +struct rk_pdm_ds_ratio { + unsigned int ratio; + unsigned int sr; }; static struct rk_pdm_clkref clkref[] = { - { 8000, 40960000 }, - { 11025, 56448000 }, - { 12000, 61440000 }, + { 8000, 40960000, 2048000 }, + { 11025, 56448000, 2822400 }, + { 12000, 61440000, 3072000 }, + { 8000, 98304000, 2048000 }, + { 12000, 98304000, 3072000 }, +}; + +static struct rk_pdm_ds_ratio ds_ratio[] = { + { 0, 192000 }, + { 0, 176400 }, + { 0, 128000 }, + { 1, 96000 }, + { 1, 88200 }, + { 1, 64000 }, + { 2, 48000 }, + { 2, 44100 }, + { 2, 32000 }, + { 3, 24000 }, + { 3, 22050 }, + { 3, 16000 }, + { 4, 12000 }, + { 4, 11025 }, + { 4, 8000 }, }; -static unsigned int get_pdm_clk(unsigned int sr) +static unsigned int get_pdm_clk(struct rk_pdm_dev *pdm, unsigned int sr, + unsigned int *clk_src, unsigned int *clk_out) { - unsigned int i, count, clk, div; + unsigned int i, count, clk, div, rate; clk = 0; if (!sr) @@ -59,14 +97,39 @@ static unsigned int get_pdm_clk(unsigned int sr) continue; div = sr / clkref[i].sr; if ((div & (div - 1)) == 0) { + *clk_out = clkref[i].clk_out; + rate = clk_round_rate(pdm->clk, clkref[i].clk); + if (rate != clkref[i].clk) + continue; clk = clkref[i].clk; + *clk_src = clkref[i].clk; break; } } + if (!clk) { + clk = clk_round_rate(pdm->clk, PDM_SIGNOFF_CLK_RATE); + *clk_src = clk; + } return clk; } +static unsigned int get_pdm_ds_ratio(unsigned int sr) +{ + unsigned int i, count, ratio; + + ratio = 0; + if (!sr) + return ratio; + + count = ARRAY_SIZE(ds_ratio); + for (i = 0; i < count; i++) { + if (sr == ds_ratio[i].sr) + ratio = ds_ratio[i].ratio; + } + return ratio; +} + static inline struct rk_pdm_dev *to_info(struct snd_soc_dai *dai) { return snd_soc_dai_get_drvdata(dai); @@ -95,40 +158,52 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream, struct rk_pdm_dev *pdm = to_info(dai); unsigned int val = 0; unsigned int clk_rate, clk_div, samplerate; + unsigned int clk_src, clk_out; + unsigned long m, n; + bool change; int ret; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + return 0; + samplerate = params_rate(params); - clk_rate = get_pdm_clk(samplerate); + clk_rate = get_pdm_clk(pdm, samplerate, &clk_src, &clk_out); if (!clk_rate) return -EINVAL; - ret = clk_set_rate(pdm->clk, clk_rate); + ret = clk_set_rate(pdm->clk, clk_src); if (ret) return -EINVAL; - clk_div = DIV_ROUND_CLOSEST(clk_rate, samplerate); - - switch (clk_div) { - case 320: - val = PDM_CLK_320FS; - break; - case 640: - val = PDM_CLK_640FS; - break; - case 1280: - val = PDM_CLK_1280FS; - break; - case 2560: - val = PDM_CLK_2560FS; - break; - case 5120: - val = PDM_CLK_5120FS; - break; - default: - dev_err(pdm->dev, "unsupported div: %d\n", clk_div); - return -EINVAL; + if (pdm->version == RK_PDM_RK3308) { + rational_best_approximation(clk_out, clk_src, + GENMASK(16 - 1, 0), + GENMASK(16 - 1, 0), + &m, &n); + + val = (m << PDM_FD_NUMERATOR_SFT) | + (n << PDM_FD_DENOMINATOR_SFT); + regmap_update_bits_check(pdm->regmap, PDM_CTRL1, + PDM_FD_NUMERATOR_MSK | + PDM_FD_DENOMINATOR_MSK, + val, &change); + if (change) { + reset_control_assert(pdm->reset); + reset_control_deassert(pdm->reset); + rockchip_pdm_rxctrl(pdm, 0); + } + clk_div = n / m; + if (clk_div >= 40) + val = PDM_CLK_FD_RATIO_40; + else if (clk_div <= 35) + val = PDM_CLK_FD_RATIO_35; + else + return -EINVAL; + regmap_update_bits(pdm->regmap, PDM_CLK_CTRL, + PDM_CLK_FD_RATIO_MSK, + val); } - + val = get_pdm_ds_ratio(samplerate); regmap_update_bits(pdm->regmap, PDM_CLK_CTRL, PDM_DS_RATIO_MSK, val); regmap_update_bits(pdm->regmap, PDM_HPF_CTRL, PDM_HPF_CF_MSK, PDM_HPF_60HZ); @@ -177,13 +252,11 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { - regmap_update_bits(pdm->regmap, PDM_CTRL0, - PDM_PATH_MSK | PDM_VDW_MSK, - val); - regmap_update_bits(pdm->regmap, PDM_DMA_CTRL, PDM_DMA_RDL_MSK, - PDM_DMA_RDL(16)); - } + regmap_update_bits(pdm->regmap, PDM_CTRL0, + PDM_PATH_MSK | PDM_VDW_MSK, + val); + regmap_update_bits(pdm->regmap, PDM_DMA_CTRL, PDM_DMA_RDL_MSK, + PDM_DMA_RDL(16)); return 0; } @@ -380,8 +453,19 @@ static const struct regmap_config rockchip_pdm_regmap_config = { .cache_type = REGCACHE_FLAT, }; +static const struct of_device_id rockchip_pdm_match[] = { + { .compatible = "rockchip,pdm", }, + { .compatible = "rockchip,px30-pdm", + .data = (void *)RK_PDM_RK3308 }, + { .compatible = "rockchip,rk3308-pdm", + .data = (void *)RK_PDM_RK3308 }, + {}, +}; +MODULE_DEVICE_TABLE(of, rockchip_pdm_match); + static int rockchip_pdm_probe(struct platform_device *pdev) { + const struct of_device_id *match; struct rk_pdm_dev *pdm; struct resource *res; void __iomem *regs; @@ -391,6 +475,16 @@ static int rockchip_pdm_probe(struct platform_device *pdev) if (!pdm) return -ENOMEM; + match = of_match_device(rockchip_pdm_match, &pdev->dev); + if (match) + pdm->version = (enum rk_pdm_version)match->data; + + if (pdm->version == RK_PDM_RK3308) { + pdm->reset = devm_reset_control_get(&pdev->dev, "pdm-m"); + if (IS_ERR(pdm->reset)) + return PTR_ERR(pdm->reset); + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(regs)) @@ -503,12 +597,6 @@ static const struct dev_pm_ops rockchip_pdm_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(rockchip_pdm_suspend, rockchip_pdm_resume) }; -static const struct of_device_id rockchip_pdm_match[] = { - { .compatible = "rockchip,pdm", }, - {}, -}; -MODULE_DEVICE_TABLE(of, rockchip_pdm_match); - static struct platform_driver rockchip_pdm_driver = { .probe = rockchip_pdm_probe, .remove = rockchip_pdm_remove, diff --git a/sound/soc/rockchip/rockchip_pdm.h b/sound/soc/rockchip/rockchip_pdm.h index 00a8fa1..ae88644 100644 --- a/sound/soc/rockchip/rockchip_pdm.h +++ b/sound/soc/rockchip/rockchip_pdm.h @@ -53,7 +53,16 @@ #define PDM_VDW_MSK (0x1f << 0) #define PDM_VDW(X) ((X - 1) << 0) +/* PDM CTRL1 */ +#define PDM_FD_NUMERATOR_SFT 16 +#define PDM_FD_NUMERATOR_MSK GENMASK(31, 16) +#define PDM_FD_DENOMINATOR_SFT 0 +#define PDM_FD_DENOMINATOR_MSK GENMASK(15, 0) + /* PDM CLK CTRL */ +#define PDM_CLK_FD_RATIO_MSK BIT(6) +#define PDM_CLK_FD_RATIO_40 (0X0 << 6) +#define PDM_CLK_FD_RATIO_35 BIT(6) #define PDM_CLK_MSK BIT(5) #define PDM_CLK_EN BIT(5) #define PDM_CLK_DIS (0x0 << 5) From patchwork Thu Apr 4 03:53:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2521E1575 for ; Thu, 4 Apr 2019 04:02:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 098E928732 for ; Thu, 4 Apr 2019 04:02:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1EBD2886A; Thu, 4 Apr 2019 04:02:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B93E28732 for ; Thu, 4 Apr 2019 04:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=n22t3uttDjAwvbvPX7SSnGsSA7pcvpuh8adibBEtEg4=; b=q0D8YLJCpI6JC82sxWrkfxvocd xIjkOm8sInDR/4+7QadFLoL0pDUYA25OX1FprJV4c8G9iYpHl4mnaxVDzuUXyWFn/3eKyT/V2jE4b R3yH48odLaBcJQ+AQ3hn9bbfsnVQg8y4gePNcXoJKiiuzKwVXIFRHhB7so+FIfmT+wC7jn/NQbx0C Gi8dOW/80PDEbZ25DFpR587vDM1ci3H7McKUm7lk/FbVyMQKb/du+9QeqtpXcyIEjjEg/cYRdAnnU MgGuyNWl9MbNn3eqKM23BfW3E7qLYV1PKciuGMwUGeaBBKNP8MlLn1xtjLUrXJhhEFNAO+ZHsA0+L OwgMOong==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBta5-0001Cg-6h; Thu, 04 Apr 2019 04:02:25 +0000 Received: from regular1.263xmail.com ([211.150.70.205]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtZj-0000kP-HS; Thu, 04 Apr 2019 04:02:04 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.105]) by regular1.263xmail.com (Postfix) with ESMTP id D4BCC48E; Thu, 4 Apr 2019 11:53:27 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P15349T140253968987904S1554350005363702_; Thu, 04 Apr 2019 11:53:27 +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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 07/12] dt-bindings: sound: rockchip: add compatible for rk3308/px30 Date: Thu, 4 Apr 2019 11:53:15 +0800 Message-Id: <1554349995-23944-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_210203_747008_4E64CB73 X-CRM114-Status: UNSURE ( 7.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds bindings for rk3308/px30. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip,pdm.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip,pdm.txt b/Documentation/devicetree/bindings/sound/rockchip,pdm.txt index 47f164f..3e0eb73 100644 --- a/Documentation/devicetree/bindings/sound/rockchip,pdm.txt +++ b/Documentation/devicetree/bindings/sound/rockchip,pdm.txt @@ -3,6 +3,8 @@ Required properties: - compatible: "rockchip,pdm" + - "rockchip,px30-pdm" + - "rockchip,rk3308-pdm" - reg: physical base address of the controller and length of memory mapped region. - dmas: DMA specifiers for rx dma. See the DMA client binding, @@ -12,6 +14,8 @@ Required properties: - clock-names: should contain following: - "pdm_hclk": clock for PDM BUS - "pdm_clk" : clock for PDM controller +- resets: a list of phandle + reset-specifer paris, one for each entry in reset-names. +- reset-names: reset names, should include "pdm-m". - pinctrl-names: Must contain a "default" entry. - pinctrl-N: One property must exist for each entry in pinctrl-names. See ../pinctrl/pinctrl-bindings.txt From patchwork Thu Apr 4 03:54:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8339D17E1 for ; Thu, 4 Apr 2019 04:02:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6808A28732 for ; Thu, 4 Apr 2019 04:02:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C0C52886A; Thu, 4 Apr 2019 04:02:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0423428732 for ; Thu, 4 Apr 2019 04:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Bz6jMpmufCOzeAtoExRLEr6J7f0I1b0P8sLT9CoL4kE=; b=Yekx1k4Yj0WGH/kkFXaDqe9/j9 K1TKgSny6tTML/CSfn0V2pq2kCaidDAUKmP5tnuh8cnTcopEsbJQ+Y9xkMcNFTtH3MTbfJiQ9oVNm WOct0KHZOb1L4oww9X6ULrRhEpS9iwUK9eDoPDAP78msVDHzqq64qBNILsYmY5YU6RfeIZBXV0+8O 4EoyGKBn7dzkGrZJp9L9AiRsPPigyWZF5ZXQQZCfFtxnL5yDzcFd1QKKF/VQuAi49MTD/TV6FpSdd xX/473y8HMT7YiTh0yuQuqRUcr97hnHLHBEe724eAGtzuVQaQHb1k8X1QgrbrDw/Z7uc6kMakPtjO Vd59jkMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtZs-0000tG-4W; Thu, 04 Apr 2019 04:02:12 +0000 Received: from regular1.263xmail.com ([211.150.70.195]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtZj-0000kN-6a; Thu, 04 Apr 2019 04:02:04 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.152]) by regular1.263xmail.com (Postfix) with ESMTP id A448A924; Thu, 4 Apr 2019 11:54:36 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P20600T140229010941696S1554350073043925_; Thu, 04 Apr 2019 11:54:35 +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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 08/12] ASoC: rockchip: pdm: add compatible for rk1808 Date: Thu, 4 Apr 2019 11:54:30 +0800 Message-Id: <1554350070-24078-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_210203_425410_66263CCE X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for rk1808, the pdm controller is the same as rk3308. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 4f93a74..3e1c5fd 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -457,6 +457,8 @@ static const struct of_device_id rockchip_pdm_match[] = { { .compatible = "rockchip,pdm", }, { .compatible = "rockchip,px30-pdm", .data = (void *)RK_PDM_RK3308 }, + { .compatible = "rockchip,rk1808-pdm", + .data = (void *)RK_PDM_RK3308 }, { .compatible = "rockchip,rk3308-pdm", .data = (void *)RK_PDM_RK3308 }, {}, From patchwork Thu Apr 4 03:55:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E49211575 for ; Thu, 4 Apr 2019 04:01:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9E952886A for ; Thu, 4 Apr 2019 04:01:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD41D2894E; Thu, 4 Apr 2019 04:01:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 729762886A for ; Thu, 4 Apr 2019 04:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FwSzbWKx4m7jthtR8rnihOc8hCQcty6dGmse3JLQYH4=; b=klpNMhKAN5m910bhqu7BNYmvkN l4Bat8HOgK/qg2Ow+4CE7UBgp/LhdV72ihnlHwAcz//07i06woQbaEA2h9jfoF5t/VpOIfP0417pv gmkARh6gX6+urMiSNM/swgzJ+ldUBDEEpr24AMkq11c6jrbDrs3apv1oW91h6W8TmWkyOejcLbDLs mgjS6w7lKAeoU7pW29gVNBunZdENF8kGV9f38Wytz7JOeYFsa4a4zSmBJX35qvW+HR/QfPn4D/wRF ooje7FrM6H0Rm3a+Bz8tGaSoBrxfuJpsaJT5a4x/PRJWNkrOn0P95WL+PXq247vKrmMo81OnPqd+u 9sNyDHsw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtYt-0008WS-C8; Thu, 04 Apr 2019 04:01:11 +0000 Received: from regular1.263xmail.com ([211.150.70.205]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtYk-0008O2-Oy; Thu, 04 Apr 2019 04:01:04 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.158]) by regular1.263xmail.com (Postfix) with ESMTP id 012BF49C; Thu, 4 Apr 2019 11:55:51 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P11171T140309601748736S1554350148756742_; Thu, 04 Apr 2019 11:55:50 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <4a751afae11919253e86403bd88738ef> 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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 09/12] dt-bindings: sound: add compatible for rk1808 Date: Thu, 4 Apr 2019 11:55:45 +0800 Message-Id: <1554350145-24198-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_210103_006942_6CF4A839 X-CRM114-Status: UNSURE ( 8.13 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds bindings for rk1808 soc. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip,pdm.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip,pdm.txt b/Documentation/devicetree/bindings/sound/rockchip,pdm.txt index 3e0eb73..98572a2 100644 --- a/Documentation/devicetree/bindings/sound/rockchip,pdm.txt +++ b/Documentation/devicetree/bindings/sound/rockchip,pdm.txt @@ -4,6 +4,7 @@ Required properties: - compatible: "rockchip,pdm" - "rockchip,px30-pdm" + - "rockchip,rk1808-pdm" - "rockchip,rk3308-pdm" - reg: physical base address of the controller and length of memory mapped region. From patchwork Thu Apr 4 03:56:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A418117E1 for ; Thu, 4 Apr 2019 04:04:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8934F28732 for ; Thu, 4 Apr 2019 04:04:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D9412886A; Thu, 4 Apr 2019 04:04:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CBC528732 for ; Thu, 4 Apr 2019 04:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uu7HBA3ty6/yVHQC/3vlWbgOAo3Ysxgy9tPagOqJKO0=; b=PbQV4K5Y6MoMVd0g97QOBrHsOK 9x2gJ07FQfk4EX0SeXnkBiPIGytww5OILaheBB4g1xshAllEAt0GayPm1Qd20RX7gG+MLbrtW+nsY 9Lm8tYcws4PjtfSlKy456BiDdu4yylur85TKoEI0UEwe0/4aq2lHQe4U+l8VBY73BlBBPP7qDursd 9OlwYYRsZTGJ/vlKI761Lesd3arptJDGR5gnCnRfM5pCgBV+KuJRyiWZSA+9X4WdQAKi+FRLpBZ5h L28BOpvprDVwNHIeUq0Do9YTQpUWeRr464wlwK2g7oH9OJaBmW/ZSnOst0NlTCpBV8s9vAtrOPbGd tDIzhBKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtbz-0001pO-4v; Thu, 04 Apr 2019 04:04:23 +0000 Received: from regular1.263xmail.com ([211.150.70.197]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtbg-0001QJ-6h; Thu, 04 Apr 2019 04:04:05 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.192]) by regular1.263xmail.com (Postfix) with ESMTP id 44C9368A; Thu, 4 Apr 2019 11:56:35 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P27186T140355238283008S1554350192612308_; Thu, 04 Apr 2019 11:56:34 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <42b942c1645e5b1a64fa1c8b90af1a18> 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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 10/12] ASoC: rockchip: pdm: adjust waterlevel in frame unit Date: Thu, 4 Apr 2019 11:56:29 +0800 Message-Id: <1554350189-24318-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_210404_424385_C438048F X-CRM114-Status: UNSURE ( 8.82 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch make the waterlevel more reasonable, because the pdm controller share the single FIFO(128 entries) with each channel. adjust waterlevel in frame to meet the vad or dma frames request. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 3e1c5fd..955cdc2 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -255,8 +255,9 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(pdm->regmap, PDM_CTRL0, PDM_PATH_MSK | PDM_VDW_MSK, val); + /* all channels share the single FIFO */ regmap_update_bits(pdm->regmap, PDM_DMA_CTRL, PDM_DMA_RDL_MSK, - PDM_DMA_RDL(16)); + PDM_DMA_RDL(8 * params_channels(params))); return 0; } From patchwork Thu Apr 4 03:57:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C8E71669 for ; Thu, 4 Apr 2019 04:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1257C28732 for ; Thu, 4 Apr 2019 04:04:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 064002886A; Thu, 4 Apr 2019 04:04:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF8CB28732 for ; Thu, 4 Apr 2019 04:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wCbz2z9MLw3suT//J1JktL6Iv5ps+NyfpFPx/KWpriA=; b=MFH0UIXauFsW1fomXVJ+gLwZNr cC/19Z7Ba0/0BFIX8kmq+0WPELIF/PmwbWU4WmQ2toRcjrBvDA3Tdi/D2/dcSbiHRBpbKOmGBFiAG wWO8qPB7e3UkoFbHs4XIuRZYAUZ/jeALrry4S9iTvMprv0nLD/2i1cAnwsR8H+COa5sqQxZuIFjvL Hj2Ek8NbNy6HPV0v/6SYf7RXlRDp6YXEa2uNbodOjj1oSsZqyhq20NSLUMrJblpOpaXuQ1dvz33qg yp+UY3SQlsgRGeBY4WJE6j14IRQ3U13h4Eu32w18tOC9Ef+6T8vMmOgfZsAWIX6LatdlUekcqgb+h G8e24IDg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtc0-0001ra-Hz; Thu, 04 Apr 2019 04:04:24 +0000 Received: from regular1.263xmail.com ([211.150.70.196]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtbg-0001QK-6j; Thu, 04 Apr 2019 04:04:05 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.70]) by regular1.263xmail.com (Postfix) with ESMTP id 4827A755; Thu, 4 Apr 2019 11:57:14 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P5380T140554337773312S1554350230917190_; Thu, 04 Apr 2019 11:57:13 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <1692031030d50d4299684085f0c8431a> 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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 11/12] ASoC: rockchip: pdm: Mark RXFIFO_DATA as volatile and precious Date: Thu, 4 Apr 2019 11:57:08 +0800 Message-Id: <1554350228-24440-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_210404_425289_C1018107 X-CRM114-Status: UNSURE ( 8.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch marks RXFIFO_DATA as precious to avoid being read outside a call from the driver, such as regmap debugfs Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 955cdc2..e89beeb 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -415,6 +415,7 @@ static bool rockchip_pdm_rd_reg(struct device *dev, unsigned int reg) case PDM_INT_CLR: case PDM_INT_ST: case PDM_DATA_VALID: + case PDM_RXFIFO_DATA: case PDM_VERSION: return true; default: @@ -429,6 +430,17 @@ static bool rockchip_pdm_volatile_reg(struct device *dev, unsigned int reg) case PDM_FIFO_CTRL: case PDM_INT_CLR: case PDM_INT_ST: + case PDM_RXFIFO_DATA: + return true; + default: + return false; + } +} + +static bool rockchip_pdm_precious_reg(struct device *dev, unsigned int reg) +{ + switch (reg) { + case PDM_RXFIFO_DATA: return true; default: return false; @@ -451,6 +463,7 @@ static const struct regmap_config rockchip_pdm_regmap_config = { .writeable_reg = rockchip_pdm_wr_reg, .readable_reg = rockchip_pdm_rd_reg, .volatile_reg = rockchip_pdm_volatile_reg, + .precious_reg = rockchip_pdm_precious_reg, .cache_type = REGCACHE_FLAT, }; From patchwork Thu Apr 4 03:57:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugar Zhang X-Patchwork-Id: 10884875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4427813B5 for ; Thu, 4 Apr 2019 03:58:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 285C0284FC for ; Thu, 4 Apr 2019 03:58:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C953286FF; Thu, 4 Apr 2019 03:58:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BAF09284FC for ; Thu, 4 Apr 2019 03:58:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=K55HoJ2w3bN0aHDPMm4zXf56JgP6ZT723ww+TigInmc=; b=sfeCuIBI42JXiQOTQRpvAxDgxt Tk/uniPf2NkqJijsQxUvOABWamz+17xWGVSq/2f1TgE2n0XrpqDjCORxPDudrvu5Pw277mEPvtBKw B4ToreOJwTSawMMGWgWr4be6ITYzBHqFSjwEOst3SD9jvT/RYEPCgoHJAQwAAZgP6dQrURxgWPLqb xJQT7IV1OARgKF4yEHZQxqVBNEFIImkTq1/8p30zVR07URVFZCI8PRk71HWLBOirx5tA7slPSM9l/ 45DhCC+Ka3SqhUGfFGAHVRZsmZ723SeZXYfzhfdN21D8/S30H+Iq0VlFhOsZYRIcCk8Xfb1+sDBoC e0OIIIzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtW4-0006iY-VR; Thu, 04 Apr 2019 03:58:16 +0000 Received: from regular1.263xmail.com ([211.150.70.203]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtVu-0006U9-8o; Thu, 04 Apr 2019 03:58:07 +0000 Received: from sugar.zhang?rock-chips.com (unknown [192.168.167.183]) by regular1.263xmail.com (Postfix) with ESMTP id 6ACDC3DB; Thu, 4 Apr 2019 11:58:04 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 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 P17431T140464758023936S1554350281830449_; Thu, 04 Apr 2019 11:58:03 +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: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sugar Zhang To: heiko@sntech.de, broonie@kernel.org Subject: [PATCH v1 12/12] ASoC: rockchip: pdm: Correct PDM_CTRL0 reg value Date: Thu, 4 Apr 2019 11:57:57 +0800 Message-Id: <1554350277-24561-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> References: <1554298856-59028-1-git-send-email-sugar.zhang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_205806_500591_AB900C65 X-CRM114-Status: GOOD ( 10.99 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fix the wrong reg value for rk322x/rk322xh, cuz there is no STORE JUSTIFIED MODE on it. on rk322x/rk322xh, the same bit means PDM_MODE/RESERVED, if the bit is set to RESERVED, the controller will not work. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index e89beeb..6c0f242 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -210,7 +210,9 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(pdm->regmap, PDM_HPF_CTRL, PDM_HPF_LE | PDM_HPF_RE, PDM_HPF_LE | PDM_HPF_RE); regmap_update_bits(pdm->regmap, PDM_CLK_CTRL, PDM_CLK_EN, PDM_CLK_EN); - regmap_update_bits(pdm->regmap, PDM_CTRL0, PDM_MODE_MSK, PDM_MODE_LJ); + if (pdm->version != RK_PDM_RK3229) + regmap_update_bits(pdm->regmap, PDM_CTRL0, + PDM_MODE_MSK, PDM_MODE_LJ); val = 0; switch (params_format(params)) { @@ -468,7 +470,8 @@ static const struct regmap_config rockchip_pdm_regmap_config = { }; static const struct of_device_id rockchip_pdm_match[] = { - { .compatible = "rockchip,pdm", }, + { .compatible = "rockchip,pdm", + .data = (void *)RK_PDM_RK3229 }, { .compatible = "rockchip,px30-pdm", .data = (void *)RK_PDM_RK3308 }, { .compatible = "rockchip,rk1808-pdm",