Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4670842ioa; Wed, 27 Apr 2022 08:37:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw376DpjegYtxPMwUNzAYFmqQUi16alvZwX/luPT4YLYL+lafVf7Ws4SVtWoZdNFzbPYG2J X-Received: by 2002:a65:6e4d:0:b0:39d:a6ce:14dc with SMTP id be13-20020a656e4d000000b0039da6ce14dcmr24408712pgb.476.1651073824595; Wed, 27 Apr 2022 08:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651073824; cv=none; d=google.com; s=arc-20160816; b=BOkuSSo90DEKZZDHF46Q9o5m8F8wPSHuv2fIe+BJNbJCiwkLxrkjPysuhexleVuNaw 8LOtcCjeSO8Zlb4NU90GVnwqmTucaoMsEvv6quTnZ4a/wJGSCczrpqpCu5YRGJ/f1f9c F6XPv5bVJga09zo9o4DuWaqpfLZdaSmz/j/PJUH0gzxqTRrCMjhcezydTaex3lwQnQCY cSAXGU+3CxGkDq9zUTHQWouP/ZqNFRf2Jom/QbdnpbqKoWLbzVHHn6tOouEyr8GKB/Ca QLExiMyNCY09CsbZvRgDyoKjArY6JCe46Ik//wZBnOQJrFzvkE/PXzvtu9o2AzAqP+nr 4gfQ== 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=xLsU6Iv+ZJvxrpEJk5Y3A5YTrieVMpJFBJwo2HpKEV0=; b=GYfXqqrgjKqIGQ0MwSNvJe58ycaVcYQe5/3L3QG5jEtI54Aq0MDzcI1hiqZCw5POdN 08VCXy/1GJYWiCG5oobbMqCSaqOsX59G+PEv7mCpBXc2URNFfO6zr/5jnqwfA/e9qnGl rdo9u62ZViEvTnnJJP9FaNi+HyTx8CMDTqc4nPrzKPAQc3ibgy3LrnUBSEggiEMFtLmF p2Lhsi6SakrZjOcXUQkIPCvxVbu1Vke1L6JIyhfQwwFVe/o/T4vIIWvmHgK0TQ9fmb8K L4OHWVJ5s3zJta0W18tk+lsYfXDtxELL5NMcUWge8O8NI26PcDO/0uWxH+HAuiS4MTAW lU3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=QHdiXIA5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s30-20020a056a00179e00b0050a707536ecsi1919459pfg.299.2022.04.27.08.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:37:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=QHdiXIA5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 291CC2C38CB; Wed, 27 Apr 2022 08:09:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239327AbiD0PM0 (ORCPT + 99 others); Wed, 27 Apr 2022 11:12:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239255AbiD0PLf (ORCPT ); Wed, 27 Apr 2022 11:11:35 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BD817B395 for ; Wed, 27 Apr 2022 08:08:22 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23R6M8vt014103; Wed, 27 Apr 2022 10:07:42 -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=xLsU6Iv+ZJvxrpEJk5Y3A5YTrieVMpJFBJwo2HpKEV0=; b=QHdiXIA5IjZaFJOWrtmP7jRI4pc7KQ3H5r+lY2NwwQq9P2bbGItaHTBpjfqMxm0GxpA+ gyEVvEfWu5Q3AM10PrXOOQudOpwfkouqqLf2ukdo7NMJcTXyWbuwe5kjFoJoUojC4ivl khWzzpGXg6z7sm6/cqb4tynBiRINgLzyN3fBwwuiwnGwRGphJ0wpOdvMAiEjDRc2npNM YbP7+lJDvgMRkze5z27rkXni+Qbv847vJK9oRISYOKqSgGugvNy3uZJyUGxvijCcc+xS Rel6IB+bw8EZxbtR6MU0jn4SZuVejo2XG9A7rxds/YOgc4CMrCb1VY6xX9X08jzgIdL0 dw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3fprt60xth-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 27 Apr 2022 10:07:41 -0500 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_128_GCM_SHA256) id 15.1.2375.24; Wed, 27 Apr 2022 16:07:34 +0100 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.24 via Frontend Transport; Wed, 27 Apr 2022 16:07:34 +0100 Received: from vitaly-Legion-7-16ACHg6.ad.cirrus.com (unknown [198.90.238.170]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D146F478; Wed, 27 Apr 2022 15:07:33 +0000 (UTC) From: Vitaly Rodionov To: Jaroslav Kysela , Takashi Iwai , Mark Brown CC: , , , Stefan Binding Subject: [PATCH 26/26] ALSA: hda: cs35l41: Add kernel config to disable firmware autoload Date: Wed, 27 Apr 2022 16:07:20 +0100 Message-ID: <20220427150720.9194-27-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220427150720.9194-1-vitalyr@opensource.cirrus.com> References: <20220427150720.9194-1-vitalyr@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: dalm5jSeg-rUqnYu-p0YcBP0M-gg_LeU X-Proofpoint-ORIG-GUID: dalm5jSeg-rUqnYu-p0YcBP0M-gg_LeU X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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: Stefan Binding By default, the driver will automatically load DSP firmware for the amps, if available. Adding this option allows the autoload to be optional, which allows for different configurations. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov --- sound/pci/hda/Kconfig | 7 +++++++ sound/pci/hda/cs35l41_hda.c | 12 +++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig index 1c378cca5dac..c4282dec4dd4 100644 --- a/sound/pci/hda/Kconfig +++ b/sound/pci/hda/Kconfig @@ -94,6 +94,13 @@ config SND_HDA_PATCH_LOADER config SND_HDA_SCODEC_CS35L41 tristate +config SND_HDA_SCODEC_CS35L41_DISABLE_FIRMWARE_AUTOSTART + bool "Prevent CS35L41 from starting firmware on boot" + depends on SND_HDA_SCODEC_CS35L41 + help + Say Y here to prevent the CS35L41 HDA driver from loading DSP + Firmware at boot + config SND_HDA_CS_DSP_CONTROLS tristate depends on CS_DSP diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 70e5354e3950..8b9e966145b5 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -773,11 +773,13 @@ static int cs35l41_hda_bind(struct device *dev, struct device *master, void *mas cs35l41->firmware_type = HDA_CS_DSP_FW_SPK_PROT; - cs35l41->request_fw_load = true; - mutex_lock(&cs35l41->fw_mutex); - if (cs35l41_smart_amp(cs35l41) < 0) - dev_warn(cs35l41->dev, "Cannot Run Firmware, reverting to dsp bypass...\n"); - mutex_unlock(&cs35l41->fw_mutex); + if (!IS_ENABLED(CONFIG_SND_HDA_SCODEC_CS35L41_DISABLE_FIRMWARE_AUTOSTART)) { + cs35l41->request_fw_load = true; + mutex_lock(&cs35l41->fw_mutex); + if (cs35l41_smart_amp(cs35l41) < 0) + dev_warn(cs35l41->dev, "Cannot Run Firmware, reverting to dsp bypass...\n"); + mutex_unlock(&cs35l41->fw_mutex); + } cs35l41_create_controls(cs35l41); -- 2.32.0