Re: [PATCH v1] ASoC: cs35l41: Fallback to using HID for system_name if no SUB is available

From: André Almeida
Date: Wed Feb 05 2025 - 12:03:03 EST


Hi Stefan,

Em 05/02/2025 13:48, Stefan Binding escreveu:
For systems which load firmware on the cs35l41 which use ACPI, the
_SUB value is used to differentiate firmware and tuning files for the
individual systems. In the case where a system does not have a _SUB
defined in ACPI node for cs35l41, there needs to be a fallback to
allow the files for that system to be differentiated. Since all
ACPI nodes for cs35l41 should have a HID defined, the HID should be a
safe option.

Signed-off-by: Stefan Binding <sbinding@xxxxxxxxxxxxxxxxxxxxx>
---
sound/soc/codecs/cs35l41.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
index 07a5cab35fe1..30b89018b113 100644
--- a/sound/soc/codecs/cs35l41.c
+++ b/sound/soc/codecs/cs35l41.c
@@ -1150,19 +1150,28 @@ static int cs35l41_dsp_init(struct cs35l41_private *cs35l41)
static int cs35l41_acpi_get_name(struct cs35l41_private *cs35l41)
{
- acpi_handle handle = ACPI_HANDLE(cs35l41->dev);
+ struct acpi_device *adev = ACPI_COMPANION(cs35l41->dev);
+ acpi_handle handle = acpi_device_handle(adev);
+ const char *hid;

I think *hid and *sub can be in the same line.

Apart from that,

Reviewed-by: André Almeida <andrealmeid@xxxxxxxxxx>
Tested-by: André Almeida <andrealmeid@xxxxxxxxxx> (Steam Deck OLED)