public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ALSA: hda: cs35l56: Fix missing RESET GPIO if _SUB is missing
@ 2023-09-14 15:25 Richard Fitzgerald
  2023-09-15  8:31 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2023-09-14 15:25 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel, patches, linux-kernel, Richard Fitzgerald

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 <rf@opensource.cirrus.com>
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,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ALSA: hda: cs35l56: Fix missing RESET GPIO if _SUB is missing
  2023-09-14 15:25 [PATCH v2] ALSA: hda: cs35l56: Fix missing RESET GPIO if _SUB is missing Richard Fitzgerald
@ 2023-09-15  8:31 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2023-09-15  8:31 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: tiwai, alsa-devel, patches, linux-kernel

On Thu, 14 Sep 2023 17:25:25 +0200,
Richard Fitzgerald wrote:
> 
> 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 <rf@opensource.cirrus.com>
> Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-15 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 15:25 [PATCH v2] ALSA: hda: cs35l56: Fix missing RESET GPIO if _SUB is missing Richard Fitzgerald
2023-09-15  8:31 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox