Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3213609pxp; Tue, 22 Mar 2022 14:41:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZhKENgj/ZcUgPgiJ0R79imahWr6BDinWHXRrLwreh/kQX3B6LjzE4vwnndj0vlzkqvnKz X-Received: by 2002:a63:4862:0:b0:385:fb1d:fc54 with SMTP id x34-20020a634862000000b00385fb1dfc54mr2402787pgk.57.1647985316131; Tue, 22 Mar 2022 14:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647985316; cv=none; d=google.com; s=arc-20160816; b=wrFwg49pUmR+2Ub4ILxK2ucVBgCb3YqhvkVt6rwMOR+emXHdy/L5gSAF0uXHXl2NRb yzeFTjpmec62sUaDT3p7j6QsStwPH0SF0faCQXrYpylxv/lstI9vFodQSeZMu6uEvQoA 1p0VEKTCw3o10CjEIwKLTpEPUKbIlAWYfhM349W0kp9XsWCLJHEKebSddOoLY4u41EZJ dyuI8eqxMDtwMlbOf6Mmj7aX74n8/gZjP6JKyC1/pNAkEFnKjeWViI/hW+6+rZcLj1gV 46TE/n0/xLPEsigCrtUZo2uW1kua7N9nAR1lPMnnWlJBKUhzKO5HmDab+nRNcho5Lt2a l7UA== 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=tHvVnOC+9G3Hu8w41fGXZGEdPqMVugcJ/G91GRLrkXY=; b=TmdYz5Tt/ZWQhHQCqJAswi/Hokofy+TsSgZI86G9Mc0LfpdSUzyAIN51fPyTH7iv76 dMKnZ/c1t4k5URugMOJttArqXQPbp57O6KjpqfYjh7sflVRxQyb3SchIaR8yG8ppQOoB cgXNzE/c/zRRR4jcdEKP++NVgCWjucXwsNya6IFWrrxyeYFGDUrRjpW8+Wj0F0Up2d1E ZdsNfnDp475DS0tjI2d/PjqojUI6sjrvGRhNLtEposPnRs2OYGljZCZfl+QMoW1e2TUw +R5/tcxA98ZfQEb5LsZK3wEqnU+Y1nc4jm7jjABZc05Mz7SSwXVmBOoYHcofPeO3PByY ofQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=SvPRSWuY; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h26-20020a63121a000000b00381b0adbc75si17527268pgl.354.2022.03.22.14.41.42; Tue, 22 Mar 2022 14:41:56 -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=@cirrus.com header.s=PODMain02222019 header.b=SvPRSWuY; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238607AbiCVPVS (ORCPT + 99 others); Tue, 22 Mar 2022 11:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238417AbiCVPUZ (ORCPT ); Tue, 22 Mar 2022 11:20:25 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E9085C364; Tue, 22 Mar 2022 08:18:58 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22MAwx9B011964; Tue, 22 Mar 2022 10:18:36 -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=tHvVnOC+9G3Hu8w41fGXZGEdPqMVugcJ/G91GRLrkXY=; b=SvPRSWuYHQpP9npmFzheYnkctA02eq+3BCyx7QkskipsYHF8Kl20Dzrtc+HXDehXlaCy D1Zgv5llKXogj5FiFT8I6yUW9f4xHiUqZ2Vqny3o/wXW+LkaPTkd9JX4zeqkBlmacjsL S8zzR+SEGjINonkVeCDel9xL+4x1bay31cYTeRNGRaXHN/z7ODlIjhOCE0vJ4Qogxaq6 7uVT55dabAy82CDScRkpfslhWKNKjmXd+QncOQuJSD1QvQ77DHmCgFKOTDL4Tktj3G7V lyTF4GEHKFz4zipe5EyI5hH3F1rNJ/GVcU7Fg8ZVGLOv0BunvejRdph68BN9gA77HViT cQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3ewck1cb46-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 22 Mar 2022 10:18:36 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 22 Mar 2022 15:18:33 +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.1.2375.18 via Frontend Transport; Tue, 22 Mar 2022 15:18:33 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.125]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2497D459; Tue, 22 Mar 2022 15:18:33 +0000 (UTC) From: Lucas Tanure To: Liam Girdwood , Mark Brown , Rob Herring , Jaroslav Kysela , Takashi Iwai CC: , , , , Lucas Tanure Subject: [PATCH v5 07/16] ALSA: hda: cs35l41: Put the device into safe mode for external boost Date: Tue, 22 Mar 2022 15:18:10 +0000 Message-ID: <20220322151819.4299-8-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220322151819.4299-1-tanureal@opensource.cirrus.com> References: <20220322151819.4299-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: zRUdwvcQUOnfIaqCzsYms0LSjt7eejmy X-Proofpoint-GUID: zRUdwvcQUOnfIaqCzsYms0LSjt7eejmy 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_NONE,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 To facilitate the configuration of external boost devices, put all devices, with or without VSPK switch, into safe mode from the start. That allows the following parts of the driver to handle all external boost devices in the same way. Signed-off-by: Lucas Tanure --- sound/pci/hda/cs35l41_hda.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 0dac622805c4..46e920ec3000 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -109,8 +109,6 @@ static const struct reg_sequence cs35l41_reset_to_safe[] = { }; static const struct cs35l41_hda_reg_sequence cs35l41_hda_reg_seq_no_bst = { - .probe = cs35l41_reset_to_safe, - .num_probe = ARRAY_SIZE(cs35l41_reset_to_safe), .prepare = cs35l41_safe_to_active, .num_prepare = ARRAY_SIZE(cs35l41_safe_to_active), .cleanup = cs35l41_active_to_safe, @@ -224,10 +222,15 @@ static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41) return ret; break; case CS35L41_EXT_BOOST: - cs35l41->reg_seq = &cs35l41_hda_reg_seq_ext_bst; - break; case CS35L41_EXT_BOOST_NO_VSPK_SWITCH: - cs35l41->reg_seq = &cs35l41_hda_reg_seq_no_bst; + if (hw_cfg->bst_type == CS35L41_EXT_BOOST) + cs35l41->reg_seq = &cs35l41_hda_reg_seq_ext_bst; + else + cs35l41->reg_seq = &cs35l41_hda_reg_seq_no_bst; + ret = regmap_multi_reg_write(cs35l41->regmap, cs35l41_reset_to_safe, + ARRAY_SIZE(cs35l41_reset_to_safe)); + if (ret) + return ret; break; default: dev_err(cs35l41->dev, "Boost type %d not supported\n", hw_cfg->bst_type); -- 2.35.1