From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 990A9C433F5 for ; Thu, 10 Mar 2022 15:25:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237637AbiCJP0O (ORCPT ); Thu, 10 Mar 2022 10:26:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232844AbiCJP0K (ORCPT ); Thu, 10 Mar 2022 10:26:10 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8C7615697B; Thu, 10 Mar 2022 07:25:08 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 6B0911F45A2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646925907; bh=G44TKaXJ2702MH14xQ2xJ5CzDZDhej3DrvU8W8AmQpM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SXhuKhFEp8Pn5kLpJ9uE75VypUMiWbTDJVSbQOK8PeLRuwMErkdO4jbich+dzPauC qCJWCscyap4JMwtArGtY5HzKtdvHxmWP7UbBPZXUPeHdFbn2BmwfQ33I7MwQG8brbd fYowneCd2ko50BtGZSUUzuRyJ/wegpIExSkuV6lgm16tPDRBenjMZEc9g8r/MZCpiT JZBtRYcs3DiM/nITjUjJB6X2evoUXrnf21ef/sN5ap4/j6gW50i8UJIkGflgdbeBHL docIDtmUfdlSE6vs5URQcIca6NSmP9Jcr8vaydjsb9YA3GvDJgCzFyl9ueHgXddWqI r4s8PlBH5D3EQ== Message-ID: Date: Thu, 10 Mar 2022 16:25:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 1/5] ASoC: mediatek: mt8195: add reset controller Content-Language: en-US To: Trevor Wu , broonie@kernel.org, tiwai@suse.com, robh+dt@kernel.org, matthias.bgg@gmail.com Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, aaronyu@google.com, yc.hung@mediatek.com References: <20220308072435.22460-1-trevor.wu@mediatek.com> <20220308072435.22460-2-trevor.wu@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220308072435.22460-2-trevor.wu@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 08/03/22 08:24, Trevor Wu ha scritto: > Audio hardware is possibly used in the firmware stage, so resetting audio > hardware before regcache records default register values is required. > > Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno > --- > sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c > index 550636500949..72b2c6d629b9 100644 > --- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c > +++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include "mt8195-afe-common.h" > #include "mt8195-afe-clk.h" > #include "mt8195-reg.h" > @@ -3056,6 +3057,7 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev) > struct mtk_base_afe *afe; > struct mt8195_afe_private *afe_priv; > struct device *dev = &pdev->dev; > + struct reset_control *rstc; > int i, irq_id, ret; > struct snd_soc_component *component; > > @@ -3092,6 +3094,20 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev) > return ret; > } > > + /* reset controller to reset audio regs before regmap cache */ > + rstc = devm_reset_control_get_exclusive(dev, "audiosys"); > + if (IS_ERR(rstc)) { > + ret = PTR_ERR(rstc); > + dev_err(dev, "could not get audiosys reset:%d\n", ret); > + return ret; > + } > + > + ret = reset_control_reset(rstc); > + if (ret) { > + dev_err(dev, "failed to trigger audio reset:%d\n", ret); > + return ret; > + } > + > spin_lock_init(&afe_priv->afe_ctrl_lock); > > mutex_init(&afe->irq_alloc_lock);