Message ID | 20231117163609.823627-1-sbinding@opensource.cirrus.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp657505vqn; Fri, 17 Nov 2023 08:37:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHk5qFZyd7X3ro3jw3XL56rx+hxENKlY+HP+vhJ3pjdH3xXRfNfSqD8GFxbz9i3HvuoGRZE X-Received: by 2002:a17:902:a985:b0:1cc:58f1:8646 with SMTP id bh5-20020a170902a98500b001cc58f18646mr79983plb.50.1700239062660; Fri, 17 Nov 2023 08:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700239062; cv=none; d=google.com; s=arc-20160816; b=QGhuyr/y3Sk8oEyKIeXfXPAGrMfEN31on6fc7b2heUk06D2CMxNTyPz8oeUkeJnIhH 83/o7kBNW9ayCATHLK8j64dpMUKs7hXI+BTcodPic00j7k5WNuNiT99rpKwqW9dDykh4 B+EBk0eYg7Jp1Ykb5R2b2UZ/aXBTJzMWEVtk704JDUQ4EauvlgymUZZkydqF3tvxooyr okejHbEyZY7QkFbp9GvHdxa8GfBpCT6Jqk527kf8Dw/11EuzzkbC5nyBwaDKC/ULWA7a XSAFePs1r/qZzDBwTeGUHUpJN0LJLYNA+eBtQUvmQd/toePfg63Mf+Diy//p6OIihVcA 8+uQ== 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=+h8A2Q5BPK15jigOBd8bxNYR8QvhfpYsQGQgKXTnliM=; fh=cpd6h5xMdmzuGST2FDaWAhhre4GA/isgFZt04DpKlWI=; b=xJmbrYHwdeTjuZ3hyv1NPhYPM7XRfsztE3ndQD7st2D6Rg6WB6+Kn7hHPa0N00Qtot CRyemwRVAfBOZki1SJgdWmwl6hpt07GZV9yTnn6ioXzTLnUstUcflEnqizAlqwzsaZoD 9UPzQ7ka2zRyGA3lt1RJJaONpIo4r1zuZuypXMptYcfgnqt5Y2GR3dQvVi3vrspo+CkL SOG6SGRqDLXvmlsat1yzlGvQTzapOMOWUHSZAZ14T3AxRpx+BhwiMk3WkMYbeOD1yG8Y fPJ8Qgb6HFg7BTtQ5yWJVXw/i+L5aB+/q/cliZbs4V0ynefGdNUTaD/3wATc6GbVU2tz rmBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=dt5NOx9J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e6-20020a170902d38600b001b878f9e11csi2123224pld.54.2023.11.17.08.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:37:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=dt5NOx9J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 2C47D808E67D; Fri, 17 Nov 2023 08:36:46 -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 S231623AbjKQQgl (ORCPT <rfc822;jaysivo@gmail.com> + 30 others); Fri, 17 Nov 2023 11:36:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231693AbjKQQgk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 17 Nov 2023 11:36:40 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B59D4B; Fri, 17 Nov 2023 08:36:36 -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 3AHFq7av014874; Fri, 17 Nov 2023 10:36:19 -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=+ h8A2Q5BPK15jigOBd8bxNYR8QvhfpYsQGQgKXTnliM=; b=dt5NOx9J7IuCgEAZH GXtYZqnsLoaD2zRsltdBZHZMqmlprQdG9kV/ntz3JfVHChLP4wgVwLSH08J1jk1o yHqGV183XYVE4FnKN7Hym6391rpaH0juEIIF8Ow8KVlz5yxaSHS59iEcQz4zScd+ D0b4psfRIT9fAq7Qk1ncQT/Ybu62PneWSUp5fhaWPJ0JLPZdbJEQWKPzajE08PCL bW8JSoebTdeE1gSeFXs7/oQ0rYfDB0OirhLwCauu34uPaHtAmZcODP955y6g78T4 TZtkVn6SUTIV3EW6aZQ0kehA6zPEhiHjsz1qGMJcp/vsYmz1u74UWUi/XRDJux54 dBpdA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3ua6wpfrca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 10:36:19 -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; Fri, 17 Nov 2023 16:36:17 +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; Fri, 17 Nov 2023 16:36:16 +0000 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.225]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2248415B9; Fri, 17 Nov 2023 16:36:17 +0000 (UTC) From: Stefan Binding <sbinding@opensource.cirrus.com> To: Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, "Takashi Iwai" <tiwai@suse.com> CC: <alsa-devel@alsa-project.org>, <linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>, "Stefan Binding" <sbinding@opensource.cirrus.com> Subject: [PATCH v2 0/2] ALSA: cs35l41: prevent old firmwares using unsupported commands Date: Fri, 17 Nov 2023 16:36:07 +0000 Message-ID: <20231117163609.823627-1-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: jgTLt9TbNllyPY7cqshwiJ9XTZf5QAVM X-Proofpoint-ORIG-GUID: jgTLt9TbNllyPY7cqshwiJ9XTZf5QAVM X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> 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]); Fri, 17 Nov 2023 08:36:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782829875721372402 X-GMAIL-MSGID: 1782829875721372402 |
Series |
ALSA: cs35l41: prevent old firmwares using unsupported commands
|
|
Message
Stefan Binding
Nov. 17, 2023, 4:36 p.m. UTC
Some systems use older firmware which does not support newer commands which are used to enable external boost. For those systems, we can workaround this by writing the registers directly. We can use the firmware version, stored inside cs_dsp, to determine whether or not the command is supported. To achieve this, it requires a cleanup in the api, to pass the cs_dsp struct into the function. We can also remove the redundant boolean firmware_running from the HDA driver, and use the equivalent state inside cs_dsp. Changes since V1: - Added fixes tag to all patches - patches rebased after v6.7 release Stefan Binding (2): ALSA: hda: cs35l41: Remove unnecessary boolean state variable firmware_running ALSA: cs35l41: Fix for old systems which do not support command include/sound/cs35l41.h | 2 +- sound/pci/hda/cs35l41_hda.c | 28 ++++++++++++---------------- sound/soc/codecs/cs35l41-lib.c | 6 ++++-- sound/soc/codecs/cs35l41.c | 4 ++-- 4 files changed, 19 insertions(+), 21 deletions(-)
Comments
On Fri, 17 Nov 2023 17:36:07 +0100, Stefan Binding wrote: > > Some systems use older firmware which does not support newer commands > which are used to enable external boost. For those systems, we can > workaround this by writing the registers directly. > > We can use the firmware version, stored inside cs_dsp, to determine > whether or not the command is supported. > To achieve this, it requires a cleanup in the api, to pass the cs_dsp > struct into the function. > > We can also remove the redundant boolean firmware_running from the HDA > driver, and use the equivalent state inside cs_dsp. > > Changes since V1: > - Added fixes tag to all patches > - patches rebased after v6.7 release > > Stefan Binding (2): > ALSA: hda: cs35l41: Remove unnecessary boolean state variable > firmware_running > ALSA: cs35l41: Fix for old systems which do not support command Both patches applied now. Thanks. Takashi