From patchwork Fri Apr 21 19:33:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Kochetkov X-Patchwork-Id: 676169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 10A52C77B78 for ; Sat, 22 Apr 2023 08:50:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1FEF4EBE; Sat, 22 Apr 2023 10:50:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1FEF4EBE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1682153452; bh=k/W7J+h8mIT+x8XNT7jbNRkISUbVwJAhp1FWnCmb/yc=; h=To:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From:Reply-To:Cc:From; b=ByljyLD7qx+x/XsyO3zEJC+O519wVo1NiCggXJ039sDfbxJ8CmXuqwX6KSmObra8r +at28AwmvWfSLzewuA0rjSpCWwTRmiqNGbuLyBoynRydSM7S9n51gLYwfmSGojsjeU RL2zkLBI4Qk3FMaLRuCChJ4MMGLfcWR+YTYpcxx0= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6C14EF80542; Sat, 22 Apr 2023 10:49:15 +0200 (CEST) To: alsa-devel@alsa-project.org Subject: [PATCH] ASoC: dwc: add reset support Date: Fri, 21 Apr 2023 22:33:19 +0300 X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 22 Apr 2023 08:49:11 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168215335490.26.141787346545792675@mailman-core.alsa-project.org> X-Patchwork-Original-From: Maxim Kochetkov via Alsa-devel From: Maxim Kochetkov Reply-To: Maxim Kochetkov Cc: lgirdwood@gmail.com, broonie@kernel.org, tiwai@suse.com, p.zabel@pengutronix.de, ckeepax@opensource.cirrus.com, u.kleine-koenig@pengutronix.de, nicolas.ferre@microchip.com, Maxim Kochetkov Content-Disposition: inline Some SoC may have resets for I2S subsystem. So add optional reset deassert at startup. Signed-off-by: Maxim Kochetkov --- sound/soc/dwc/dwc-i2s.c | 9 +++++++++ sound/soc/dwc/local.h | 1 + 2 files changed, 10 insertions(+) diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index acdf98b2ee9c..8c8bc7116f86 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -648,6 +649,14 @@ static int dw_i2s_probe(struct platform_device *pdev) if (IS_ERR(dev->i2s_base)) return PTR_ERR(dev->i2s_base); + dev->reset = devm_reset_control_array_get_optional_shared(&pdev->dev); + if (IS_ERR(dev->reset)) + return PTR_ERR(dev->reset); + + ret = reset_control_deassert(dev->reset); + if (ret) + return ret; + dev->dev = &pdev->dev; irq = platform_get_irq_optional(pdev, 0); diff --git a/sound/soc/dwc/local.h b/sound/soc/dwc/local.h index 1c361eb6127e..d64bd4f8fd34 100644 --- a/sound/soc/dwc/local.h +++ b/sound/soc/dwc/local.h @@ -89,6 +89,7 @@ union dw_i2s_snd_dma_data { struct dw_i2s_dev { void __iomem *i2s_base; struct clk *clk; + struct reset_control *reset; int active; unsigned int capability; unsigned int quirks;