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: 10884877 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 69A7E1575 for ; Thu, 4 Apr 2019 03:59:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ACDE284FC for ; Thu, 4 Apr 2019 03:59:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BE94286FF; Thu, 4 Apr 2019 03:59:04 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 99158284FC for ; Thu, 4 Apr 2019 03:59:03 +0000 (UTC) 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 DB8F515E6; Thu, 4 Apr 2019 05:58:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB8F515E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554350342; bh=bjZTQI4eK86TjxQULolBNbVnukgUjJx9+ynvyWOPZeo=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=a0Bg4wf+ZQsDN9+vGWgUir2r3WAw5yRC5U/VwNuYt9oRS/klEE9vQKLdbJ+W7qTHg 8PxDuxSFRut8td2E2QFa5C7l7Y7B6eIY2QkSekNzBQcyuNvq/B02qcQAlFbbSWaz65 t2guwQVDp80M8BEUvirQQ7Tf8nLHEGOXKQX63P/I= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6582DF89633; Thu, 4 Apr 2019 05:58:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2ED9F896F4; Thu, 4 Apr 2019 05:58:09 +0200 (CEST) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.203]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7E974F8075B for ; Thu, 4 Apr 2019 05:58:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7E974F8075B 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 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> 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 Subject: [alsa-devel] [PATCH v1 12/12] ASoC: rockchip: pdm: Correct PDM_CTRL0 reg value 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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",