Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4371782imw; Tue, 19 Jul 2022 05:32:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uI3QT54ZL0L1Y/AE9ToskaCUxYFBX4X14nzG0uhwuKqPcllbu2Hrb6ynRdLQ92cUDmwcTV X-Received: by 2002:a05:6402:3297:b0:43a:9233:23b4 with SMTP id f23-20020a056402329700b0043a923323b4mr42875776eda.397.1658233943142; Tue, 19 Jul 2022 05:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658233943; cv=none; d=google.com; s=arc-20160816; b=xeGjMoQurGeByYBQi/fHxgULi9wZSOMFAyCRVw+Zxu2mUiXtgpHe9+zEbqKEE6Afdj v1jqpptI3a0XhFjCx/EKwlFfV3RAVSh8NhMTqEYwsxgjkSRhyo9bCyaBXCgoLHZzAIMb h8sfs8AN8UInqYtOX+6KekzG2Gjp7WoRYVXBLNErbEQa3p/ise0Hn7b9zDj67nZyHiWF Gaf/d8VbxGVlqktoBcp2s0iHDmNWjsVL5ptQGAoZkKHm4eGbWmDG5y8Zg30TUSOR8AnQ ONe6MlwtACIrKTb0QKmbEnuj7/aTk44KKgPmlYeILmBtJkKMUVWcEelFVGcnaK9IOHxN DYCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mhpENAxPIdeshBcfKAgKrbFomHbM7m4brVv44zs8SHY=; b=EBUUw0LyOXT4OG0z67SgrsuEl/tev0YFXTpG9atAQE8AcxHOSIzxOl9bsXia7X7Tvb zMhuTs5tUiNknESpSPsPuZzoCQnQAe9K2UnvoBv/+ti46OjnnVc+MtXe/lh+LcT4nFXx RMTJe3iFjJas3CI2t8E5gIfjLkjVn3STxHDz5G8gHJfU/YWxdLYKx9UF3TcY1bIPwdtx A9udrSZGIX6tSZuEPWPPmDFiftOEdOX23vHLwMJlHKJ3Dlxo7fU08AddxF61QUsabmxJ GicNLabJS3NJqn2py39bOjvF1ds0x4JCMN5d4rOrL2DGuU3AS6S2+Y9VwBp2b28iwZE3 TRXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="JGfHgqy/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa13-20020a170907868d00b0072f2b362fc5si8271129ejc.800.2022.07.19.05.31.58; Tue, 19 Jul 2022 05:32:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="JGfHgqy/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239372AbiGSMTE (ORCPT + 99 others); Tue, 19 Jul 2022 08:19:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239032AbiGSMRP (ORCPT ); Tue, 19 Jul 2022 08:17:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83A6564CD; Tue, 19 Jul 2022 05:06:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8E48F61734; Tue, 19 Jul 2022 12:06:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 711A8C341C6; Tue, 19 Jul 2022 12:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232371; bh=51Mmdic7ub3897atJeAtVIKWsQQ+JyCHmodSqpsbTNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JGfHgqy/3xhzue9gzb6WF53VT7myNX223I8DgBu06eo3YXQXi4qoSib7kIpkerl1f ZjVJCfwoQGbRlnQrDOjGbMnjprbT8hRoMxM5mqXMSD/wpNtLS3jTLcmsu5dPgvHMig RyEcIIPLZryMTER2GMyXGJwHsHE5NJmQYBXzBPbc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Martin=20Povi=C5=A1er?= , Mark Brown , Sasha Levin Subject: [PATCH 5.10 035/112] ASoC: tas2764: Add post reset delays Date: Tue, 19 Jul 2022 13:53:28 +0200 Message-Id: <20220719114629.624351091@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Povišer [ Upstream commit cd10bb89b0d57bca98eb75e0444854a1c129a14e ] Make sure there is at least 1 ms delay from reset to first command as is specified in the datasheet. This is a fix similar to commit 307f31452078 ("ASoC: tas2770: Insert post reset delay"). Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220630075135.2221-1-povik+lin@cutebit.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/tas2764.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c index 14a193e48dc7..d8e79cc2cd1d 100644 --- a/sound/soc/codecs/tas2764.c +++ b/sound/soc/codecs/tas2764.c @@ -42,10 +42,12 @@ static void tas2764_reset(struct tas2764_priv *tas2764) gpiod_set_value_cansleep(tas2764->reset_gpio, 0); msleep(20); gpiod_set_value_cansleep(tas2764->reset_gpio, 1); + usleep_range(1000, 2000); } snd_soc_component_write(tas2764->component, TAS2764_SW_RST, TAS2764_RST); + usleep_range(1000, 2000); } static int tas2764_set_bias_level(struct snd_soc_component *component, @@ -107,8 +109,10 @@ static int tas2764_codec_resume(struct snd_soc_component *component) struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component); int ret; - if (tas2764->sdz_gpio) + if (tas2764->sdz_gpio) { gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); + usleep_range(1000, 2000); + } ret = snd_soc_component_update_bits(component, TAS2764_PWR_CTRL, TAS2764_PWR_CTRL_MASK, @@ -501,8 +505,10 @@ static int tas2764_codec_probe(struct snd_soc_component *component) tas2764->component = component; - if (tas2764->sdz_gpio) + if (tas2764->sdz_gpio) { gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); + usleep_range(1000, 2000); + } tas2764_reset(tas2764); -- 2.35.1