From patchwork Tue Feb 1 23:47:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 538987 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 3444AC433EF for ; Tue, 1 Feb 2022 23:48:34 +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 730D717BC; Wed, 2 Feb 2022 00:47:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 730D717BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1643759312; bh=Q8xBPOUco7AyhyFcpEjf5QtwQ6sfLa7OZ7E7rgmk1UM=; h=Date:To:From:Subject:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Reply-To:From; b=uCV+hqvixmZOTNePfPJ2cQ8O5/Hx86PPrpBo78ceY6eAf9jazzXkRzBrsQFCmGRiB 9CgiZ2it5RuO0Tv+6m8XFeyRkzpMND40lgU8L63Vvl4BqUWkVU/XpVm+EM0CYzVDXV qtKbjfv7Lp66hELNyCNMNg3fQU0JE4mlB16EgL7U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id ED7BBF8012C; Wed, 2 Feb 2022 00:47:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 598E4F80130; Wed, 2 Feb 2022 00:47:38 +0100 (CET) Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EEDF2F800F8 for ; Wed, 2 Feb 2022 00:47:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EEDF2F800F8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="tmAslqzD" Date: Tue, 01 Feb 2022 23:47:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1643759249; bh=SzxGyHc0MaRHChzTCdfR+eLaUqpReD6n1FCyEvsk43k=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:From:To:Cc; b=tmAslqzDF4OjbdvUsLuPf4FNXsaYYBeeKrW/n1jjNzCxJEqFN0JH9hV8Nt35vwvpv yH5X7JsSkISNXfQNC6ErlJgbMS41nhEjfpJ4T1DB2N9JZKE4LJRj4z/hWVVWs6gwxq +MrMf2Zxf3Ip2CO8INk5EqTumceCNGXIn8dLSvelDcwDb+VfDUezocMYEVka/z+H3P T4TrGdV3ah18cG3w7rduXmaEj5T4yg/t9PI+XLU8rSJHR18Za5J18vzlCg2nhwPLnL f53dx+py7Awk6OZu69NQUzYGGGfN1yTNZqbCWlJ7UWihdZjEySJvP8G1OHwzx9l5Uw tJpj38djD++kg== To: Liam Girdwood , Mark Brown From: =?utf-8?q?Martin_Povi=C5=A1er?= Subject: [PATCH] ASoC: tas2770: Insert post reset delay Message-ID: <20220201234612.74401-1-povik+lin@protonmail.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, =?utf-8?q?Martin_Povi=C5=A1er?= , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Frank Shi , Ye Bin 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: , Reply-To: =?utf-8?q?Martin_Povi=C5=A1er?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Per TAS2770 datasheet there must be a 1 ms delay from reset to first command. So insert delays into the driver where appropriate. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Martin PoviĊĦer --- sound/soc/codecs/tas2770.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.33.0 diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index b52c0861edc8..b397a2122dd4 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -38,10 +38,12 @@ static void tas2770_reset(struct tas2770_priv *tas2770) gpiod_set_value_cansleep(tas2770->reset_gpio, 0); msleep(20); gpiod_set_value_cansleep(tas2770->reset_gpio, 1); + usleep_range(1000, 2000); } snd_soc_component_write(tas2770->component, TAS2770_SW_RST, TAS2770_RST); + usleep_range(1000, 2000); } static int tas2770_set_bias_level(struct snd_soc_component *component, @@ -110,6 +112,7 @@ static int tas2770_codec_resume(struct snd_soc_component *component) if (tas2770->sdz_gpio) { gpiod_set_value_cansleep(tas2770->sdz_gpio, 1); + usleep_range(1000, 2000); } else { ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, TAS2770_PWR_CTRL_MASK, @@ -529,8 +532,10 @@ static int tas2770_codec_probe(struct snd_soc_component *component) tas2770->component = component; - if (tas2770->sdz_gpio) + if (tas2770->sdz_gpio) { gpiod_set_value_cansleep(tas2770->sdz_gpio, 1); + usleep_range(1000, 2000); + } tas2770_reset(tas2770);