diff options
Diffstat (limited to '0001-ALSA-hda-cs35l41-Support-ASUS-2023-laptops-with-miss.patch')
-rw-r--r-- | 0001-ALSA-hda-cs35l41-Support-ASUS-2023-laptops-with-miss.patch | 92 |
1 files changed, 47 insertions, 45 deletions
diff --git a/0001-ALSA-hda-cs35l41-Support-ASUS-2023-laptops-with-miss.patch b/0001-ALSA-hda-cs35l41-Support-ASUS-2023-laptops-with-miss.patch index 3ab4b163498b..aaafe28c8ab7 100644 --- a/0001-ALSA-hda-cs35l41-Support-ASUS-2023-laptops-with-miss.patch +++ b/0001-ALSA-hda-cs35l41-Support-ASUS-2023-laptops-with-miss.patch @@ -1,8 +1,8 @@ -From d99738ad5dd159028f354c1ece9eddabd16a0ed9 Mon Sep 17 00:00:00 2001 +From 34713cb8d4e13bf9e3b1403cdea9551e0532ec5c Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" <luke@ljones.dev> Date: Wed, 23 Aug 2023 11:05:59 +1200 -Subject: [PATCH] ALSA: hda: cs35l41: Support ASUS 2023 laptops with missing - DSD +Subject: [PATCH v2 2/2] ALSA: hda: cs35l41: Support ASUS 2023 laptops with + missing DSD Support adding the missing DSD properties required for ASUS ROG 2023 laptops and other ASUS laptops to properly utilise the cs35l41. @@ -19,6 +19,7 @@ The currently added laptops are: - ASUS G634J, spi - ASUS G614JI, spi - ASUS G713P, i2c +- ASUS H7604JV, spi The SPI connected amps may be required to use an external DSD patch to fix or add the "cs-gpios" property. @@ -28,55 +29,55 @@ Signed-off-by: Jonathan LoBue <jlobue10@gmail.com> Co-developed-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- - sound/pci/hda/cs35l41_hda_property.c | 54 ++++++++++++++++++++++++++++ - 1 file changed, 54 insertions(+) + sound/pci/hda/cs35l41_hda_property.c | 53 ++++++++++++++++++++++++++++ + 1 file changed, 53 insertions(+) diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c -index 673f23257a09..2bf2365cef50 100644 +index 673f23257a09..b06e8ca5f4b4 100644 --- a/sound/pci/hda/cs35l41_hda_property.c +++ b/sound/pci/hda/cs35l41_hda_property.c -@@ -43,6 +43,49 @@ static int lenovo_legion_no_acpi(struct cs35l41_hda *cs35l41, struct device *phy +--- cs35l41_hda_property.c.orig 2023-10-23 05:11:21.000000000 +0700 ++++ cs35l41_hda_property.c 2023-10-25 10:09:57.694887542 +0700 +@@ -74,6 +74,47 @@ static int hp_vision_acpi_fix(struct cs3 return 0; } -+static int asus_rog_2023_i2c_no_acpi(struct cs35l41_hda *cs35l41, struct device *physdev, int id, -+ const char *hid) -+{ -+ struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; -+ -+ /* check I2C address to assign the index */ -+ cs35l41->index = id == 0x40 ? 0 : 1; -+ cs35l41->channel_index = 0; -+ cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH); -+ cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 2); -+ hw_cfg->spk_pos = cs35l41->index; -+ hw_cfg->gpio2.func = CS35L41_INTERRUPT; -+ hw_cfg->gpio2.valid = true; -+ hw_cfg->bst_type = CS35L41_EXT_BOOST_NO_VSPK_SWITCH; -+ hw_cfg->valid = true; -+ -+ return 0; -+} -+ +/* -+ * Some SPI connected versions may be missing a chip select GPIO and require a DSD table patch. ++ * The CSC3551 is used in almost the entire ASUS ROG laptop range in 2023, this is likely to ++ * also include many non ROG labelled laptops. It is also used with either I2C connection or ++ * SPI connection. The SPI connected versions may be missing a chip select GPIO and require ++ * an DSD table patch. + */ -+static int asus_rog_2023_spi_no_acpi(struct cs35l41_hda *cs35l41, struct device *physdev, int id, ++static int asus_rog_2023_spkr_id2(struct cs35l41_hda *cs35l41, struct device *physdev, int id, + const char *hid) +{ + struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; ++ int reset_gpio = 0; ++ int spkr_gpio = 2; + -+ /* check SPI address to assign the index */ -+ cs35l41->index = id == 0 ? 0 : 1; ++ /* check SPI or I2C address to assign the index */ ++ cs35l41->index = (id == 0 || id == 0x40) ? 0 : 1; + cs35l41->channel_index = 0; -+ cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH); -+ cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 2); + hw_cfg->spk_pos = cs35l41->index; + hw_cfg->bst_type = CS35L41_EXT_BOOST; + hw_cfg->gpio1.func = CS35l41_VSPK_SWITCH; + hw_cfg->gpio1.valid = true; + hw_cfg->gpio2.func = CS35L41_INTERRUPT; + hw_cfg->gpio2.valid = true; ++ ++ if (strcmp(cs35l41->acpi_subsystem_id, "10431483") == 0) ++ spkr_gpio = 1; ++ cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, spkr_gpio); ++ ++ if (strcmp(cs35l41->acpi_subsystem_id, "10431463") == 0) ++ reset_gpio = 0; ++ else if (strcmp(cs35l41->acpi_subsystem_id, "10431473") == 0 ++ || strcmp(cs35l41->acpi_subsystem_id, "10431483") == 0 ++ || strcmp(cs35l41->acpi_subsystem_id, "10431493") == 0) { ++ reset_gpio = 1; ++ } ++ cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, reset_gpio, GPIOD_OUT_HIGH); ++ + hw_cfg->valid = true; + + return 0; @@ -85,21 +86,22 @@ index 673f23257a09..2bf2365cef50 100644 struct cs35l41_prop_model { const char *hid; const char *ssid; -@@ -53,6 +96,17 @@ struct cs35l41_prop_model { - const struct cs35l41_prop_model cs35l41_prop_model_table[] = { +@@ -85,6 +126,18 @@ static const struct cs35l41_prop_model c { "CLSA0100", NULL, lenovo_legion_no_acpi }, { "CLSA0101", NULL, lenovo_legion_no_acpi }, -+ { "CSC3551", "10431433", asus_rog_2023_i2c_no_acpi }, // ASUS GS650P -+ { "CSC3551", "10431463", asus_rog_2023_i2c_no_acpi }, // ASUS GA402X -+ { "CSC3551", "10431473", asus_rog_2023_spi_no_acpi }, // ASUS GU604V -+ { "CSC3551", "10431483", asus_rog_2023_spi_no_acpi }, // ASUS GU603V -+ { "CSC3551", "10431493", asus_rog_2023_spi_no_acpi }, // ASUS GV601V -+ { "CSC3551", "10431573", asus_rog_2023_spi_no_acpi }, // ASUS GZ301V -+ { "CSC3551", "104317F3", asus_rog_2023_i2c_no_acpi }, // ASUS ROG ALLY -+ { "CSC3551", "10431B93", asus_rog_2023_spi_no_acpi }, // ASUS G614J -+ { "CSC3551", "10431CAF", asus_rog_2023_spi_no_acpi }, // ASUS G634J -+ { "CSC3551", "10431C9F", asus_rog_2023_spi_no_acpi }, // ASUS G614JI -+ { "CSC3551", "10431D1F", asus_rog_2023_i2c_no_acpi }, // ASUS G713P + { "CSC3551", "103C89C6", hp_vision_acpi_fix }, ++ { "CSC3551", "10431433", asus_rog_2023_spkr_id2 }, // ASUS GS650P - i2c ++ { "CSC3551", "10431463", asus_rog_2023_spkr_id2 }, // ASUS GA402X/N - i2c, reset gpio 0 ++ { "CSC3551", "10431473", asus_rog_2023_spkr_id2 }, // ASUS GU604V - spi, reset gpio 1 ++ { "CSC3551", "10431483", asus_rog_2023_spkr_id2 }, // ASUS GU603V - spi, reset 1, spkr 1 ++ { "CSC3551", "10431493", asus_rog_2023_spkr_id2 }, // ASUS GV601V - spi, reset gpio 1 ++ { "CSC3551", "10431573", asus_rog_2023_spkr_id2 }, // ASUS GZ301V - spi, reset gpio 0 ++ { "CSC3551", "104317F3", asus_rog_2023_spkr_id2 }, // ASUS ROG ALLY - i2c ++ { "CSC3551", "10431B93", asus_rog_2023_spkr_id2 }, // ASUS G614J - spi, reset gpio 0 ++ { "CSC3551", "10431CAF", asus_rog_2023_spkr_id2 }, // ASUS G634J - spi, reset gpio 0 ++ { "CSC3551", "10431C9F", asus_rog_2023_spkr_id2 }, // ASUS G614JI -spi, reset gpio 0 ++ { "CSC3551", "10431D1F", asus_rog_2023_spkr_id2 }, // ASUS G713P - i2c ++ { "CSC3551", "10431F1F", asus_rog_2023_spkr_id2 }, // ASUS H7604JV - spi, reset gpio 0 {} }; |