diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index cce27a86267f..d6bca9d1c047 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -307,6 +307,8 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i size_t nval; int i, ret; + printk("CSC3551: probing %s\n", hid); + adev = acpi_dev_get_first_match_dev(hid, NULL, -1); if (!adev) { dev_err(cs35l41->dev, "Failed to find an ACPI device for %s\n", hid); @@ -420,6 +422,14 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i * And devm functions expect that the device requesting the resource has the correct * fwnode. */ + + printk("CSC3551: no_acpi_dsd: %s\n", hid); + + /* TODO: This is a hack. */ + if (strncmp(hid, "CSC3551", 7) == 0) { + goto csc3551; + } + if (strncmp(hid, "CLSA0100", 8) != 0) return -EINVAL; @@ -435,6 +445,57 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i put_device(physdev); return 0; + + csc3551: + + printk("CSC3551: id == 0x%x\n", id); + + // cirrus,dev-index + if(id == 0x40) + cs35l41->index = 0; + else + cs35l41->index = 1; + + cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, cs35l41->index, GPIOD_OUT_LOW); + + printk("CS3551: reset_gpio == 0x%x\n", cs35l41->reset_gpio); + + // cirrus,speaker-position + if(cs35l41->index == 0) + hw_cfg->spk_pos = 0; + else + hw_cfg->spk_pos = 1; + + // cirrus,gpio1-func + hw_cfg->gpio1.func = 1; + hw_cfg->gpio1.valid = true; + + // cirrus,gpio2-func + hw_cfg->gpio2.func = 0x02; + hw_cfg->gpio2.valid = true; + + // cirrus,boost-peak-milliamp + hw_cfg->bst_ipk = -1; + + // cirrus,boost-ind-nanohenry + hw_cfg->bst_ind = -1; + + // cirrus,boost-cap-microfarad + hw_cfg->bst_cap = -1; + + if (hw_cfg->bst_ind > 0 || hw_cfg->bst_cap > 0 || hw_cfg->bst_ipk > 0) + hw_cfg->bst_type = CS35L41_INT_BOOST; + else + hw_cfg->bst_type = CS35L41_EXT_BOOST; + + hw_cfg->valid = true; + + put_device(physdev); + + printk("CSC3551: Done.\n"); + + return 0; + } int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int irq, diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 1ae9674fa8a3..6d73caa9c6b1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -9455,6 +9455,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), + SND_PCI_QUIRK(0x17aa, 0x386f, "Legion 7 16IAX7", ALC287_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),