From patchwork Thu Sep 14 15:25:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 13385633 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 DA756EEAA4E for ; Thu, 14 Sep 2023 15:27:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 477B6950; Thu, 14 Sep 2023 17:26:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 477B6950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1694705220; bh=5Fuq6NekJjS/ad21WuviwNP0E6eGvCdCxtfZMAy3fS0=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=nXqgzT+Qno6HklDJqjm6aAx2s21sk6YZqla5OFVR9+7NYl+H3uvbW7JgCMf2L41FG HuhLI7xlrBiyEh1773tFHczGKtcjvvKbfmoZpTfmr3Mmy+benteooOJYt39uS3QhJT I0c1TGhKJiLGztBuloq7R7tGREjkGhpxvOoTf350= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EEB7CF80552; Thu, 14 Sep 2023 17:25:41 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4DB8AF80425; Thu, 14 Sep 2023 17:25:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 715DFF80141; Thu, 14 Sep 2023 17:25:35 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 24710F80141 for ; Thu, 14 Sep 2023 17:25:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 24710F80141 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=qi+ZUMqO 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 38ECunMr020490; Thu, 14 Sep 2023 10:25:29 -0500 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=q ygg2TVwFG6lKmZeeKC9INbE7+tFtemrFvcVvzZt+To=; b=qi+ZUMqO1tU9ij+0V q5mfM2KtEBchrQTsq7seqoCFLjCKcjm+SFrzGAdgLhQqjy98CzRPVv8oo4SY1aLH vW1OdwLMZUwSbCkfV1bOt7mINd+t+w0Dd8PtqLZuKxY3KzOeDzLCL1/TsS7Bicq5 BW6v57nqHwhdVeiNoiHt2zdNxwcBuZqQdNMAsyEHrvfUqDtP+8+SVQgYiqlIJwNK +u8Qlu2wG0KUwCwxd020b01ZHh3sO2Blg0x+NEINStyYH5d/++1dmChKSpkF/UBC +bq4ZTP72TYMfyX9J54+V8cV5CBPxcmlBotpen3Fsu1Cml5a/EYFMcgWWgo+FCGQ 9tqPA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3t2y7sj9g5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 10:25:28 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Thu, 14 Sep 2023 16:25:27 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Thu, 14 Sep 2023 16:25:27 +0100 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.65.215]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id E561F3563; Thu, 14 Sep 2023 15:25:26 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH v2] ALSA: hda: cs35l56: Fix missing RESET GPIO if _SUB is missing Date: Thu, 14 Sep 2023 16:25:25 +0100 Message-ID: <20230914152525.20829-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-GUID: hvb46J8ibE00wLVH5auGSVmnOad4e6AQ X-Proofpoint-ORIG-GUID: hvb46J8ibE00wLVH5auGSVmnOad4e6AQ X-Proofpoint-Spam-Reason: safe Message-ID-Hash: 2W3PPY4M5CSI3IY67JI6DYH3DT7WG4VO X-Message-ID-Hash: 2W3PPY4M5CSI3IY67JI6DYH3DT7WG4VO X-MailFrom: prvs=46218c6399=rf@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In cs35l56_hda_read_acpi() do not return if ACPI _SUB is missing. A missing _SUB means that the driver cannot load a system-specific firmware, because the firmware is identified by the _SUB. But it can fallback to a generic firmware. Unfortunately this was being handled by immediately returning 0, which would skip the remaining ACPI configuration in cs35l56_hda_read_acpi() and so it would not get the RESET GPIO. Signed-off-by: Richard Fitzgerald Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") --- sound/pci/hda/cs35l56_hda.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c index bc75865b5de8..87ffe8fbff99 100644 --- a/sound/pci/hda/cs35l56_hda.c +++ b/sound/pci/hda/cs35l56_hda.c @@ -865,15 +865,13 @@ static int cs35l56_hda_read_acpi(struct cs35l56_hda *cs35l56, int id) sub = acpi_get_subsystem_id(ACPI_HANDLE(cs35l56->base.dev)); if (IS_ERR(sub)) { - /* If no ACPI SUB, return 0 and fallback to legacy firmware path, otherwise fail */ - if (PTR_ERR(sub) == -ENODATA) - return 0; - else - return PTR_ERR(sub); + dev_info(cs35l56->base.dev, + "Read ACPI _SUB failed(%ld): fallback to generic firmware\n", + PTR_ERR(sub)); + } else { + cs35l56->system_name = sub; } - cs35l56->system_name = sub; - cs35l56->base.reset_gpio = devm_gpiod_get_index_optional(cs35l56->base.dev, "reset", cs35l56->index,