2024-01-26 11:31:47

by Stefan Binding

[permalink] [raw]
Subject: [PATCH v1 0/4] Support HP Models without _DSD

Add Quirks and driver properties for Dell models.
Driver properties are required since these models do not have _DSD.
Some models require special handing for Speaker ID and cannot use
the configuration table to add properties.
Also fix an issue for Channel Index property, when set through the
configuration table, to use the same method as when loading _DSD
properties. This is needed for laptops with 4 amps where the
channels do not alternate.

Stefan Binding (4):
ALSA: hda: cs35l41: Set Channel Index correctly when system is missing
_DSD
ALSA: hda: cs35l41: Support additional HP Envy Models
ALSA: hda: cs35l41: Support HP models without _DSD using dual Speaker
ID
ALSA: hda/realtek: Add quirks for various HP ENVY models

sound/pci/hda/cs35l41_hda_property.c | 90 +++++++++++++++++++++++-----
sound/pci/hda/patch_realtek.c | 40 +++++++++++++
2 files changed, 114 insertions(+), 16 deletions(-)

--
2.34.1



2024-01-26 11:31:57

by Stefan Binding

[permalink] [raw]
Subject: [PATCH v1 1/4] ALSA: hda: cs35l41: Set Channel Index correctly when system is missing _DSD

Current method to set Channel Index when the system is missing _DSD
assumes that the channels alternate, which is not guaranteed.
Instead use the same methodology as the main driver does when _DSD
exists.

Fixes: 8c4c216db8fb ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD")

Signed-off-by: Stefan Binding <[email protected]>
---
sound/pci/hda/cs35l41_hda_property.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c
index 35277ce890a4..87edf0d2fbb0 100644
--- a/sound/pci/hda/cs35l41_hda_property.c
+++ b/sound/pci/hda/cs35l41_hda_property.c
@@ -203,6 +203,7 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
struct spi_device *spi;
bool dsd_found;
int ret;
+ int i;

for (cfg = cs35l41_config_table; cfg->ssid; cfg++) {
if (!strcasecmp(cfg->ssid, cs35l41->acpi_subsystem_id))
@@ -288,16 +289,6 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
cs35l41->index = id == 0x40 ? 0 : 1;
}

- if (cfg->num_amps == 3)
- /* 3 amps means a center channel, so no duplicate channels */
- cs35l41->channel_index = 0;
- else
- /*
- * if 4 amps, there are duplicate channels, so they need different indexes
- * if 2 amps, no duplicate channels, channel_index would be 0
- */
- cs35l41->channel_index = cs35l41->index / 2;
-
cs35l41->reset_gpio = fwnode_gpiod_get_index(acpi_fwnode_handle(cs35l41->dacpi), "reset",
cs35l41->index, GPIOD_OUT_LOW,
"cs35l41-reset");
@@ -305,6 +296,11 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde

hw_cfg->spk_pos = cfg->channel[cs35l41->index];

+ cs35l41->channel_index = 0;
+ for (i = 0; i < cs35l41->index; i++)
+ if (cfg->channel[i] == hw_cfg->spk_pos)
+ cs35l41->channel_index++;
+
if (cfg->boost_type == INTERNAL) {
hw_cfg->bst_type = CS35L41_INT_BOOST;
hw_cfg->bst_ind = cfg->boost_ind_nanohenry;
--
2.34.1


2024-01-26 15:17:09

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH v1 0/4] Support HP Models without _DSD

On Fri, 26 Jan 2024 12:30:03 +0100,
Stefan Binding wrote:
>
> Add Quirks and driver properties for Dell models.
> Driver properties are required since these models do not have _DSD.
> Some models require special handing for Speaker ID and cannot use
> the configuration table to add properties.
> Also fix an issue for Channel Index property, when set through the
> configuration table, to use the same method as when loading _DSD
> properties. This is needed for laptops with 4 amps where the
> channels do not alternate.
>
> Stefan Binding (4):
> ALSA: hda: cs35l41: Set Channel Index correctly when system is missing
> _DSD
> ALSA: hda: cs35l41: Support additional HP Envy Models
> ALSA: hda: cs35l41: Support HP models without _DSD using dual Speaker
> ID
> ALSA: hda/realtek: Add quirks for various HP ENVY models

The last one conflicts with the latest for-next branch due to the
recent change from Cirrus. Could you rebase and resubmit?


thanks,

Takashi

2024-01-26 15:45:32

by Richard Fitzgerald

[permalink] [raw]
Subject: Re: [PATCH v1 0/4] Support HP Models without _DSD

On 26/01/2024 15:14, Takashi Iwai wrote:
> On Fri, 26 Jan 2024 12:30:03 +0100,
> Stefan Binding wrote:
>>
>> Add Quirks and driver properties for Dell models.
>> Driver properties are required since these models do not have _DSD.
>> Some models require special handing for Speaker ID and cannot use
>> the configuration table to add properties.
>> Also fix an issue for Channel Index property, when set through the
>> configuration table, to use the same method as when loading _DSD
>> properties. This is needed for laptops with 4 amps where the
>> channels do not alternate.
>>
>> Stefan Binding (4):
>> ALSA: hda: cs35l41: Set Channel Index correctly when system is missing
>> _DSD
>> ALSA: hda: cs35l41: Support additional HP Envy Models
>> ALSA: hda: cs35l41: Support HP models without _DSD using dual Speaker
>> ID
>> ALSA: hda/realtek: Add quirks for various HP ENVY models
>
> The last one conflicts with the latest for-next branch due to the
> recent change from Cirrus. Could you rebase and resubmit?
>

Yes, sorry. That's my fault for not syncing up with Stefan before
sending the other patch.