Skip to content

Commit 581523e

Browse files
Stefan Bindingtiwai
authored andcommitted
ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type
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> Link: https://lore.kernel.org/r/20230823143956.755758-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent a057efd commit 581523e

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

sound/pci/hda/cs35l41_hda_property.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,37 @@ static int lenovo_legion_no_acpi(struct cs35l41_hda *cs35l41, struct device *phy
4343
return 0;
4444
}
4545

46+
/*
47+
* Device 103C89C6 does have _DSD, however it is setup to use the wrong boost type.
48+
* We can override the _DSD to correct the boost type here.
49+
* Since this laptop has valid ACPI, we do not need to handle cs-gpios, since that already exists
50+
* in the ACPI.
51+
*/
52+
static int hp_vision_acpi_fix(struct cs35l41_hda *cs35l41, struct device *physdev, int id,
53+
const char *hid)
54+
{
55+
struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg;
56+
57+
dev_info(cs35l41->dev, "Adding DSD properties for %s\n", cs35l41->acpi_subsystem_id);
58+
59+
cs35l41->index = id;
60+
cs35l41->channel_index = 0;
61+
cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 1, GPIOD_OUT_HIGH);
62+
cs35l41->speaker_id = -ENOENT;
63+
hw_cfg->spk_pos = cs35l41->index ? 1 : 0; // right:left
64+
hw_cfg->gpio1.func = CS35L41_NOT_USED;
65+
hw_cfg->gpio1.valid = true;
66+
hw_cfg->gpio2.func = CS35L41_INTERRUPT;
67+
hw_cfg->gpio2.valid = true;
68+
hw_cfg->bst_type = CS35L41_INT_BOOST;
69+
hw_cfg->bst_ind = 1000;
70+
hw_cfg->bst_ipk = 4500;
71+
hw_cfg->bst_cap = 24;
72+
hw_cfg->valid = true;
73+
74+
return 0;
75+
}
76+
4677
struct cs35l41_prop_model {
4778
const char *hid;
4879
const char *ssid;
@@ -53,6 +84,7 @@ struct cs35l41_prop_model {
5384
static const struct cs35l41_prop_model cs35l41_prop_model_table[] = {
5485
{ "CLSA0100", NULL, lenovo_legion_no_acpi },
5586
{ "CLSA0101", NULL, lenovo_legion_no_acpi },
87+
{ "CSC3551", "103C89C6", hp_vision_acpi_fix },
5688
{}
5789
};
5890

0 commit comments

Comments
 (0)