From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B5FBC4332F for ; Wed, 11 May 2022 14:00:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 710C319FD; Wed, 11 May 2022 15:59:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 710C319FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652277643; bh=vK1kRsag3lSgeoS9hZDo+H/P8T8MGCziBz2HS8Ai4kA=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WzQ82pGX8cgmkSFINkUj31EDZtNemA6xDRuKYBlJQ0Ujj0mLG3CU6xI7WsJ0gxjvt I5M1Fd98IMFTHuhVpR2U5CHLmusXnnc789m47sttsm2n6jihhutYbnzviDZAFPBzvP 2SnsaVYtClDGF/OFrF56FIYIicnnPKly06RHRrGc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 17E61F80137; Wed, 11 May 2022 15:59:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 42645F8015B; Wed, 11 May 2022 15:59:51 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3C9FEF8011C for ; Wed, 11 May 2022 15:59:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3C9FEF8011C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="iKyMbKi+"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="qdHT3wGt" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id AA3EA1F8FD; Wed, 11 May 2022 13:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1652277584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3IAuAdLAPrRap/1eVwSZb/4jgOT/frXDQVoc9rv4dmI=; b=iKyMbKi+HIoyQn3/gc5uST6kKagIFOdcEKS5cCeDwhpdPCHzJsKqbDs+dDYM/V0U78hwbq oiFPNy/yiIxuyEHJRwh2EUBpfkH8tM14ZurgDjlZsuIxwiwhduO1AQ7XsoiHkQGa8iiLno NXJzZ3fWuut5Br7aXs/YBQVY7hSircQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1652277584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3IAuAdLAPrRap/1eVwSZb/4jgOT/frXDQVoc9rv4dmI=; b=qdHT3wGt1rqVtNBBPvkn4p2w/msL6mqNltosNblfKNfq3Q4vRFsyeqeeTG+wqjzhSgZWqY bBQmerEuv/nMCqDg== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 9FEAC2C141; Wed, 11 May 2022 13:59:44 +0000 (UTC) Date: Wed, 11 May 2022 15:59:44 +0200 Message-ID: From: Takashi Iwai To: Vitaly Rodionov Subject: Re: [PATCH v2 26/26] ALSA: hda: cs35l41: Add kernel config to disable firmware autoload In-Reply-To: <20220509214703.4482-27-vitalyr@opensource.cirrus.com> References: <20220509214703.4482-1-vitalyr@opensource.cirrus.com> <20220509214703.4482-27-vitalyr@opensource.cirrus.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, patches@opensource.cirrus.com, Takashi Iwai , linux-kernel@vger.kernel.org, Stefan Binding , Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, 09 May 2022 23:47:03 +0200, Vitaly Rodionov wrote: > > 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. Shouldn't this be rather a runtime option instead of a build-time kconfig? thanks, Takashi > 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.34.1 >