Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp508034rdh; Thu, 26 Oct 2023 08:08:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZHAwvXA4nZ33DysL0VdnVCd+n/Wnq8geytBREyOhBq4XSP1DekR+NUJEavtUK5Ili4H3J X-Received: by 2002:a05:690c:dd5:b0:5a7:ba54:aef5 with SMTP id db21-20020a05690c0dd500b005a7ba54aef5mr23063436ywb.21.1698332881759; Thu, 26 Oct 2023 08:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698332881; cv=none; d=google.com; s=arc-20160816; b=eJhDNg0BNshjaVQbdE7qf1EcM4AaltWxl8ZjzXxg4vb0n7/IRfLqNzL0pJRcWpyOFG pZ/JMBesjakljauaRL0B2auBqI57V+an5t1mK35Fn0tkRLNS/W6ZWluYrloqD9TvGpF3 JgzheuXZ2t8XS5YmiS/FkYWiF1EeykgQbe+gavvJ71s97BigSumysfGg3FIlxC0vUkZu j/y9pXRA7N8hJMpfeFwfMmvFMYN+9yBXH6zzhJKkMF3dpLx6cJj/Vy7QHjGcGxCm52FH Foq9ZXg8AB+7Vo40yW/PuDn0cPtyOjnpDkuu+f4IwQq0+Gdt65NIibWRa8aImBBCBzLQ A6lw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y/+iYEq7Uz9EyfpgC4lWXIhIUHrMcz4eog7gtduIurE=; fh=y3oybkrdZxE3fwRrgMoD4JRx3sGrakW3YmAJUjOUrk0=; b=KkjJbOrJZxTk25eH8Yt07jVY8qL5bzAclz8P0mh/j9d+N/PcqyMTBO1NTkcnuOxyL9 i6X5Zbn+3nJgxcoSFVA76mM09CByk9HfQi93X0A430sqtQf1aQFWDMFccYoALk7aNNue kEXQAzAez4C8McYhSZtsKALXiC8IL0IoIqLNvOBi/y7VWFnwjfJ2y4eEDAxy+MDZuv6t Gr0dOlX+hH1GBWziGE6norsMZ6vwAic/LdktjGh4zRXd05AMFK2ZNJg35GZc+HvCVGff CDLVOk3PXoNHvw442YRePISNmZPzlqfikRq6TAVIoxG5tpQsJzi/aQqg731o/puOdNnQ XUgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Y2tQxHdD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id h3-20020a815303000000b005a7c656c841si14360214ywb.204.2023.10.26.08.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 08:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Y2tQxHdD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6EB3C8220118; Thu, 26 Oct 2023 08:07:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345424AbjJZPGy (ORCPT + 99 others); Thu, 26 Oct 2023 11:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345361AbjJZPGe (ORCPT ); Thu, 26 Oct 2023 11:06:34 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECBC71AB; Thu, 26 Oct 2023 08:06:30 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 39Q5GUrg011654; Thu, 26 Oct 2023 10:06:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=y/+iYEq7Uz9EyfpgC4lWXIhIUHrMcz4eog7gtduIurE=; b= Y2tQxHdDaqXmoe9FKYwcQLqkwBNM+NVEnK9gUoMq/ETN2DvzZsr9CQ8n+A6u3aCX wsOkXO21KwIsAlL60f1vFpDIvkxI8DA6GtIL6DXKXDaKIV9A5wGVNWn7FZE8KaYh +2wVTmiptV7q0qOxZ19mBcxJgf2kLVJb5x9H+qEc4/W4USgOkUHK+oK3wxjL6/CH lz161+ZhDMBS07gpwSRd7AD6/5HuD4InZu8dE3oHgz9GAEPPIO/EQ34PliRQwdVd CtEX7nedCc7JImkhLHU1foWNI10h0bUUbKOgOgSl9VcOhQKwe/bTV6aR5ab+kFA7 3tuWIUoLsjzfyL4nYQkDXQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3tvc1x94k9-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Oct 2023 10:06:13 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Thu, 26 Oct 2023 16:06:08 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Thu, 26 Oct 2023 16:06:08 +0100 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.177]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id E0E5611AA; Thu, 26 Oct 2023 15:06:07 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai , "Mark Brown" CC: , , , , "Stefan Binding" Subject: [PATCH v1 3/8] ALSA: hda: cs35l41: Assert Reset prior to de-asserting in probe and system resume Date: Thu, 26 Oct 2023 16:05:53 +0100 Message-ID: <20231026150558.2105827-4-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026150558.2105827-1-sbinding@opensource.cirrus.com> References: <20231026150558.2105827-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: NaKD-yWniZCNpH7nPU9j1Sl85JO_MLNV X-Proofpoint-ORIG-GUID: NaKD-yWniZCNpH7nPU9j1Sl85JO_MLNV X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 26 Oct 2023 08:07:26 -0700 (PDT) To ensure we are in a known state, exiting from reset at the point of probe or in system resume, assert reset before we de-assert it. Since the BIOS may enter into a pre-boot environment to control the amps (for example for boot beep), we need to ensure we start from a known, reset state prior to probe or system resume. Signed-off-by: Stefan Binding --- sound/pci/hda/cs35l41_hda.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 919e38213975..1ac721085fb5 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -840,6 +840,7 @@ static int cs35l41_system_resume(struct device *dev) } if (cs35l41->reset_gpio) { + gpiod_set_value_cansleep(cs35l41->reset_gpio, 0); usleep_range(2000, 2100); gpiod_set_value_cansleep(cs35l41->reset_gpio, 1); } @@ -1693,6 +1694,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i } } if (cs35l41->reset_gpio) { + gpiod_set_value_cansleep(cs35l41->reset_gpio, 0); usleep_range(2000, 2100); gpiod_set_value_cansleep(cs35l41->reset_gpio, 1); } -- 2.34.1