1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
From 76556b655f7b50afe5c58006f44221900e5711a9 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 v2] 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.
The currently added laptops are:
- ASUS GS650P, i2c
- ASUS GA402X, i2c
- ASUS GU604V, spi
- ASUS GU603V, spi
- ASUS GV601V, spi
- ASUS GZ301V, spi
- ASUS ROG ALLY, i2c
- ASUS G614J, spi
- 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.
Co-developed-by: Jonathan LoBue <jlobue10@gmail.com>
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 | 57 ++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c
index c83328971728..de0802859849 100644
--- a/sound/pci/hda/cs35l41_hda_property.c
+++ b/sound/pci/hda/cs35l41_hda_property.c
@@ -76,6 +76,49 @@ static int hp_vision_acpi_fix(struct cs35l41_hda *cs35l41, struct device *physde
hw_cfg->bst_ind = 1000;
hw_cfg->bst_ipk = 4500;
hw_cfg->bst_cap = 24;
+
+ hw_cfg->valid = true;
+
+ return 0;
+}
+
+/*
+ * The CSC3551 is used in almost the entire 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_no_acpi(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 or I2C address to assign the index */
+ cs35l41->index = (id == 0 || id == 0x40) ? 0 : 1;
+ cs35l41->channel_index = 0;
+ 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, "10431473") == 0
+ || strcmp(cs35l41->acpi_subsystem_id, "10431483") == 0
+ || strcmp(cs35l41->acpi_subsystem_id, "10431493") == 0
+ || strcmp(cs35l41->acpi_subsystem_id, "10431CAF") == 0
+ || strcmp(cs35l41->acpi_subsystem_id, "10431CCF") == 0
+ || strcmp(cs35l41->acpi_subsystem_id, "10431E02") == 0) {
+ reset_gpio = 1;
+ }
+ cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, reset_gpio, GPIOD_OUT_HIGH);
+
hw_cfg->valid = true;
return 0;
@@ -92,6 +135,20 @@ 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 },
+ { "CSC3551", "10431433", asus_rog_2023_no_acpi }, // GS650P i2c
+ { "CSC3551", "10431463", asus_rog_2023_no_acpi }, // GA402X/N i2c, rst=0
+ { "CSC3551", "10431473", asus_rog_2023_no_acpi }, // GU604V spi, rst=1
+ { "CSC3551", "10431483", asus_rog_2023_no_acpi }, // GU603V spi, rst=1, spkr=1
+ { "CSC3551", "10431493", asus_rog_2023_no_acpi }, // GV601V spi, rst=1
+ { "CSC3551", "10431573", asus_rog_2023_no_acpi }, // GZ301V spi, rst=0
+ { "CSC3551", "104317F3", asus_rog_2023_no_acpi }, // ROG ALLY i2c, rst=0
+ { "CSC3551", "10431B93", asus_rog_2023_no_acpi }, // G614J spi, rst=0
+ { "CSC3551", "10431C9F", asus_rog_2023_no_acpi }, // G614JI spi, rst=0
+ { "CSC3551", "10431CAF", asus_rog_2023_no_acpi }, // G634J spi, rst=1
+ { "CSC3551", "10431CCF", asus_rog_2023_no_acpi }, // G814J spi, rst=1
+ { "CSC3551", "10431D1F", asus_rog_2023_no_acpi }, // G713P i2c, rst=0
+ { "CSC3551", "10431E02", asus_rog_2023_no_acpi }, // UX3042Z spi, rst=1
+ { "CSC3551", "10431F1F", asus_rog_2023_no_acpi }, // H7604JV spi, rst=0
{}
};
--
2.41.0
|