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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 672C5C433EF for ; Wed, 11 May 2022 13:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244274AbiEKN7w (ORCPT ); Wed, 11 May 2022 09:59:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiEKN7s (ORCPT ); Wed, 11 May 2022 09:59:48 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 918AF5B892 for ; Wed, 11 May 2022 06:59:45 -0700 (PDT) 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 Cc: Jaroslav Kysela , Takashi Iwai , Mark Brown , , , , Stefan Binding 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >