Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp476709rdf; Tue, 21 Nov 2023 07:44:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcsWJ3LEsID7tYJstF93Rc2H3fBWxDWhvPEr3ss6f5Y29Ac1MOv4EpkVhucgCZ5WXleJQe X-Received: by 2002:a17:902:c94b:b0:1cf:6b9d:ede5 with SMTP id i11-20020a170902c94b00b001cf6b9dede5mr4620598pla.20.1700581480121; Tue, 21 Nov 2023 07:44:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700581480; cv=none; d=google.com; s=arc-20160816; b=FtK6tJESskvwoB9m5RT2m+K50xYyBVLO/OnezlRAmS7z/AARmcj90YGvTXMIHtYFAi lCtfnlUXSnlAK17bVvCMzoQ1+hVrBQ3c3QV0ca37+DZ/z1kivb5Ap4x6AZ0PBzmZkUOY 4mwPyBAtuQGAI9F25oD57E2rAA0FyXt7mPQL6lSJ8Yn+rNyErFyw9Ht0lw5bLFBNNLN7 FEaQMfDRkOVb3bYoUJEtSKOxdURv6RZOvB1GG3mwMlz9Th55cHEnBIj1NxX2mYEI6wO7 Xcl8AAG8dgzQws7ZnNUoXkb5RnipIGFVqTStyiLrLnHacwFy/7ymdlV7N53MrfBLkhc+ tbzQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=tf4vV/JGXrNZcmaJSXi5sFq5mqc/1CJfPKpZ9T2m2+c=; fh=UcRs/avYcQW3IOGijHtjJk2S4icNlTCLLX3PL3Ze8y4=; b=Mhq7kca02nXT+wtRuZk4e5C71eeItk+Z+al0MMGocOysRTIl2pp7Lythqpn8KuTTqv ET4dO2/A8sxazIRaTiE09JMEgJLOaWjwtC+RlmmbJGkDsOmYz2aUV02zp80NLfhJjCNn 7rs8avSPRKelt7fTMHSWQ2nOzatx6GQGcieUzwcY1EWMdTQxrhwWWdEYVRbkDw2AfDzH 0Yw8XoElY58S1RVVRPzR10pelWUMBTSh0DepBwupBz5Kej1hmOsIq4tstf64JHytowSR zmdMRqM/IpJkqyVeWxYl8AklCxEN6QX3DpK4EVORrhcR8WIz0InIQvPmmGPE9guKqcGh Hu1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lelqUOS2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bg4-20020a1709028e8400b001c566ea86eesi10303105plb.177.2023.11.21.07.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 07:44:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lelqUOS2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 26E1C807756B; Tue, 21 Nov 2023 07:44:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234494AbjKUPoh (ORCPT + 99 others); Tue, 21 Nov 2023 10:44:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230509AbjKUPoh (ORCPT ); Tue, 21 Nov 2023 10:44:37 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 807A697; Tue, 21 Nov 2023 07:44:33 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3AL50Bcw022405; Tue, 21 Nov 2023 09:44:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=t f4vV/JGXrNZcmaJSXi5sFq5mqc/1CJfPKpZ9T2m2+c=; b=lelqUOS2eeAEi2KwN a1Ml983FjtjOJX78sgho9xMQYWqz+83e258nyndiR/eDl3x/sQ61Pi1Ouwal0K05 JyIK6rEaSzcPtwYzNUA2SfELMiwk+gO2lzP5uESRo6EyIJYUdwZ6H1xnOWq7cMTM XBa0zEBaQGddDLzqAIhedHTBOrX0VghWYElZcZEEgrLIv88GjxKWT/rgHGard253 x72o/4zv9y4gwCOuN2M2VcBwQHaIrnitf/GEYimFGXnkvezjD7PTvJfgq8l6uVxp FWOnrljYsk4A2B2BOgQotjFh9MeLQ4TvfJAHrjbcoURPtDPpjAqWRYx35714BEwI YubJQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3uetjpbc77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 09:44:25 -0600 (CST) Received: from ediex01.ad.cirrus.com (198.61.84.80) 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.39; Tue, 21 Nov 2023 15:44:23 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.39 via Frontend Transport; Tue, 21 Nov 2023 15:44:23 +0000 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.65.98]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 6E158B12; Tue, 21 Nov 2023 15:44:23 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , , "Richard Fitzgerald" Subject: [PATCH] ALSA: hda: cs35l56: Enable low-power hibernation mode on SPI Date: Tue, 21 Nov 2023 15:44:19 +0000 Message-ID: <20231121154419.19435-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: IDFertXpDvP9COE2sNlOkT0gzg_1l1BG X-Proofpoint-ORIG-GUID: IDFertXpDvP9COE2sNlOkT0gzg_1l1BG X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 07:44:39 -0800 (PST) SPI hibernation is now supported with the latest hibernation/wake sequences in the shared ASoC code. This has a functional dependency on two commits: commit 3df761bdbc8b ("ASoC: cs35l56: Wake transactions need to be issued twice") commit a47cf4dac7dc ("ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate") To protect against this, enabling hibernation is conditional on CS35L56_WAKE_HOLD_TIME_US being defined, which indicates that the new hibernation sequences are available. Signed-off-by: Richard Fitzgerald --- sound/pci/hda/cs35l56_hda_spi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/pci/hda/cs35l56_hda_spi.c b/sound/pci/hda/cs35l56_hda_spi.c index 756aec342eab..27d7fbc56b4c 100644 --- a/sound/pci/hda/cs35l56_hda_spi.c +++ b/sound/pci/hda/cs35l56_hda_spi.c @@ -21,6 +21,10 @@ static int cs35l56_hda_spi_probe(struct spi_device *spi) return -ENOMEM; cs35l56->base.dev = &spi->dev; + +#ifdef CS35L56_WAKE_HOLD_TIME_US + cs35l56->base.can_hibernate = true; +#endif cs35l56->base.regmap = devm_regmap_init_spi(spi, &cs35l56_regmap_spi); if (IS_ERR(cs35l56->base.regmap)) { ret = PTR_ERR(cs35l56->base.regmap); -- 2.30.2