Skip to content

Commit 92bf736

Browse files
Stefan Bindingtiwai
authored andcommitted
ALSA: hda: cs35l41: Support HP models without _DSD using dual Speaker ID
Laptops 103C8C66, 103C8C67, 103C8C68, 103C8C6A use a dual speaker id system where each speaker has its own speaker id. The generic configuration table doesn't support this, so it needs its own function. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20240126164005.367021-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 33e5e64 commit 92bf736

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

sound/pci/hda/cs35l41_hda_property.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,42 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
335335
return 0;
336336
}
337337

338+
/*
339+
* Systems 103C8C66, 103C8C67, 103C8C68, 103C8C6A use a dual speaker id system - each speaker has
340+
* its own speaker id.
341+
*/
342+
static int hp_i2c_int_2amp_dual_spkid(struct cs35l41_hda *cs35l41, struct device *physdev, int id,
343+
const char *hid)
344+
{
345+
struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg;
346+
347+
/* If _DSD exists for this laptop, we cannot support it through here */
348+
if (acpi_dev_has_props(cs35l41->dacpi))
349+
return -ENOENT;
350+
351+
/* check I2C address to assign the index */
352+
cs35l41->index = id == 0x40 ? 0 : 1;
353+
cs35l41->channel_index = 0;
354+
cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH);
355+
if (cs35l41->index == 0)
356+
cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 1);
357+
else
358+
cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 2);
359+
hw_cfg->spk_pos = cs35l41->index;
360+
hw_cfg->gpio2.func = CS35L41_INTERRUPT;
361+
hw_cfg->gpio2.valid = true;
362+
hw_cfg->valid = true;
363+
364+
hw_cfg->bst_type = CS35L41_INT_BOOST;
365+
hw_cfg->bst_ind = 1000;
366+
hw_cfg->bst_ipk = 4100;
367+
hw_cfg->bst_cap = 24;
368+
hw_cfg->gpio1.func = CS35L41_NOT_USED;
369+
hw_cfg->gpio1.valid = true;
370+
371+
return 0;
372+
}
373+
338374
/*
339375
* Device CLSA010(0/1) doesn't have _DSD so a gpiod_get by the label reset won't work.
340376
* And devices created by serial-multi-instantiate don't have their device struct
@@ -414,6 +450,10 @@ static const struct cs35l41_prop_model cs35l41_prop_model_table[] = {
414450
{ "CSC3551", "103C8C4F", generic_dsd_config },
415451
{ "CSC3551", "103C8C50", generic_dsd_config },
416452
{ "CSC3551", "103C8C51", generic_dsd_config },
453+
{ "CSC3551", "103C8C66", hp_i2c_int_2amp_dual_spkid },
454+
{ "CSC3551", "103C8C67", hp_i2c_int_2amp_dual_spkid },
455+
{ "CSC3551", "103C8C68", hp_i2c_int_2amp_dual_spkid },
456+
{ "CSC3551", "103C8C6A", hp_i2c_int_2amp_dual_spkid },
417457
{ "CSC3551", "103C8CDD", generic_dsd_config },
418458
{ "CSC3551", "103C8CDE", generic_dsd_config },
419459
{ "CSC3551", "104312AF", generic_dsd_config },

0 commit comments

Comments
 (0)