* [PATCH v1] ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type
@ 2023-08-23 14:39 Stefan Binding
2023-08-24 7:53 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Binding @ 2023-08-23 14:39 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai
Cc: alsa-devel, linux-kernel, patches, Stefan Binding
CS35L41 HDA driver requires ACPI to contain correct _DSD properties to
correctly configure the device. Whilst the HP Zbook Fury 17 G9 contains
valid _DSD properties, the boost type has been configured incorrectly
in the _DSD for this laptop. We can override these properties to fix
the boost type.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
sound/pci/hda/cs35l41_hda_property.c | 32 ++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c
index 9b5a1d61575e..b62a4e6968e2 100644
--- a/sound/pci/hda/cs35l41_hda_property.c
+++ b/sound/pci/hda/cs35l41_hda_property.c
@@ -43,6 +43,37 @@ static int lenovo_legion_no_acpi(struct cs35l41_hda *cs35l41, struct device *phy
return 0;
}
+/*
+ * Device 103C89C6 does have _DSD, however it is setup to use the wrong boost type.
+ * We can override the _DSD to correct the boost type here.
+ * Since this laptop has valid ACPI, we do not need to handle cs-gpios, since that already exists
+ * in the ACPI.
+ */
+static int hp_vision_acpi_fix(struct cs35l41_hda *cs35l41, struct device *physdev, int id,
+ const char *hid)
+{
+ struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg;
+
+ dev_info(cs35l41->dev, "Adding DSD properties for %s\n", cs35l41->acpi_subsystem_id);
+
+ cs35l41->index = id;
+ cs35l41->channel_index = 0;
+ cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 1, GPIOD_OUT_HIGH);
+ cs35l41->speaker_id = -ENOENT;
+ hw_cfg->spk_pos = cs35l41->index ? 1 : 0; // right:left
+ hw_cfg->gpio1.func = CS35L41_NOT_USED;
+ hw_cfg->gpio1.valid = true;
+ hw_cfg->gpio2.func = CS35L41_INTERRUPT;
+ hw_cfg->gpio2.valid = true;
+ hw_cfg->bst_type = CS35L41_INT_BOOST;
+ hw_cfg->bst_ind = 1000;
+ hw_cfg->bst_ipk = 4500;
+ hw_cfg->bst_cap = 24;
+ hw_cfg->valid = true;
+
+ return 0;
+}
+
struct cs35l41_prop_model {
const char *hid;
const char *ssid;
@@ -53,6 +84,7 @@ struct cs35l41_prop_model {
static const struct cs35l41_prop_model cs35l41_prop_model_table[] = {
{ "CLSA0100", NULL, lenovo_legion_no_acpi },
{ "CLSA0101", NULL, lenovo_legion_no_acpi },
+ { "CSC3551", "103C89C6", hp_vision_acpi_fix },
{}
};
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type
2023-08-23 14:39 [PATCH v1] ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type Stefan Binding
@ 2023-08-24 7:53 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2023-08-24 7:53 UTC (permalink / raw)
To: Stefan Binding
Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel, patches
On Wed, 23 Aug 2023 16:39:56 +0200,
Stefan Binding wrote:
>
> CS35L41 HDA driver requires ACPI to contain correct _DSD properties to
> correctly configure the device. Whilst the HP Zbook Fury 17 G9 contains
> valid _DSD properties, the boost type has been configured incorrectly
> in the _DSD for this laptop. We can override these properties to fix
> the boost type.
>
> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Thanks, applied now.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-24 7:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23 14:39 [PATCH v1] ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type Stefan Binding
2023-08-24 7:53 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox